This is my first time posting, so here goes...
I'm trying to learn to code MIPS assembly programs for the PS1 using the ASMPSX compiler (from the Psy-Q SDK). However, I can't seem to get the header right, meaning that emulators won't run the program.
On top of that, many opcodes aren't recognised. For example,
Code: Select all
.org 0x80010000
Code: Select all
Error : Op-code not recognised
I've had some success with other compilers, such as ARMIPS, but would really like to learn on the OG of PS1 assembly tools.
Any help would be greatly appreciated.
The Dude abides.
-----
In case it matters, I'm using the PCSX-Redux and DuckStation emulators (up-to-date as of today).
My assemble command is:
Code: Select all
asmpsx /z main.asm,main.ps-exe
Code: Select all
section .text
_start:
; Initialize GPU Display Mode
lui r16, 0x1000 ; Load upper immediate (GP1: 640x480i NTSC)
ori r16, r16, 0x0000 ; OR with lower bits
sw r16, 0x1f801814 ; Write to GP1
; Set Background Color to Blue
lui r16, 0xe100 ; Load upper immediate (GP0: Fill VRAM with blue)
ori r16, r16, 0x00ff ; OR with lower bits
sw r16, 0x1f801810 ; Write to GP0
loop:
j loop ; Infinite loop
nop ; No operation (delay slot)
Code: Select all
Failed to load main.ps-exe. Executable does not contain a header.