+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  PSX ASM instruction help.
Pages: [1]
Author Topic: PSX ASM instruction help.  (Read 2 times)
lckhoa
Guest
« on: November 14, 2008, 12:08:34 pm »

Hi all,

I am looking for a psx asm code which can subtract content of register $s1 by 4 for example but can not find it any where.
Actually in theory (i think) it will look like below but it's not.
 subu $s1,4

Is there any code can above job?

Thanks,
never-obsolete
Guest
« Reply #1 on: November 14, 2008, 12:30:22 pm »

try adding a negative

addi $s1, $s1, -4
Gemini
Guest
« Reply #2 on: November 14, 2008, 12:35:02 pm »

addiu s1, -4 [or] addiu s1, s1, -4
Maybe you should have checked any MIPS reference before asking.
lckhoa
Guest
« Reply #3 on: November 14, 2008, 12:48:02 pm »

Thanks very much and i am success with this code.
 addi $s1, 0xFFFC
Gemini
Guest
« Reply #4 on: November 14, 2008, 12:49:47 pm »

-4 and 0xFFFC are the same thing, no reason to use that to express negative numbers.
lckhoa
Guest
« Reply #5 on: November 14, 2008, 12:57:31 pm »

Thanks but you know that i am don't know C and also not good about asm.
I try to read a "MIPS Assembly Language Programing guide" and think about print font and finally got an idea like "why don't we just subtract pointer value to some number and see?"

Thanks very much.
Gemini
Guest
« Reply #6 on: November 14, 2008, 01:35:49 pm »

I would have posted a link to Pixel's R3000 wiki, but nobis-crew.org is currently temp-dead.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC