Format:
Instructions must be lowercase (addi, not ADDI).
Psuedo instructions must be laid out like so:
Name: sub (what is called)
Format: %rD, %rA, %rB (variables in order, can be registers or immediate or labels)
Code: subf %rD, %rB, %rA
Usage: sub r3, r3, r4
Translation: subf r3, r4, r3
Registers prefixes are % and $, but you can have no prefix. Registers must be lowercase.
Decimal values must have no prefix.
Hexadecimal values must have a 0x or $ prefix.
Single line comments start with //
Multiline comments start with /* and end with */
Label declarations must end with : and label referring is just the label name
label1:
bl label1
CodeWizard supports a limited number of operations (this is why it is in beta):
addis
addi
add
blr
bl
beq
bne
ble
bge
bgt
blt
b
cmpwi
cmplwi
cmpw
cmplw
fadd
fdiv
fmr
fmul
fsub
fsqrt
lbz
ld
lfs
lhz
lis
li
lwz
mfspr
mtspr
mullw
mulli
nop
ori
slwi
srwi
stb
stdu
std
stfs
sth
stw
stwu
subf
Conditional branches use labels or offsets. The offsets are relative to the current address.
Unconditional branches use labels or addresses. The addresses are not relative.
label1:
beq 0x4 //Branches if cr0 is equal to the next line
bl 0x001ADCC0
beq label1
bl label1
Instructions like stw (stw rA, 0xXXXX(rD)) must be laid out like shown. You can't write "stw rA, rD, 0xXXXX" or anything similar.
Special Instructions:
"address 0xXXXXXXXX" - Sets the current address in the assembler.
"hook 0xXXXXXXXX" - One time use, sets the passed address to a *branch* to the first "address" instruction (hooks the beginning of the sub to the passed argument).
"hookl 0xXXXXXXXX" - One time use, sets the passed address to a *branch and link* to the first "address" instruction (hooks the beginning of the sub to the passed argument).
"setreg rD, 0xXXXXXXXX" - Sets the register rD to the passed 32 bit immediate. Doesn't have to be hexadecimal.
"hexcode 0xXXXXXXXX" - In the assembled code, the value will be equal to the passed 32 bit value. This is great for unsupported instructions.
"import [PATH]" - Imports the file at [PATH] into the subroutine at assemble time. Puts it after the already loaded imports.
"float [FLOAT]" - Inserts into the assembled code as assemble time the hexadecimal version of the float specified. Ex: float 1.23 => 3F9D70A4
"string [STRING]" - Converts the string into a hex version and inserts it into the code at assemble time. Ex: string aBbCcd => 61426243 :: 63640000
Output Type:
NetCheat format; 2 ADDR8 VAL8.
Byte array: byte[] NAME = { 0xBYTES ... }
Hex string array: BYTES ...
address 0x01020304
li r5, 0x9876
---
NC: 2 01020304 38A09876
BA: byte[] NAME = { 0x38, 0xA0, 0x98, 0x76 };
Hex: 38 A0 98 76