diff options
Diffstat (limited to 'sux.c')
-rw-r--r-- | sux.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -102,10 +102,10 @@ void *run(void *args) { , cpu->y[thread]); wprintw(scr, ", sp: $%04X" - ", ps: $%02"PRIX64 + ", ps: $%02X" ", inst: " , cpu->sp[thread] - , cpu->ps); + , cpu->ps.u8[thread]); #if keypoll pthread_mutex_unlock(&mutex); #endif @@ -148,7 +148,7 @@ void *run(void *args) { #endif switch(opcode) { case CPS: /* Clear Processor Status. */ - cpu->ps = 0; + cpu->ps.u64 = 0; break; case AAB: /* Add Accumulator with carry by B register. */ value.u64 = cpu->b[thread]; /* Falls Through. */ @@ -461,8 +461,8 @@ void *run(void *args) { case NOP: /* No OPeration. */ break; case RTI: /* ReTurn from Interrupt routine. */ - cpu->sp[thread] +=1; - cpu->ps = addr[(cpu->stk_st[thread] << 16)+(cpu->sp[thread])] << (thread << 3); /* Falls through. */ + cpu->sp[thread] += 1; + cpu->ps.u8[thread] = addr[(cpu->stk_st[thread] << 16)+(cpu->sp[thread])]; /* Falls through. */ case RTS: /* ReTurn from Subroutine. */ case RTL: /* ReTurn from subroutine Long. */ cpu->sp[thread] += 8; @@ -500,7 +500,7 @@ void *run(void *args) { addr[(cpu->stk_st[thread] << 16)+cpu->sp[thread]-5] = value.u8[2]; addr[(cpu->stk_st[thread] << 16)+cpu->sp[thread]-6] = value.u8[1]; addr[(cpu->stk_st[thread] << 16)+cpu->sp[thread]-7] = value.u8[0]; - addr[(cpu->stk_st[thread] << 16)+(cpu->sp[thread]-8)] = (uint64_t)cpu->ps >> (thread << 3); + addr[(cpu->stk_st[thread] << 16)+cpu->sp[thread]-8] = cpu->ps.u8[thread]; cpu->sp[thread] -= 9; setflag(1, I); if (opcode == BRK) { |