mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-25 18:05:12 -04:00
disasm: print word 0 as bare NOP
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -65,6 +65,8 @@ extern "C" int psx_disasm_one(uint32_t word, uint32_t addr, char* out, int cap)
|
||||
int n;
|
||||
if (d.format == InstrFormat::UNKNOWN) {
|
||||
n = std::snprintf(out, (size_t)cap, ".word 0x%08X", word);
|
||||
} else if (word == 0u) {
|
||||
n = std::snprintf(out, (size_t)cap, "NOP");
|
||||
} else if (std::strcmp(m, "JR") == 0) {
|
||||
n = std::snprintf(out, (size_t)cap, "%-8s %s", m, rn(d.rs));
|
||||
} else if (std::strcmp(m, "JALR") == 0) {
|
||||
|
||||
@@ -19,6 +19,7 @@ static void check(unsigned word, unsigned pc, const char* expected) {
|
||||
CHECK(n == (int)std::strlen(expected));
|
||||
}
|
||||
int main() {
|
||||
check(0,0,"NOP");
|
||||
check(0x012A4020,0,"ADD $t0, $t1, $t2");
|
||||
check(0x012A0018,0,"MULT $t1, $t2");
|
||||
check(0x012A001B,0,"DIVU $t1, $t2");
|
||||
|
||||
Reference in New Issue
Block a user