URGENT!! URGENT! EXAM ON MONDAY!! assembly language trace table

Watch
This discussion is closed.
supreme
Badges: 2
Rep:
?
#1
Report Thread starter 15 years ago
#1
The question is the first attachment and the answer the other attachment:

I understand up to instruction [4], dry run once, but why on instruction [5] is the contents of register 1 stored in address 2003 instead of 2000???? .

Thanks I guess it is another of my silly mistakes lol
Attached files
0
supreme
Badges: 2
Rep:
?
#2
Report Thread starter 15 years ago
#2
(Original post by pig)
Because after instruction 4 you should have r1 = 2 and r2 = 3. So you store the contents of r1 in address (2000 + the value of r2) = 2000 + 3 = 2003.

Code:
line	r1	r2	2003	2002	2001	2000

1	0	?	?	?	?	?
2	0	4	?	?	?	?
3	2	4	?	?	?	?
4	2	3	?	?	?	?
5	2	3	2	?	?	?
6	2	3	2	?	?	?
3	4	3	2	?	?	?
4	4	2	2	?	?	?
5	4	2	2	4	?	?
6	4	2	2	4	?	?
3	6	2	2	4	?	?
4	6	1	2	4	?	?
5	6	1	2	4	6	?
6	6	1	2	4	6	?
3	8	1	2	4	6	?
4	8	0	2	4	6	?
5	8	0	2	4	6	8
6	8	0	2	4	6	8
7	8	0	2	4	6	8
NB I included every instruction here, your example table looks like you don't need to include them all.
Thanks you're a genius, sorry for wasting your time
0
X
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

How do you feel about your grades? Are they...

What I expected (116)
25.78%
Better than expected (93)
20.67%
Worse than expected (241)
53.56%

Watched Threads

View All