EENG-370 1. Find the content of the A register after each of the following is MO
ID: 3738939 • Letter: E
Question
EENG-370 1. Find the content of the A register after each of the following is MOV SP,#30H PUSH SOH MOV DPTR, #9001H MOVX A@DPTR MOV RO, A INC DPTR INC DPTR MoVX A, @DPTR Adr Content DEC SP POP ACC 53 D2 54 24 ADD A, RO ORG 8000 MoV SP, #30H LCALL SUB MOV DPTR, #9000H MOV R5,#0 MOV R7,#07H Adr Content 9000 7D 9001 66 9002 CC 9003 24 9004 A4 9005 80 9006 6A 9007 D2 9008 11F ST MOVXA aDPTR SUB MOV A, SP NB 0E7H, SKP INC R5 SKP: INC DPTR MOV A, #03H MOVC A, @A+PC SJMP SKP DB 62H DB 2BH DB 18H DB OFIH DJNZ R7, ST MOV A, R5 MOV SP,#30H PUSH 50H PUSH 51H MOV A, SP SKP:Explanation / Answer
Solution:
The first four subparts have been answered as per Chegg guidelines, please repost others.
A)
DPTR<= 90001H
A<= 66
R0<= 66
DPTR<= 9002H
<= 9003H
A<= 24
Addinng A and R0 we will get
8A
B)
DPTR<= 9000H
R5<= 0
R7<= 7
loo[p runs 7 times
so R5 runs from to 7
C)
MOV SP, #30H // Stack pointer points to 30H memory location
PUSH 50H // Contents of address 50H is copied to addr-31H (SP incremented by 1)
PUSH 51H //Contents of address 51H is copied to addr 32H(again SP incremented by 1)
MOV A,SP //Copy the content of SP (i.e addr- 32H) to register A.
There is 9E at the and in Register A
D)
MOV SP, #30H // Stack pointer points to 30H memory location
PUSH 50H // Contents of address 50H is copied to 31H (SP incremented by 1)
PUSH 51H //Contents of address 51H is copied to 32H(again SP incremented by 1)
MOV A,SP //Copy the content of SP (i.e 32H) to register A.
DEC SP // Sp is decremented by 1(SP points to addr 31H)
POP ACC// Load the value from SP(addr-31H) to register A(Content-7C)
There is 7C in register A at last.
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.