summaryrefslogtreecommitdiff
path: root/opc_impl.ha
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-05-02 23:43:33 +0100
committerubq323 <ubq323@ubq323.website>2024-05-02 23:43:33 +0100
commit47f19a98300adebaf20cfc763c4cc5ad74b755d2 (patch)
treefc83eddb2dcf7a25cbd665de8a3d92b00a3bffff /opc_impl.ha
parenta71e6c729761d07c7bf189c057951440d1fe251f (diff)
even more thingsHEADtrunk
Diffstat (limited to 'opc_impl.ha')
-rw-r--r--opc_impl.ha4
1 files changed, 2 insertions, 2 deletions
diff --git a/opc_impl.ha b/opc_impl.ha
index f85be5f..c264ab4 100644
--- a/opc_impl.ha
+++ b/opc_impl.ha
@@ -80,8 +80,8 @@ fn do_opr(cpu: *cpu, op: u8) void = switch (op) {
const y = pop(cpu);
push(cpu, x + y);
case op::SUB =>
- const x = pop(cpu);
const y = pop(cpu);
+ const x = pop(cpu);
push(cpu, x - y);
case op::MUL =>
// TODO: better handling mul div
@@ -89,8 +89,8 @@ fn do_opr(cpu: *cpu, op: u8) void = switch (op) {
const y = pop(cpu);
push(cpu, x * y);
case op::DIV =>
- const x = pop(cpu);
const y = pop(cpu);
+ const x = pop(cpu);
push(cpu, x / y);
case op::NEG =>
push(cpu, - pop(cpu));