Skip to content

Commit

Permalink
[32BITS] Added 16/17 ocodes ([ARM64_DYNAREC] too)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Jan 26, 2024
1 parent 90fc1d9 commit 77213be
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/dynarec/arm64/dynarec_arm64_00.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,25 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
MOV64xw(x1, i64);
emit_adc32(dyn, ninst, rex, xRAX, x1, x3, x4);
break;

case 0x16:
if(rex.is32bits) {
INST_NAME("PUSH SS");
LDRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_SS]));
PUSH1_32(x1);
} else {
DEFAULT;
}
break;
case 0x17:
if(rex.is32bits) {
INST_NAME("POP SS");
POP1_32(x1);
STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_SS]));
STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_SS]));
} else {
DEFAULT;
}
break;
case 0x18:
INST_NAME("SBB Eb, Gb");
READFLAGS(X_CF);
Expand Down
16 changes: 16 additions & 0 deletions src/emu/x64run.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,22 @@ int Run(x64emu_t *emu, int step)
GO(0x30, xor) /* XOR 0x30 -> 0x35 */
#undef GO

case 0x16: /* PUSH SS */
if(!rex.is32bits) {
unimp = 1;
goto fini;
}
Push32(emu, emu->segs[_SS]); // even if a segment is a 16bits, a 32bits push/pop is done
break;
case 0x17: /* POP SS */
if(!rex.is32bits) {
unimp = 1;
goto fini;
}
emu->segs[_SS] = Pop32(emu); // no check, no use....
emu->segs_serial[_SS] = 0;
break;

case 0x1E: /* PUSH DS */
if(!rex.is32bits) {
unimp = 1;
Expand Down

0 comments on commit 77213be

Please sign in to comment.