mirror of
https://github.com/mikpe/pdp10-tools.git
synced 2026-01-22 10:32:25 +00:00
sim: sim_core: handle SETCAI as SETCA, add unit tests
This commit is contained in:
parent
33b26588ec
commit
cc90c106a8
@ -294,6 +294,7 @@ dispatch(Core, Mem, IR, EA) ->
|
||||
8#446 -> sim_boolean:handle_EQVM(Core, Mem, IR, EA);
|
||||
8#447 -> sim_boolean:handle_EQVB(Core, Mem, IR, EA);
|
||||
8#450 -> sim_boolean:handle_SETCA(Core, Mem, IR, EA);
|
||||
8#451 -> sim_boolean:handle_SETCA(Core, Mem, IR, EA); % SETCAI = SETCA
|
||||
_ ->
|
||||
PC = (Core#core.pc_section bsl 18) bor Core#core.pc_offset,
|
||||
{Core, Mem, {error, {?MODULE, {dispatch, PC, IR, EA}}}}
|
||||
|
||||
@ -85,6 +85,7 @@
|
||||
-define(OP_EQVM, 8#446).
|
||||
-define(OP_EQVB, 8#447).
|
||||
-define(OP_SETCA, 8#450).
|
||||
-define(OP_SETCAI, 8#451).
|
||||
|
||||
%% 2.4 Boolean Functions =======================================================
|
||||
|
||||
@ -587,6 +588,16 @@ setca_test() ->
|
||||
[ {#ea{section = 1, offset = 1, islocal = false}, ?COMMA2(-1, 8#070707)} % AC1 = -1,,070707
|
||||
]).
|
||||
|
||||
setcai_test() ->
|
||||
Prog =
|
||||
[ {1, 8#100, ?INSN(?OP_MOVEI, 1, 0, 0, 8#707070)} % 1,,100/ MOVEI 1,707070
|
||||
, {1, 8#101, ?INSN(?OP_SETCAI, 1, 0, 0, 0)} % 1,,101/ SETCAI 1,
|
||||
, {1, 8#102, ?INSN_INVALID} % 1,,102/ <invalid>
|
||||
],
|
||||
expect(Prog, [], {1, 8#102}, ?DEFAULT_FLAGS,
|
||||
[ {#ea{section = 1, offset = 1, islocal = false}, ?COMMA2(-1, 8#070707)} % AC1 = -1,,070707
|
||||
]).
|
||||
|
||||
%% Common code to run short sequences ==========================================
|
||||
|
||||
expect(Prog, ACs, ExpectedPC, ExpectedFlags, ExpectedEs) ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user