SUB Instruction
SUB subtracts a source operand from a destination operand.
SUB — Subtract |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADD and MOV instructions.
| Register & Immediate | Memory & Register | Clear |
.data X SDWORD 20h .code mov eax, X sub eax, 20 call WriteInt |
.data X SDWORD 20h Y SDWORD 20 .code mov eax, Y sub X, eax call WriteInt |
.data X SDWORD 20h Y SDWORD 20 .code sub eax, eax sub eax, Y add eax, X call WriteInt |
| Output | Output | Output |