summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xasm.rb2
-rw-r--r--hdl/top.sv2
-rw-r--r--mem/mem.hex2
3 files changed, 3 insertions, 3 deletions
diff --git a/asm.rb b/asm.rb
index 686f9c1..c94ecf7 100755
--- a/asm.rb
+++ b/asm.rb
@@ -12,7 +12,7 @@ OPCODES = {
12 "++acc" => 0x002, 12 "++acc" => 0x002,
13 "--acc" => 0x004, 13 "--acc" => 0x004,
14 "tx" => 0x040, 14 "tx" => 0x040,
15 "halt" => 0x080, 15 "halt" => 0x000,
16 } 16 }
17 17
18Line = Struct.new(:opcode, :refs, :code) 18Line = Struct.new(:opcode, :refs, :code)
diff --git a/hdl/top.sv b/hdl/top.sv
index 54cfdc5..a1cdbf7 100644
--- a/hdl/top.sv
+++ b/hdl/top.sv
@@ -133,7 +133,7 @@ always_ff @(posedge clk) begin
133 if (operand[1]) ++acc; 133 if (operand[1]) ++acc;
134 if (operand[2]) --acc; 134 if (operand[2]) --acc;
135 if (operand[6]) state = MEMORY; 135 if (operand[6]) state = MEMORY;
136 if (operand[7]) state = HALT; 136 if (operand == 0) state = HALT;
137 end 137 end
138 'h1: acc = sign_extended_operand; 138 'h1: acc = sign_extended_operand;
139 'h2, 'h3: begin 139 'h2, 'h3: begin
diff --git a/mem/mem.hex b/mem/mem.hex
index a0c98e5..84caf6d 100644
--- a/mem/mem.hex
+++ b/mem/mem.hex
@@ -84,7 +84,7 @@
84548 // jmp fibloop 84548 // jmp fibloop
85121 // fullydone: acc= 0x21 85121 // fullydone: acc= 0x21
86040 // tx 86040 // tx
87080 // halt 87000 // halt
88 88
89@70 89@70
90 90