Figure 3-45 NOP and HLT instructions.

NameMnemonic and FormatDescription
No operation
NOP
Cause no action
Halt
HLT
Cause the operation of the computer to cease

Flags: No flags are affected.

Addressing modes: None.

To attach the "branch to" label to an instruction that takes action as follows

          JZ     EXIT
           .
           .
           .
EXIT:     MOV    AX,SUM[BX]
is relatively inflexible because, in order to insert new instructions at the point labeled EXIT, the move instruction must be retyped. If the sequence
          JZ     EXIT
           .
           .
           .
EXIT:     NOP
          MOV    AX,SUM[BX]
were used, insertions could be made without disturbing the present code. This is important during the debugging phase when message printout code may need to be temporarily included at key points (which are often "branch to" points) within

3-7 FLAG MANIPULATION INSTRUCTIONS

As we have seen, many instructions set or clear the flags depending on their results. Sometimes, however, it is necessary to have direct control of the flags.

Figure 3-46 Flag manipulation instructions.

NameMnemonic and FormatDescription
Clear carry
CLC
CF0
Complement carry
CMC
CFNOT CF
Set carry
STC
CF1
Clear direction
CLD
DF0
Set direction
STD
DF1
Clear interrupt
CLI
IF0
Set interrupt
STI
IF1
Load AH from flags*
LAHF
(AH)(Low-order byte of PSW)
Store AH to flags*
SAHF
(Low-order byte of PSW)(AH)

*Bits 0, 2, 4, 6, and 7 are transferred according to Fig. 2-8. Bits 1, 3, and 5 are indeterminate.

Flags: Only the indicated flags areŠ affected.

Addressing modes: None.


Table of Contents | Next page | Previous page

This is page 37.