Expt 6 A
Expt 6 A
(a) Write the assembly code for the following: Store 15 numbers from the memory location 0040H
to 004FH and another 15 numbers from 0050H to 005FH. Add two numbers with the same ordinal
positions in the two sets. Store the results at memory locations starting from 0060H.
Assembly Code:
ORG 0000H
MOV R0,#40H
MOV R1,#50H
MOV R2,#60H
MOV R3,#0FH
ADD A,@R1
MOV B,A
MOV A,R1
ADD A,#10H
MOV R1,A
MOV @R1,B
SUBB A,#10H
MOV R1,A
INC R0
INC R1
INC R2
DJNZ R3,LOOP
END
Observation: