How to print .word value that is in the memory in Assembly without using la/li -
How do I print a word value that is used without the use of It's mine to print my I wrote a single code except the different address but nothing I also tried to search but I did not find the exact answer to this question. Please advise me if I have any misunderstanding, thank you in advance. There are some errors in your code. First of all, if you want to print an integer, then instead of # 4 Syscall # 1 should be used Then, if you want to print an integer that is in memory , Then you have to load that word from memory. Your code should look like this: la / li In memory? I can only use basic functions I can print the
.asciiz , but I do not know what I am doing that is not printing the values (integer) in the memory address :(
asciiz :
luie $ a0, 0x1001 addi $ a0, $ a0, 12 # Set the code for my string location to $ v0, $ 0, 4 syscall
lw $ a0, 0x100c # address 0x1000 + 12 addi $ Load content of the set word set to v0, $ 0, 1 #, set service # 1 (which prints an integer) syscall # call system
Comments
Post a Comment