ASM macros
- Dedok179
- Serious PSXDEV User
- Posts: 86
- Joined: Jun 11, 2015
- I am a: Programmer, Beginning reverser
- PlayStation Model: SCPH-5502
- Discord: Dedok179#2632
- Location: Tula,RU
ASM macros
Hello. Is it possible to use macros in asm on PS1? In order not to write the whole function every time, but for example call func_write (adr, value). If it is possible how to implement it better?
- Dedok179
- Serious PSXDEV User
- Posts: 86
- Joined: Jun 11, 2015
- I am a: Programmer, Beginning reverser
- PlayStation Model: SCPH-5502
- Discord: Dedok179#2632
- Location: Tula,RU
The compiler eats this construction normally:
ACTIV macro
LUI a0,0x8000
ORI a0, a0,0xD000
ORI t0, zero, 0x0001
LB t9,0x0000 (a0)
NOP
BNE t0, t9, go_back_home
NOP
endm
But you should change it to enter your values:
ACTIV macro adr
LUI a0,0x8000
ORI a0, a0, adr
ORI t0, zero, 0x0001
LB t9,0x0000 (a0)
NOP
BNE t0, t9, go_back_home
NOP
endm
and call it as ACTIV 0xD000, then the compiler swears that it’s impossible to say so, although if you simply call ACTIV, then everything compiles. Xs, rummaged all the psy-q docks, did not find anything about this.
compile with asmpsx, file with a macro I cut to the end of the main through incbin
ACTIV macro
LUI a0,0x8000
ORI a0, a0,0xD000
ORI t0, zero, 0x0001
LB t9,0x0000 (a0)
NOP
BNE t0, t9, go_back_home
NOP
endm
But you should change it to enter your values:
ACTIV macro adr
LUI a0,0x8000
ORI a0, a0, adr
ORI t0, zero, 0x0001
LB t9,0x0000 (a0)
NOP
BNE t0, t9, go_back_home
NOP
endm
and call it as ACTIV 0xD000, then the compiler swears that it’s impossible to say so, although if you simply call ACTIV, then everything compiles. Xs, rummaged all the psy-q docks, did not find anything about this.
compile with asmpsx, file with a macro I cut to the end of the main through incbin
Who is online
Users browsing this forum: No registered users and 3 guests