diff --git a/emulator_shell.c b/emulator_shell.c index 9bf21cc..08c90e9 100644 --- a/emulator_shell.c +++ b/emulator_shell.c @@ -412,15 +412,18 @@ int emulate8080(State8080* state) { } break; case 0x11: // LXI D, word + { state->d = opcode[2]; state->e = opcode[1]; state->pc += 2; + } break; case 0x13: // INX D + { state->e++; if (state->e == 0) { state->d++; - } + }} break; case 0x19: // DAD D { @@ -440,19 +443,24 @@ int emulate8080(State8080* state) { break; case 0x21: // LXI H, word + { state->h = opcode[2]; state->l = opcode[1]; state->pc += 2; break; + } case 0x23: // INX H + { state->l++; if (state->l == 0) { state->h++; - } + }} break; case 0x26: // MVI H, byte + { state->h = opcode[1]; state->pc++; + } break; case 0x29: // DAD H { @@ -625,8 +633,8 @@ int emulate8080(State8080* state) { } break; case 0xc9: // RET - state->sp += 2; state->pc = (state->memory[state->sp+1] << 8) | state->memory[state->sp]; + state->sp += 2; break; case 0xcd: // CALL adress {