How to do this question? Can you teach me like basic knowledge?? Thanks you! as
ID: 3741665 • Letter: H
Question
How to do this question? Can you teach me like basic knowledge?? Thanks you! as simplest as you can!
Problem 7 (10 pts) Execute the following program, and fill in the blanks with correct values for registers PC and AC, and the contents in memory locations X, temp and subr after each instruction is executed starting from the first instruction. PC AC MX M[temp] M[subr] 101 102 108 24 109 10A 48 103 104 105 48 Hex ??? Address Label Instruction 100 101 102 103 104 105 106 107 108 109 10A 24 24 24 24 21 24 48 48 24 0 LoadX Store temp UnS Store X Halt 24 24 24 24 24 24 24 24 subr 103 103 103 103 103 103 24 X, Dec 24 temp, Dec subr, Hex 48 Load Add JumpI mp temp subr 48Explanation / Answer
Explanation
PC=next instruction address=101
AC=data in the memory=here it is data pointing the address X ,So Ac=24. Which reside in M[X] where 105
So, M[x]=24
value assign in temp memory space(106) is 0, so,M[temp]=0 and M[subr]=0=assigned in 107
Store temp
Here,
PC=102, AC=ALU now processing x data, that is 24,So AC=24
M[X]=24 M[temp]=store value of X=24 and M[subr]=0
JnS subr---->mean check the sign flag set or not.If not set then jump into "subr" label.
So, PC=108(next address of label subr)
AC=process same value=24
M[X]=24 M[temp]=24 M[subr]=store the return address =103
Load temp
PC=109 AC=24(temp data) M[x]=24 M[x]=24 and M[subr]=103
Add temp
PC=10A AC=24+24=48 M[x]=24 M[temp]=24 M[subr]=103
JumpI subr--->jump into jumpr pointing address means103
So,
PC=next instruction address=103 AC=48 M[x]=24 M[temp]=24 M[subr]=103
Store X--- >store accumulator value into memory of X
PC=104 AC=48 M[X]=48 M[temp]=24 M[subr]=103
HALT--->end of the execution
PC=105 AC=48 M[X]=48 M[temp]=24 M[subr]=103
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.