Instruction Set
4-129
LAHF
Load AH with Flags
LAHF
What It Does
LAHF copies the low byte of the Processor Status Flags (FLAGS) register to AH.
Syntax
Description
LAHF copies the Processor Status Flags (FLAGS) register to the AH register. After the
copy, the bits shadow the flags as follows:
n
AH bit 0 = Carry Flag
n
AH bit 2 = Parity Flag
n
AH bit 4 = Auxiliary Flag
n
AH bit 6 = Zero Flag
n
AH bit 7 = Sign Flag
Operation It Performs
Flag Settings After Instruction
Examples
This example clears the Carry Flag (CF) to 0. Normally, you use CLC to perform this
operation.
Form
Opcode
Description
Clocks
Am186 Am188
LAHF
9F
Load AH with low byte of Processor Status Flags register
2
2
LAHF
/* copy FLAGS to AH */
AH = FLAGS & 0x00FF;
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
–
–
–
–
–
– res – res – res –
; clear CF to 0
LAHF
; copy low byte of FLAGS to AH
AND
AH,11111110b
; clear bit 0 (CF) to 0
SAHF
; copy AH to low byte of FLAGS
4
Содержание 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...