diff --git a/erlang/apps/sim/src/sim_core.erl b/erlang/apps/sim/src/sim_core.erl index fce7201..4afe08c 100644 --- a/erlang/apps/sim/src/sim_core.erl +++ b/erlang/apps/sim/src/sim_core.erl @@ -273,6 +273,8 @@ dispatch(Core, Mem, IR, EA) -> 8#421 -> sim_boolean:handle_ANDCMI(Core, Mem, IR, EA); 8#422 -> sim_boolean:handle_ANDCMM(Core, Mem, IR, EA); 8#423 -> sim_boolean:handle_ANDCMB(Core, Mem, IR, EA); + 8#424 -> next_pc(Core, Mem); % SETA = no-op + 8#425 -> next_pc(Core, Mem); % SETAI = no-op _ -> PC = (Core#core.pc_section bsl 18) bor Core#core.pc_offset, {Core, Mem, {error, {?MODULE, {dispatch, PC, IR, EA}}}} diff --git a/erlang/apps/sim/test/sim_boolean_tests.erl b/erlang/apps/sim/test/sim_boolean_tests.erl index fa207b2..7dbed3a 100644 --- a/erlang/apps/sim/test/sim_boolean_tests.erl +++ b/erlang/apps/sim/test/sim_boolean_tests.erl @@ -64,6 +64,8 @@ -define(OP_ANDCMI, 8#421). -define(OP_ANDCMM, 8#422). -define(OP_ANDCMB, 8#423). +-define(OP_SETA, 8#424). +-define(OP_SETAI, 8#425). %% 2.4 Boolean Functions ======================================================= @@ -334,6 +336,20 @@ andcmb_test() -> , {#ea{section = 1, offset = 1, islocal = false}, ?COMMA2(0, 8#030303)} % AC1 = 0,,030303 ]). +seta_test() -> + Prog = + [ {1, 8#100, ?INSN(?OP_SETA, 0, 0, 0, 0)} % 1,,100/ SETA 0,0 + , {1, 8#101, ?INSN_INVALID} % 1,,101/ + ], + expect(Prog, [], {1, 8#101}, ?DEFAULT_FLAGS, []). + +setai_test() -> + Prog = + [ {1, 8#100, ?INSN(?OP_SETAI, 0, 0, 0, 0)} % 1,,100/ SETAI 0,0 + , {1, 8#101, ?INSN_INVALID} % 1,,101/ + ], + expect(Prog, [], {1, 8#101}, ?DEFAULT_FLAGS, []). + %% Common code to run short sequences ========================================== expect(Prog, ACs, ExpectedPC, ExpectedFlags, ExpectedEs) ->