Both the assembler and the disassembler should now support all the instructions I've layed out thus far.

This commit is contained in:
2022-08-29 18:51:48 +00:00
parent e3b4293314
commit 5f437b6869
6 changed files with 133 additions and 16 deletions
+17 -3
View File
@@ -20,8 +20,6 @@ void Disassemble(unsigned char image[HIGHMEMORY]) {
int position = image[0] + image[1];
int end = image[2] + image[3];
printf("Start: %d and End: %d\n", position, end);
char* parameter1 = calloc(32, sizeof(char));
char* parameter2 = calloc(32, sizeof(char));
@@ -79,7 +77,7 @@ void Disassemble(unsigned char image[HIGHMEMORY]) {
position += 3;
break;
case 2:
printf("INT %d\n", Image[position + 1] + Image[position + 2]);
printf("INT %d\n", parameter);
position += 3;
break;
case 3:
@@ -90,6 +88,22 @@ void Disassemble(unsigned char image[HIGHMEMORY]) {
printf("RET\n");
position++;
break;
case 5:
printf("CALL [%#04X]\n", parameter);
position += 3;
break;
case 6:
printf("JMP [%#04X]\n", parameter);
position += 3;
break;
case 7:
printf("IN %d\n", parameter);
position += 3;
break;
case 8:
printf("OUT %d\n", parameter);
position += 3;
break;
default:
position++;
break;