Acessing register?

Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2009
Posts: 3
Reputation: bethesda is an unknown quantity at this point 
Solved Threads: 0
bethesda bethesda is offline Offline
Newbie Poster

Acessing register?

 
0
  #1
26 Days Ago
When I do this:

  1. la $a1, 9($t1)

the code works, but when I do this:

  1. marker: .word 9
  2. la $a1, marker($t1)

The code doesn't work.... I don't understand why....?
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 368
Reputation: gerard4143 is on a distinguished road 
Solved Threads: 47
gerard4143's Avatar
gerard4143 gerard4143 is offline Offline
Posting Whiz
 
0
  #2
26 Days Ago
Originally Posted by bethesda View Post
When I do this:

  1. la $a1, 9($t1)

the code works, but when I do this:

  1. marker: .word 9
  2. la $a1, marker($t1)

The code doesn't work.... I don't understand why....?
I'm not familiar with the above syntax so this is a guess....when you place 9 into the label marker you place into memory so the second set of instructions requires a memory call while the first, 9 can be made into part of the instruction or immediate so no memory call to retrieve it...Like I said this is a guess because I'm not familiar with this syntax....
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 3
Reputation: bethesda is an unknown quantity at this point 
Solved Threads: 0
bethesda bethesda is offline Offline
Newbie Poster
 
0
  #3
26 Days Ago
Originally Posted by gerard4143 View Post
I'm not familiar with the above syntax so this is a guess....when you place 9 into the label marker you place into memory so the second set of instructions requires a memory call while the first, 9 can be made into part of the instruction or immediate so no memory call to retrieve it...Like I said this is a guess because I'm not familiar with this syntax....

I want to access to access the value in $t1 in a loop, that is, access 0($t1) then 9($t1), then 18($t1)...
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC