Chapter Fourb
Chapter Fourb
Instructions
Contents
Instructions:
MOV
PUSH/POP
Load-Effective Address
AF, OF, PF, SF, and ZF are updated, but CF is not affected.
This means that if an 8-bit destination containing FFH or a
16-bit destination containing FFFFH is incremented, the
result will be all 0’s with no carry.
INC BL: Add 1 to contains of BL register
INC CX: Add 1 to contains of CX register
INC BYTE PTR [BX]: Increment byte in data segment at
offset contained in BX
INC WORD PTR [BX]: Increment the word at offset of
[BX] and [BX + 1] in the DS
INC TEMP: Increment byte or word named TEMP in the
data
SUB
These instructions subtract the number in some source from the
number in some destination and put the result in the destination.
SUB Destination, Source
SBB Destination, Source
The SBB instruction also subtracts the content of carry flag from
the destination.
The source may be an immediate number, a register or memory
location.
The destination can also be a register or a memory location.
The source and the destination cannot both be memory location.
Flags affected: AF, CF, OF, PF, SF, ZF.
SUB CX, BX: CX - BX; Result in CX
SBB CH, AL: Subtract content of AL and content of
CF from content of CH. Result in CH.
SUB AX, 3427H: Subtract immediate number 3427H
from AX
DEC
DEC Destination
This instruction subtracts 1 from the destination word or byte.
The destination can be a register or a memory location.
AF, OF, SF, PF, and ZF are updated, but CF is not affected.
This means that if an 8-bit destination containing 00H or a 16-
bit destination containing 0000H is decremented, the result
will be FFH or FFFFH with no carry (borrow).
DEC CL Subtract 1 from content of CL register
DEC BP Subtract 1 from content of BP register
DEC BYTE PTR [BX] Subtract 1 from byte at offset
[BX] in DS
BH and result in AX