Program Sections
|
Section |
Description |
|---|---|
|
data section |
the syntax for declaring a data section
|
|
bss section |
the syntax for declaring a bss section
|
|
text section |
the syntax for declaring a text section
this section must begin with the declaration global _start, which tells the kernel where the program execution begins |
Statement Types
|
Statement Type |
Description |
|---|---|
|
instruction |
|
|
assembler directive or pseudo-op |
|
|
macro |
|
Syntax of a Statement
[label] mnemonic [operands] [;comment]
some examples of typical statements
INC COUNT ; Increment the memory variable COUNT
MOV TOTAL, 48 ; Transfer the value 48 in the memory variable TOTAL
ADD AH, BH ; Add the content of the BH register into the AH register
AND MASK1, 128 ; Perform AND operation on the variable MASK1 and 128
ADD MARKS, 10 ; Add 10 to the variable MARKS
MOV AL, 10 ; Transfer the value 10 to the AL register