| | |
MIPS language question pls help..
![]() |
•
•
Join Date: Dec 2005
Posts: 2
Reputation:
Solved Threads: 0
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?
-------------------------
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?
You can't load word becouse 5 isn't divisable with 4 so you also can't do this and then 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)
lw $t1, 5($s1)
Assembly Syntax (Toggle Plain Text)
addi $s1, $s1, 11
Assembly Syntax (Toggle Plain Text)
lw $t3, -8($s1)
Whole asm code
Assembly Syntax (Toggle Plain Text)
# FAKULTET TEHNICKIH NAUKA NOVI SAD # KATEDRA ZA RACUNARSKU TEHNIKU I MEDJURACUNARSKE KOMUNIKACIJE ################################################# # text segment # ################################################# .text .globl main main: # ovde pocinje izvrsavanje la $s1, dat1 lb $t0, 5($s1) # lw $t1, 5($s1) # greska (error) addi $s1, $s1, 11 lbu $t2, -8($s1) # lw $t3, -8($s1) # error ################################################# # segment podataka # ################################################# .data dat1: .byte 0xad 0x59 0xae 0xfa 0xaf 0x9d 0xb0 0xa6 0xb1 0x78 0xb2 0x04 0xb3 0xbc 0xb4 0x88 0xb8 0xff ## ##
![]() |
Similar Threads
- New programming language question about Magic (Computer Science)
- have a question - pls help !! (Linux Servers and Apache)
- MIPS language question2 pls help.. (Assembly)
- Easy (I hope) MIPS (SPIM) Question (Assembly)
Other Threads in the Assembly Forum
- Previous Thread: Assembly Instrucitions
- Next Thread: MIPS language question2 pls help..
Views: 3111 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Assembly
80386 :( adress array asm assembler assembly boot bootloader buffer call compression cursor directory display div division docs dos endtask error exceptions file int10h integer intel interrupt interrupts language loop main mmx multiple newbie osdevelopment print program range read remainder string text theory tsr x86





