sim: sim_boolean: handle SETCMM, add unit test

This commit is contained in:
Mikael Pettersson
2020-07-25 17:06:53 +02:00
parent 55f87673e3
commit bb51e0852e
3 changed files with 25 additions and 0 deletions

View File

@@ -94,6 +94,7 @@
-define(OP_ORCAB, 8#457).
-define(OP_SETCM, 8#460).
-define(OP_SETCMI, 8#461).
-define(OP_SETCMM, 8#462).
%% 2.4 Boolean Functions =======================================================
@@ -696,6 +697,16 @@ setcmi_test() ->
[ {#ea{section = 1, offset = 1, islocal = false}, ?COMMA2(-1, 8#070707)} % AC1 = -1,,070707
]).
setcmm_test() ->
Prog =
[ {1, 8#100, ?INSN(?OP_SETCMM, 1, 0, 0, 8#200)} % 1,,100/ SETCMM 1,200
, {1, 8#101, ?INSN_INVALID} % 1,,101/ <invalid>
, {1, 8#200, ?COMMA2(0, 8#707070)} % 1,,200/ 0,,707070
],
expect(Prog, [], {1, 8#101}, ?DEFAULT_FLAGS,
[ {#ea{section = 1, offset = 8#200, islocal = false}, ?COMMA2(-1, 8#070707)} % C(1,,200) = -1,,070707
]).
%% Common code to run short sequences ==========================================
expect(Prog, ACs, ExpectedPC, ExpectedFlags, ExpectedEs) ->