diff --git a/erlang/apps/sim/src/sim_core.erl b/erlang/apps/sim/src/sim_core.erl index 1cf35a5..21a10ef 100644 --- a/erlang/apps/sim/src/sim_core.erl +++ b/erlang/apps/sim/src/sim_core.erl @@ -244,6 +244,7 @@ dispatch(Core, Mem, IR, EA) -> 8#212 -> sim_moves:handle_MOVNM(Core, Mem, IR, EA); 8#213 -> sim_moves:handle_MOVNS(Core, Mem, IR, EA); 8#214 -> sim_moves:handle_MOVM(Core, Mem, IR, EA); + 8#215 -> sim_moves:handle_MOVEI(Core, Mem, IR, EA); % MOVMI = MOVEI 8#250 -> sim_moves:handle_EXCH(Core, Mem, IR, EA); _ -> PC = (Core#core.pc_section bsl 18) bor Core#core.pc_offset, diff --git a/erlang/apps/sim/test/sim_moves_tests.erl b/erlang/apps/sim/test/sim_moves_tests.erl index 54b73d9..acb5258 100644 --- a/erlang/apps/sim/test/sim_moves_tests.erl +++ b/erlang/apps/sim/test/sim_moves_tests.erl @@ -56,6 +56,7 @@ -define(OP_MOVNM, 8#212). -define(OP_MOVNS, 8#213). -define(OP_MOVM, 8#214). +-define(OP_MOVMI, 8#215). -define(OP_EXCH, 8#250). %% 2.1.1 Exchange Instruction ================================================== @@ -313,6 +314,17 @@ movm_minint_test() -> [ {#ea{section = 1, offset = 1, islocal = false}, 1 bsl 35} % AC1 = 400000,,0 ]). +movmi_test() -> + Prog = + [ {1, 8#100, ?INSN(?OP_MOVMI, 1, 0, 0, 8#200)} % 1,,100/ MOVMI 1,200 + , {1, 8#101, ?INSN_INVALID} % 1,,101/ + ], + %% Note that the EA in 1,,100 evaluates to 1,,200 local, but only the + %% in-section offset is loaded into AC1. + expect(Prog, [], {1, 8#101}, ?DEFAULT_FLAGS, + [ {#ea{section = 1, offset = 1, islocal = false}, 8#200} % AC1 = 200 + ]). + %% Common code to run short sequences ========================================== expect(Prog, ACs, ExpectedPC, ExpectedFlags, ExpectedEs) ->