disasm.c
392 Bytes
#include "disasm.h"
void disassemble_program(uint32_t length)
{
uint16_t arg1;
uint16_t arg2;
uint16_t arg3;
for(;;)
{
if(pc == length - 1)
{
break;
}
fprintf(stderr,"%02X: ",pc);
uint16_t opcode = fetch();
decode_instruction(opcode,&arg1,&arg2,&arg3);
print_instruction(opcode,arg1,arg2,arg3);
}
}