A "hello world" x86_64 program for the Torque meta-assembler
Computer programs nowadays are typically written in high-level programming languages that abstract away processor-specific and OS-specific details. Where the high-low language boundary is drawn is arbitrary but most people tend to believe that third-generation languages and below are low-level.
So what's a third-generation programming language?
TBD define magic bytes as list of word templates (0x7f ELF) and link to defining bytes, explain what blocks, words, and word templates are and explain why we are using 8-bit words even though x86_64 has a word size of 64 bits (x86_64 deals in bytes, i.e. incrementing a memory address points to the next byte and not the next group of 4 bytes (word))
Let's continue by explicitly defining the smallest adderrable unit of memory supported by the x86_64 ISA: an octet of bits, also known as a "byte". Even though the term "byte" can be ambiguous when compared to other ISAs, we'll stick with it for now:
( A byte refers to an octet of information on x86_64 CPUs )
%BYTE:n #nnnn_nnnn;
This is a block macro that takes in an argument, n, and constructs an 8-bit word template with the entire range of bits being replaced by n; as a result, this macro will only work when an integer 8-bits or narrower is provided, otherwise an error occurs at compile time.
The underscores seperating the two clusters of four ns each represent a "nibble" of information (4 bits). This is useful as each nibble of four binary digits can be represented by one hexadecimal digit, e.g. 0xF = 0b1111.