![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() |

|
| Programming Error ! Programming error messages |
![]() |
|
I Need A Reference Or An Example Code About Psp
|
LinkBack | Thread Tools | Display Modes |
|
|
|
|
|
#2 (permalink) |
|
Fixed Error!
Posts: 4,202
Join Date: Mar 2007
Rep Power: 6
IM:
|
#data segment, aka memory allocation .data result: .word 0x00 #hex value of zero .text li $t0, 0xA1 #Loads the immediate value 161 to register $t0, this is actually a psuedo instruction in MIPS #which is lui (load upper immediate) #and ori (or immediate) to get the lower bits addi $t1, $t0, 0x01 #this is add immediate adding registers would be add, the first register is the destination #the second is the first register to add and the last is the immediate value #aka the result of 0xA2 is stored in $t1 sw $t1, result #this is store word #the format is the value you wish to store and the data segment you wish to store it in #there is also sb (store byte) or $s1, $t1, $zero #move in MIPS is also a psuedo instruction so if you want to move something... ;-) OR it with zero thus you move #the value of $t1 into $s1 because if you or 11 with 00 you get 11... wonderful how that works eh? I can't tell you syscalls to get input or output because i don't know how psp handles I/O for syscalls... generally the numeric syscall is stored in $v0 and the output is stored in $a0, well the address of the string anyway. Input is generally read and stored back into $v0 from where you can move it and put it into a more perminent register. ;-) Anywho... I really hope this helps some... but very few people actually want to get down and dirty and write the asm code to make hardware do your bidding but it is one approach to do this... plus you can trouble shoot this way too. Look at yoru compiled files in hex and read the instructions, you can easily hand disassemble MIPS hex back into ASM without any problems, so give it a whirl. |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|