COAL Chapter 3: Week 3 Shoaib Rauf
COAL Chapter 3: Week 3 Shoaib Rauf
Week 3
Shoaib Rauf
• ESP (extended stack pointer register) contains the offset for the top
of the stack to addresses data on the stack (a system memory
structure)
• ESI and EDI (extended source index and extended destination index
) points to the source and destination string respectively in the string
move instructions
• An instruction contains:
– Label (optional)
– Mnemonic (required)
– Operand (depends on the instruction)
– Comment (optional)
• Basic syntax
– [label:] mnemonic [operands] [ ; comment]
• Data label
– must be unique
– example: myArray (not followed by colon)
– count DWORD 100
• Code label
– target of jump and loop instructions
– example: L1: (followed by colon)
• Operands
– constant 96
– constant expression2 + 4
– register eax
– memory (data label) count
• One operand
– inc eax ; register
– inc myByte ; memory
• Two operands
– add ebx, ecx ; register, register
– sub myByte, 25 ; memory, constant
– add eax, 36 * 25 ; register, constant-expression