943,902 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 3285
  • Assembly RSS
Dec 17th, 2005
0

MIPS language question pls help..

Expand Post »
address data
-------------------------
0xad 0x59
0xae 0xfa
0xaf 0x9d
oxb0 0xa6
0xb1 0x78
0xb2 0x04
oxb3 0xbc
oxb4 0x88
0xb8 0xff
the MIPS code:
addi $s1, $zero, 0xab
lb $t0, 5($s1)
lw $t1, 5($s1)
addi $s1, $s1, 11
lbu $t2, -8($s1)
lw $t3, -8($s1)

wat will the hexadecimal value be of registers $t0, $t1, $t2,$t3,after executing the above codes, if the system is using little-endian byte order?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
c21ahongyi is offline Offline
2 posts
since Dec 2005
Mar 15th, 2006
0

Re: MIPS language question pls help..

You can't load word
Assembly Syntax (Toggle Plain Text)
  1. lw $t1, 5($s1)
becouse 5 isn't divisable with 4 so you also can't do this
Assembly Syntax (Toggle Plain Text)
  1. addi $s1, $s1, 11
and then
Assembly Syntax (Toggle Plain Text)
  1. lw $t3, -8($s1)
the rest is correct so $t0 is 0xFFFFFF9d and $t2 is 0x000000fa. For learning MIPS you can use SPIM (yes revers from MIPS) simulator.
Whole asm code
Assembly Syntax (Toggle Plain Text)
  1. # FAKULTET TEHNICKIH NAUKA NOVI SAD
  2. # KATEDRA ZA RACUNARSKU TEHNIKU I MEDJURACUNARSKE KOMUNIKACIJE
  3. #################################################
  4. # text segment #
  5. #################################################
  6.  
  7. .text
  8. .globl main
  9.  
  10. main: # ovde pocinje izvrsavanje
  11. la $s1, dat1
  12. lb $t0, 5($s1)
  13. # lw $t1, 5($s1) # greska (error)
  14. addi $s1, $s1, 11
  15. lbu $t2, -8($s1)
  16. # lw $t3, -8($s1) # error
  17.  
  18.  
  19. #################################################
  20. # segment podataka #
  21. #################################################
  22.  
  23. .data
  24. dat1: .byte 0xad 0x59 0xae 0xfa 0xaf 0x9d 0xb0 0xa6 0xb1 0x78 0xb2 0x04 0xb3 0xbc 0xb4 0x88 0xb8 0xff
  25.  
  26. ##
  27. ##
Reputation Points: 251
Solved Threads: 29
Posting Whiz in Training
andor is offline Offline
274 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: Assembly Instrucitions
Next Thread in Assembly Forum Timeline: MIPS language question2 pls help..





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC