Statement: Find the 7-segment codes for given 5 numbers from memory location 6000H and store the result from memory location 7000H.
Sample Problem: (6000) H = 8AH
Source Program
LXI H, 6200H : Initialize lookup table pointer
LXI D, 6000H : Initialize source memory pointer
LXI B, 7000H : Initialize destination memory pointer
BACK: LDAX D : Get the number
MOV L, A : A point to the 7-segment code
MOV A, M : Get the 7-segment code
STAX B : Store the result at destination memory location
INX D : Increment source memory pointer
INX B : Increment destination memory pointer
MOV A, C
CPI O5H : Check for last number
JNZ BACK : If not repeat
HLT : End of program
Source Program
LXI H, 6200H : Initialize lookup table pointer
LXI D, 6000H : Initialize source memory pointer
LXI B, 7000H : Initialize destination memory pointer
BACK: LDAX D : Get the number
MOV L, A : A point to the 7-segment code
MOV A, M : Get the 7-segment code
STAX B : Store the result at destination memory location
INX D : Increment source memory pointer
INX B : Increment destination memory pointer
MOV A, C
CPI O5H : Check for last number
JNZ BACK : If not repeat
HLT : End of program
No comments:
Post a Comment