Just Getting Started. This ReadMe probably looks like shit. |
|
The default starting address is 80000000. This can be changed in two ways
(both within the ASM textbox). Address must be aligned for ASM. This
means the address needs to end in 0,4,8 or C. And yes, it has to be Hex! 80142014 JAL 80000060 ADDIU $V0,$V0,00FF 80000060 LUI $K1,3F80 JR $RA MTC1 $K1,F2 Method 2: Use a colon. 80142014: JAL 80000060 ADDIU $V0,$V0,00FF 60: LUI $K1,3F80 JR $RA MTC1 $K1,F2 |
Jumps and other opcodes where you use a value are fairly forgiving on syntax of the value. JAL 80000060 J 60 JAL $60 J 0x60 ADDIU $V0,$V0,00FF ADDIU $V0,$V0,FF ADDIU $V0,$V0,$00FF ADDIU $V0,$V0,$FF ADDIU $V0,$V0,0x00FF |
Branches can be done in 3 ways: by address, by immediate, and by label. Anything shorter than 5 characters will be considered an immediate. Anything long, an address. BEQ $V0,$A1,80000068 NOP BNE $V1,$S1,3 ADDIU $V0,$V0,00FF LUI $K1,3F80 MTC1 $K1,F2 BNE $V1,$S1,@bah ADDIU $V0,$V0,00FF LUI $K1,3F80 @bah MTC1 $K1,F2 |
Registers are another thing I tried to make flexible.
Some Examples: ADDIU $V0,$zero,00FF ADDIU $V0,zero,00FF ADDIU $V0,R00,00FF ADDIU $V0,R0,00FF ADDIU V0,R0,00FF ADDIU R3,R0,00FF ADDIU R03,R0,00FF LUI $K1,3F80 MTC1 $K1,F2 MTC1 $K1,F02 MTC1 $K1,$F2 MTC1 $K1,FPR2 |
The semi-colon can be used for commenting.
Some Examples: ADDIU $V0,$zero,00FF ;V0 will now be 00FF ;Put 3F80 into F2 LUI $K1,3F80 MTC1 $K1,F2 |
The only OP that's not supported at all is CACHE. I couldn't figure out how the hell it's assembled. I was also unsure of some of the Trap OPs. Any of the ones with an Immediate are good, but the ones like TEQ will give you a little warning. I'm not sure if those are right or not. |
I've added all the typical pseudo OPs that were listed in n64ops#a.txt of the reference docs, and a ton more of my own.
Here's the full list... |
rs = 5-bit source register specifier |
OPcode | Arguments | Assembles To |
NOP | ADDIU R0,R0,0000 or SLL r0, r0, 0 (Short/Long) | |
MOVE | rd, rs | ADD rd, r0, rs |
NEG | rd, rt | SUB rd, r0, rt |
NEGU | rd, rs | SUBU rd, r0, rs |
BNEZ | rs, offset | BNE rs, r0, offset |
BNEZL | rs, offset | BNEL rs, r0, offset |
BEQZ | rs, offset | BEQ rs, r0, offset |
BEQZL | rs, offset | BEQL rs, r0, offset |
B | offset | BEQ r0, r0, offset |
BAL | offset | BGEZAL r0, offset |
LI | rt, imm | ORI rt, r0, imm (if imm is 16 bit) or LUI rt, high_16 ORI rt, rt, low_16 (if imm is 32 bit) |
S.S | ft, offset(base) | SWC1 ft, offset(base) |
L.S | ft, offset(base) | LWC1 ft, offset(base) |
LBI / LBA | rt,offset[(base)] | Note 1 |
LBUI / LBUA | rt,offset[(base)] | Note 1 |
LDI / LDA | rt,offset[(base)] | Note 1 |
LDLI / LDLA | rt,offset[(base)] | Note 1 |
LDRI / LDRA | rt,offset[(base)] | Note 1 |
LHI / LHA | rt,offset[(base)] | Note 1 |
LHUI / LHUA | rt,offset[(base)] | Note 1 |
LLI / LLA | rt,offset[(base)] | Note 1 |
LLDI / LLDA | rt,offset[(base)] | Note 1 |
LWI / LWA | rt,offset[(base)] | Note 1 |
LWLI / LWLA | rt,offset[(base)] | Note 1 |
LWRI / LWRA | rt,offset[(base)] | Note 1 |
LWUI / LWUA | rt,offset[(base)] | Note 1 |
DDIVHI | rd,rs,rt | DDIV rs,rt MFHI rd |
DDIVLO | rd,rs,rt | DDIV rs,rt MFLO rd |
DDIVUHI | rd,rs,rt | DDIVU rs,rt MFHI rd |
DDIVULO | rd,rs,rt | DDIVU rs,rt MFLO rd |
DMULTHI | rd,rs,rt | DMULT rs,rt MFHI rd |
DMULTLO | rd,rs,rt | DMULT rs,rt MFLO rd |
DMULTUHI | rd,rs,rt | DMULTU rs,rt MFHI rd |
DMULTULO | rd,rs,rt | DMULTU rs,rt MFLO rd |
MULTHI | rd,rs,rt | MULT rs,rt MFHI rd |
MULTLO | rd,rs,rt | MULT rs,rt MFLO rd |
MULTUHI | rd,rs,rt | MULTU rs,rt MFHI rd |
MULTULO | rd,rs,rt | MULTU rs,rt MFLO rd |
LTC1 / LIC1 (See Note 1) | fd,[rs,],imm If no rs, $K1 is used | (if imm is 16 bit or lower 16 bits are 0) LUI rs, imm MTC1 rs,fd (if imm is 32 bit) LUI rs, high_16 ORI rs, rs, low_16 MTC1 rs,fd |
LAC1 | fd,offset[(base)] If no base, $K1 is used | LUI base, high_16 LWC1 fd,low_16(base) |
LFC1 / LFTC1, LFP | fd,[rs,],float If no rs, $K1 is used. | Converts the float to hex and assembles the same as LTC1/LIC1. |
Note 1 | ||
|
Viper187 of GSCentral and The Snake Pit |
Parasyte - His 1337 programming/hacking skills are unmatched. I'm always asking him shit. |