summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/cpu.ml10
-rw-r--r--cpu/os.asm6
2 files changed, 7 insertions, 9 deletions
diff --git a/cpu/cpu.ml b/cpu/cpu.ml
index 867a979..7b7b580 100644
--- a/cpu/cpu.ml
+++ b/cpu/cpu.ml
@@ -135,16 +135,14 @@ let rl, rh, i, ex, exf, pc =
let ram_read, save_ram_read = loop 8 in
(* Read instruction low when read is set and instruction high on next tick *)
- let next_read_ihi, save_next_read_ihi = loop 1 in
- let read_ihi = reg 1 next_read_ihi in
let read_ilow = read in
+ let read_ihi = reg 1 read_ilow in
let ra = mux read_ilow ra pc in
- let ilow = reg 8 (mux read_ilow (zeroes 8) ram_read) in
+ let ilow = reg 8 ram_read in
let ra = mux read_ihi ra (nadder 16 pc (one 16)) in
- let ihi = mux read_ihi (zeroes 8) ram_read in
+ let ihi = ram_read in
- let read_ilow = save_next_read_ihi read_ilow in
(* When execution has just been read, exec is true, and exec is false the rest of the time *)
let exec = read_ihi in
(* Keep same instruction in register until new instruction is read *)
@@ -212,7 +210,7 @@ let rl, rh, i, ex, exf, pc =
let instr_jal = exec ^& eq_c 5 i_i 0b01001 in
let next_pc = mux instr_jal next_pc (nadder 16 pc (sign_extend 11 16 i_jd)) in
let instr_jalxx = instr_jal in
- (* instruction : jr/jalr/jer/jner/jltr/jler/jltru/ljeru *)
+ (* instruction : jr/jalr/jer/jner/jltr/jler/jltru/jleru *)
let instr_jxxr = exec ^& eq_c 4 (i_i % (1, 4)) 0b0101 in
let f0 = i_i ** 0 in
let instr_jr = (not f0) ^& (eq_c 2 i_f 0) in
diff --git a/cpu/os.asm b/cpu/os.asm
index 93f0918..cbc1ecc 100644
--- a/cpu/os.asm
+++ b/cpu/os.asm
@@ -14,13 +14,13 @@
li A msghello
jal ser_out_str
- li A 1994
+ li A 1938
li B var_year
sw A 0(B)
- li A 2
+ li A 0
li B var_month
sb A 0(B)
- li A 26
+ li A 9
li B var_day
sb A 0(B)