Commit 9b05c1a5 authored by Martin Pépin's avatar Martin Pépin
Browse files

Fix error about li in asm

The li instruction was not handled appropriately : the CPU is supposed
to do the shift, not the asm parser
parent 0ff8e21c
......@@ -120,8 +120,8 @@ let write_instruction env instr =
let rec write_textline env = function
| TLabel _ -> ()
| TInstr (Li (r, imm)) ->
(* lui r, imm[31:16] *)
[boiu 6 0xF; zeros 5 ; reg r ; boiu 16 @@ imm lsr 16]
(* lui r, imm *)
[boiu 6 0xF; zeros 5 ; reg r ; boiu 16 @@ imm]
|> Array.concat
|> Ram.write_word env.ram env.addr;
incaddr env;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment