Addition Program: Org 00H CLR A Mov 20H,#10 MOV R0,#20H Again: ADD A,@03 DEC@R0 CJNE@R0,#00H, AGAIN MOV 30H, A END
This program performs addition using a loop. It clears register A, loads the values 10 and 20H into registers, then enters a loop that adds the value at memory location 03H to register A, decrements the value in register 0, and continues the loop until register 0 is 0. After the loop, it stores the final value of register A at memory location 30H.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
34 views1 page
Addition Program: Org 00H CLR A Mov 20H,#10 MOV R0,#20H Again: ADD A,@03 DEC@R0 CJNE@R0,#00H, AGAIN MOV 30H, A END
This program performs addition using a loop. It clears register A, loads the values 10 and 20H into registers, then enters a loop that adds the value at memory location 03H to register A, decrements the value in register 0, and continues the loop until register 0 is 0. After the loop, it stores the final value of register A at memory location 30H.