comparison dis.c @ 111:8b50d2c975b2

Fix decoding of Scc
author Mike Pavone <pavone@retrodev.com>
date Fri, 28 Dec 2012 15:34:24 -0800
parents a71544cd01ea
children e821b6fde0e4
comparison
equal deleted inserted replaced
110:a575808dd90b 111:8b50d2c975b2
24 deferred * defer(uint32_t address, deferred * next) 24 deferred * defer(uint32_t address, deferred * next)
25 { 25 {
26 if (is_visited(address)) { 26 if (is_visited(address)) {
27 return next; 27 return next;
28 } 28 }
29 printf("deferring %X\n", address); 29 //printf("deferring %X\n", address);
30 deferred * d = malloc(sizeof(deferred)); 30 deferred * d = malloc(sizeof(deferred));
31 d->address = address; 31 d->address = address;
32 d->next = next; 32 d->next = next;
33 return d; 33 return d;
34 } 34 }
82 } 82 }
83 visit(address); 83 visit(address);
84 next = m68k_decode(encoded, &instbuf, address); 84 next = m68k_decode(encoded, &instbuf, address);
85 address += (next-encoded)*2; 85 address += (next-encoded)*2;
86 encoded = next; 86 encoded = next;
87 m68k_disasm(&instbuf, disbuf); 87 //m68k_disasm(&instbuf, disbuf);
88 printf("%X: %s\n", instbuf.address, disbuf); 88 //printf("%X: %s\n", instbuf.address, disbuf);
89 if (instbuf.op == M68K_ILLEGAL || instbuf.op == M68K_RTS || instbuf.op == M68K_RTE) { 89 if (instbuf.op == M68K_ILLEGAL || instbuf.op == M68K_RTS || instbuf.op == M68K_RTE) {
90 break; 90 break;
91 } else if (instbuf.op == M68K_BCC || instbuf.op == M68K_DBCC || instbuf.op == M68K_BSR) { 91 } else if (instbuf.op == M68K_BCC || instbuf.op == M68K_DBCC || instbuf.op == M68K_BSR) {
92 if (instbuf.op == M68K_BCC && instbuf.extra.cond == COND_TRUE) { 92 if (instbuf.op == M68K_BCC && instbuf.extra.cond == COND_TRUE) {
93 address = instbuf.address + 2 + instbuf.src.params.immed; 93 address = instbuf.address + 2 + instbuf.src.params.immed;