Integer constant
- Leading sign (optional)
- One or more digit
- Radix (h, d, b, r, ...)
Integer expression
- Integer value and their arithmetic operation
Contoh: +, - , /, *
Constant expression
-
Real number constant
Real number constant = presented as decimal number constant
[sign]integer.[integer][exponent]
sign = {+,-}
Example:
+3.0
-44.2E+3
Character constant
String constant
Identifiers
A programmer chosen name.
Might identify a variable, constant, procedure, or a code label
Example:
_main
myVar
Directives
can define: variable, macros, and procedures
can assign name to memory segment
don't executed at run time
Example:
.data, .DATA, .
DWORD
Part 2:
.data
.code
.segment 100h
Instruction
- Label
- Mnemonic
- Operand
- Comment
Basic syntax:
[label:] mnemonic [operands][;comment]
Label
- code label
Used as jump
Mnemonic
mov = move
Operand
Instruction can have zero operand, two operand, three operand, each of which can be a register, memory operand, constant expression, or input-output port.
Contoh:
96
2 + 4 constant expression
eax register
count memory
- Leading sign (optional)
- One or more digit
- Radix (h, d, b, r, ...)
Integer expression
- Integer value and their arithmetic operation
Contoh: +, - , /, *
Constant expression
-
Real number constant
Real number constant = presented as decimal number constant
[sign]integer.[integer][exponent]
sign = {+,-}
Example:
+3.0
-44.2E+3
Character constant
String constant
Identifiers
A programmer chosen name.
Might identify a variable, constant, procedure, or a code label
Example:
_main
myVar
Directives
can define: variable, macros, and procedures
can assign name to memory segment
don't executed at run time
Example:
.data, .DATA, .
DWORD
Part 2:
.data
.code
.segment 100h
Instruction
- Label
- Mnemonic
- Operand
- Comment
Basic syntax:
[label:] mnemonic [operands][;comment]
Label
- code label
Used as jump
Mnemonic
mov = move
Operand
Instruction can have zero operand, two operand, three operand, each of which can be a register, memory operand, constant expression, or input-output port.
Contoh:
96
2 + 4 constant expression
eax register
count memory
No comments:
Post a Comment