ps2dev / ps2toolchain

This program will automatically build and install a compiler and other tools used in the creation of homebrew software for the Sony PlayStation® 2 videogame system.
BSD 2-Clause "Simplified" License
239 stars 73 forks source link

mtc0 does not support at as a target #92

Closed bigianb closed 2 years ago

bigianb commented 2 years ago

Using $at as the target for mtc0 gives invalid operands. Changing to a different register such as a0 for example works.

Some example output is as follows:

mips64r5900el-ps2-elf-gcc -msoft-float -c start.S -o start.o
start.S: Assembler messages:
start.S:136: Error: invalid operands `mtc0 $12,$at'

Oddly mfc0 works just fine with $at.

The source which gives the error above is:

        mfc0 $at, Status
        li   k0, 0xFFFFFFE4             // Kernel mode, disable interrupts
        and  $at, k0
        mtc0 Status, $at
bigianb commented 2 years ago

agh - ignore me ... the operands are in the other order than I expected. Should be mtc0 $at, $12