8085 Program :: Transferring Block of Data

Q. Transfer a block of data from 2030h to 2040h only if the number is less than 20h and greater than 50h, else store 00h in the destination table.

LXI H, 2030H
LXI B, 2040H

LOOP: MOV A, M
CPI 20H
JNC NXT
JMP SAVE

NXT: CPI 51H
JNC SAVE

MVI A, 00H

SAVE: STAX B
INX H
INX B
MOV A, L
CPI 51H
JNZ LOOP
HLT

No comments:

Post a Comment