diff --git a/src/x86/cpu-regs.h b/src/x86/cpu-regs.h index e6428268..cdc60ace 100644 --- a/src/x86/cpu-regs.h +++ b/src/x86/cpu-regs.h @@ -38,6 +38,7 @@ /* Apple //e set stack point to ALTZP (or not) */ \ movLQ SYM(base_stackzp), _XAX; \ subLQ SYM(base_vmem), _XAX; \ + orLQ $0x0100, SP_Reg_X; \ orLQ _XAX, SP_Reg_X; #ifdef __LP64__ diff --git a/src/x86/cpu.S b/src/x86/cpu.S index be4663ae..954c0203 100644 --- a/src/x86/cpu.S +++ b/src/x86/cpu.S @@ -2224,7 +2224,6 @@ ENTRY(cpu65_run) jnz 1f // Restore CPU state when being called from C. - movLQ $0x0100, SP_Reg_X movzwLQ DebugCurrEA, EffectiveAddr_X movzwLQ SYM(cpu65_pc), PC_Reg_X movzbLQ SYM(cpu65_a), AF_Reg_X @@ -2238,7 +2237,7 @@ ENTRY(cpu65_run) #endif movzbLQ SYM(cpu65_x), XY_Reg_X movb SYM(cpu65_y), Y_Reg - movb SYM(cpu65_sp), SP_Reg_L + movzbLQ SYM(cpu65_sp), SP_Reg_X #ifdef APPLE2_VM RestoreAltZP #endif