From 10ec62e8025eb43d1a096fb0962049670c3c148c Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 26 Nov 2019 14:22:17 -0500 Subject: rev1 of Sux has been completed! I have now implemented BRK, and RTI. Also, BieHDC, and I will both be working on rev2. --- opcode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'opcode.c') diff --git a/opcode.c b/opcode.c index ea3f726..32f4e9d 100644 --- a/opcode.c +++ b/opcode.c @@ -1,4 +1,5 @@ #include "opcode.h" + void setps(struct sux *cpu, uint8_t thread) { (cpu->c[thread]) ? (cpu->ps |= (C << 8*thread)) : (cpu->ps &= ~(C << 8*thread)); (cpu->z[thread]) ? (cpu->ps |= (Z << 8*thread)) : (cpu->ps &= ~(Z << 8*thread)); @@ -57,7 +58,7 @@ void mul(struct sux *cpu, uint64_t adr, uint8_t thread) { cpu->z[thread] = (sum == 0); cpu->n[thread] = (sum >> 63); cpu->v[thread] = !((cpu->a[thread]^value) & 0x8000000000000000) && ((cpu->a[thread]^sum) & 0x8000000000000000); - cpu->c[thread] = (!((cpu->a[thread]^sum) && (cpu->a[thread]^value)) || (cpu->a[thread] >= ((uint64_t)1 << 32) && value >= ((uint64_t)1 << 32))); + cpu->c[thread] = (!((cpu->a[thread]^sum) && (cpu->a[thread]^value)) && (cpu->a[thread] >= ((uint64_t)1 << 32) && value >= ((uint64_t)1 << 32))); cpu->a[thread] = sum; setps(cpu, thread); } -- cgit v1.2.3-13-gbd6f