MVI A, 32H
STA 8040H
MVI A, 10H
STA 8041H
MVI A, 45H
STA 8042H
MVI A, C3H
STA 8043H
MVI A, A4H
STA 8044H
MVI C, 05H : Initialize Counter
MVI A, 00H
STA 8050H : Store 00H in 8050H
LDA 8040H : Load the contents of 8040H to Accumulator
LXI H, 8040H : Store 8040H in H-L Register Pair
LOOP:
CPI 55H : Compare the contents of Accumulator with 55H
INX H : Increase Memory
MOV A, M : Copy the contents of Memory to Accumulator
JZ LOOP1 : If Zero Flag is 1, Jump to Loop1
DCR C : Decrease Counter
JNZ LOOP : If Zero Flag is 0, Jump to Loop
HLT : Halt the Program
LOOP1:
MVI A, FFH : Sotre FFH into Accumulator
STA 8050H : Copy the contents of Accuulator to 8050H
HLT : Halt the Program