disassembler support more opcodes, better run.sh

This commit is contained in:
IniKiwi 2021-10-24 15:48:28 +02:00
parent 5f2d267692
commit cbd3017045
2 changed files with 15 additions and 2 deletions

5
run.sh
View File

@ -1,3 +1,4 @@
#! bin/sh
#! /bin/sh
clear
gcc src/main.c -o build.elf
./build.elf
./build.elf gravityd.g1a

View File

@ -110,6 +110,12 @@ int main(int argc, char **argv){
else if(Command.n1 == 0x06 && Command.n4 == 0x03){
printf("mov R%d, R%d", Command.n2, Command.n3);
}
else if(Command.n1 == 0x0D){
printf("mov.l @%06x, R%d",Index+Command.b2*4+4, Command.n2);
}
else if(Command.n1 == 0x02 && Command.n4 == 0x06){
printf("mov.l R%d, @R%d",Command.n3, Command.n2);
}
else if(Command.n1 == 0x07){
printf("add #%d, R%d", Command.b2, Command.n2);
}
@ -125,9 +131,15 @@ int main(int argc, char **argv){
else if(Command.n1 == 0x02 && Command.n4 == 0x0a){
printf("xor R%d, R%d", Command.n3, Command.n2);
}
else if(Command.n1 == 0x04 && Command.n4 == 0x0c){
printf("shad R%d, R%d", Command.n3, Command.n2);
}
else if(Command.n1 == 0x04 && Command.b2 == 0x0B){
printf("jsr @R%d", Command.n2);
}
else if(Command.b1 == 0xA0){
printf("bra @%06x", Index+Command.b2*4+4);
}
else if(Command.n1 == 0x04 && Command.b2 == 0x2B){
printf("\e[33mjmp \e[35m@R%d", Command.n2);
}