Turn on thread page Beta

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

Announcements
    • Thread Starter
    Offline

    2
    ReputationRep:
    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 Images
      
    • Thread Starter
    Offline

    2
    ReputationRep:
    (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
 
 
 
Poll
Should Banksy be put in prison?

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.