8085 Program - Transferring a block of DATA

Q. A table having starting address 2060h contains ten numbers of 8-bit data. Write a program in 8085 microprocessor that transfers the data to next table having starting address 2070h if the data is greater than 50h else store it to next table at 2080h.
Program:

LXI B,2060h
LXI H,2070h
LXI D,2080h
START: LDAX B
CPI 50H
JC NEXT
MOV M,A
INX B
INX H
MOV A,C
CPI 0Ah
JNZ START
JMP LAST
NEXT: STAX D
INX B
INX D
MOV A,C
CPI 0Ah
JNZ START
LAST: HLT

2 comments: