cpu32

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit eb0e0c09f25b7c00f537c80e2154cdd80410298c
parent 8ae00b58fb7ea682bfd0220314d1ba7826e6d9a3
Author: Brian Swetland <swetland@frotz.net>
Date:   Sun,  5 Feb 2012 16:25:04 -0800

a32: fix invalid wide moves and fix incorrect disassmebly of some immediate moves

Diffstat:
Ma32.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/a32.c b/a32.c @@ -390,13 +390,13 @@ void disassemble(char *buf, unsigned pc, unsigned instr) { sprintf(buf, "MHI %s, %s", REG(d), REG(b)); break; case 0x1B: - sprintf(buf, "MOV %s, %d", REG(d), i16); + sprintf(buf, "MOV %s, %d", REG(b), i16); break; case 0x1E: - sprintf(buf, "MOV %s, #%d", REG(d), ((short)i16)); + sprintf(buf, "MOV %s, #%d", REG(b), ((short)i16)); break; case 0x1F: - sprintf(buf, "MOV %s, #0x%04x0000", REG(d), i16); + sprintf(buf, "MOV %s, #0x%04x0000", REG(b), i16); break; case 0x20: sprintf(buf, "LW %s, [%s, #%d]", REG(b), REG(a), i16); @@ -501,7 +501,7 @@ void assemble_line(int n, unsigned *tok, unsigned *num, char **str) { emit(0x1F000000 | TO_B(to_register(tok[1])) | (TO_I16(num[3] >> 16))); if (num[3] & 0xFFFF) { /* OR in the low bits if present */ - emit(0x10000000 | TO_B(to_register(tok[1])) | TO_I16(num[3])); + emit(0x10000000 | TO_A(to_register(tok[1])) | TO_B(to_register(tok[1])) | TO_I16(num[3])); } return; case tMHI: