Instruction Set
4-210
SAHF
SAHF
This example prevents an intervening instruction from modifying the Carry Flag (CF), which
is used to indicate the status of a hardware device.
Tips
SAHF is provided for compatibility with the 8080 microprocessor. It is now customary to
use POPF instead.
Related Instructions
If you want to
See
Process string components from lower to higher addresses
CLD
Disable all maskable interrupts
CLI
Copy the low byte of the Processor Status Flags register to AH
LAHF
Pop the top component from the stack into the Processor Status Flags register
POPF
Push the Processor Status Flags register onto the stack
PUSHF
Process string components from higher to lower addresses
STD
Enable maskable interrupts that are not masked by their interrupt control registers STI
UMINUEND
DW
6726
; 1A46h
USUBTRAHEND
DW
48531
; BD93h
; check to see if device is on or off
; return result in CF: 1 = on, 0 = off
CALL
CHECK_DEVICE
; set up registers
MOV
CX,UMINUEND
; CX = 1A46h
MOV
BX,USUBTRAHEND
; BX = BD93h
; save lower five flags in AH
LAHF
; unsigned subtraction: CX = CX - BX
SUB
CX,BX
; CX = 5CB3h, CF = 1
; restore saved flags from AH
SAHF
; CF = outcome of CHECK_DEVICE
; if device is off
JNC
ALERT_USER
; else
JMP
OKAY
ALERT_USER:
...
JMP
CONTINUE
OKAY:
...
CONTINUE:
...
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...