assembly - How to modify .data values inside the .text segment in Mips? -


i have global variable in mips declared @ .data segment

.data    globalvariable:  .word  10 

how can access , modify content inside .text segment?

.data    globalvariable:  .word  10  .text     #access    lw $a0, globalvariable      #modify    la $a0, globalvariable #get address    li $a1, 11 #new value    sw $a1 0($a0) #save new value     lw $a2, globalvariable  #get new value 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -