Write a complete assembly program that puts in r0 the value
Write a complete assembly program that puts in r0 the value 23 and in r1 the value 72, then it adds them and puts the result in r5. Use the register bank 3. Repeat the above by using the memory addresses of the registers.
Solution
3.
SETB PSW.3 ; set PSW.3 and PSW.4 to select Bank 3
SETB PSW.4
MOV R0, #17H ; Load R0 with 23 (Hexadecimal equivalent is17H)
MOV R1, #48H ; Load R1 with 72 (Hexadecimal equivalent is 48H)
------------------------------------------------------------------------------------------------------
4. In Direct Addressing mode
SETB PSW.3 ; set PSW.3 and PSW.4 to select Bank 3
SETB PSW.4
MOV 18h, #17H ; Load R0 with 23 (Hexadecimal equivalent is17H)
MOV 19h, #48H ; Load R1 with 72 (Hexadecimal equivalent is 48H)
