MICRO LAB EXAMPLES - (ECE3003)
Program 1. Write and assemble a program to add the following data and then use the simulator to examine the CY flag. Code: ORG 0000H MOV A,#92H MOV R0,#23H ADD A,R0 JNC L1 INC R7 L1: MOV R1,#66H ADD A,R1 JNC L2 INC R7 L2: MOV R2,#87H ADD A,R2 JNC L3 INC R7 L3: MOV R3,#0F5H ADD A,R3 JNC L4 INC R7 L4: END Program 2. Write and assemble a program to load the values into each register R0-R4 and then push each of these registers onto the stack. Single Step program and examine the stack and the SP register after execution of each instruction. Code: ORG 0000H MOV R0,#25H MOV R1,#35H MOV R2,#45H MOV R3,#55H MOV R4,#65H PUSH 0 PUSH 1 PUSH 2 PUSH 3 PUSH 4 END Program 3. Add the following subroutine to the previous program, single step through the subroutine and examine the RAM locations. After data has been transferred from ROM space into RAM, the subroutine should copy the data from RAM locations starting at 40H to ROM locations starting at 60H. Code: ORG 0000H MOV DPTR,#200H MOV R0,#
Comments
Post a Comment