gbasm: correct the "(hl)" operand

Though not a real register, the operand "(hl)" fits in
better with the 8-bit registers than it does with the
sixteen bit ones. As such, move its definition.

Also, define useful values for the 8-bit operands rather
than arbitrary ones.
This commit is contained in:
2017-05-20 16:43:29 -07:00
parent e1d8eb0257
commit a5f3ae7ad6
3 changed files with 18 additions and 19 deletions

View File

@@ -89,6 +89,7 @@ size_t inc_emit(struct emitter *emitter,
case GBASM_OPERAND_R8_E: opcode = 0x1c; break;
case GBASM_OPERAND_R8_H: opcode = 0x24; break;
case GBASM_OPERAND_R8_L: opcode = 0x2c; break;
case GBASM_OPERAND_R8_HL_DEREF: opcode = 0x34; break;
}
break;
case GBASM_OPERAND_REG_16:
@@ -97,7 +98,6 @@ size_t inc_emit(struct emitter *emitter,
case GBASM_OPERAND_R16_DE: opcode = 0x13; break;
case GBASM_OPERAND_R16_HL: opcode = 0x23; break;
case GBASM_OPERAND_R16_SP: opcode = 0x33; break;
case GBASM_OPERAND_R16_HL_DEREF: opcode = 0x34; break;
}
break;
default:
@@ -124,6 +124,7 @@ size_t dec_emit(struct emitter *emitter,
case GBASM_OPERAND_R8_E: opcode = 0x1d; break;
case GBASM_OPERAND_R8_H: opcode = 0x25; break;
case GBASM_OPERAND_R8_L: opcode = 0x2d; break;
case GBASM_OPERAND_R8_HL_DEREF: opcode = 0x35; break;
}
break;
case GBASM_OPERAND_REG_16:
@@ -132,7 +133,6 @@ size_t dec_emit(struct emitter *emitter,
case GBASM_OPERAND_R16_DE: opcode = 0x1b; break;
case GBASM_OPERAND_R16_HL: opcode = 0x2b; break;
case GBASM_OPERAND_R16_SP: opcode = 0x3b; break;
case GBASM_OPERAND_R16_HL_DEREF: opcode = 0x35; break;
}
break;
default: