LR35902: Fix disassembling segments

This commit is contained in:
Vicki Pfau 2017-05-22 22:19:01 -07:00
parent c4175846d8
commit 7de5b33554
1 changed files with 3 additions and 1 deletions

View File

@ -31,11 +31,13 @@ static void _disassemble(struct CLIDebuggerSystem* debugger, struct CLIDebugVect
struct LR35902Core* cpu = debugger->p->d.core->cpu;
uint16_t address;
int segment = -1;
size_t size;
if (!dv || dv->type != CLIDV_INT_TYPE) {
address = cpu->pc;
} else {
address = dv->intValue;
segment = dv->segmentValue;
dv = dv->next;
}
@ -48,7 +50,7 @@ static void _disassemble(struct CLIDebuggerSystem* debugger, struct CLIDebugVect
size_t i;
for (i = 0; i < size; ++i) {
address = _printLine(debugger->p, address, dv->segmentValue);
address = _printLine(debugger->p, address, segment);
}
}