sim: sim_boolean: handle ORCAB, add unit test

This commit is contained in:
Mikael Pettersson
2020-07-25 16:07:44 +02:00
parent c2e4ac4805
commit 9bdf6331a4
3 changed files with 29 additions and 0 deletions

View File

@@ -91,6 +91,7 @@
-define(OP_ORCA, 8#454).
-define(OP_ORCAI, 8#455).
-define(OP_ORCAM, 8#456).
-define(OP_ORCAB, 8#457).
%% 2.4 Boolean Functions =======================================================
@@ -660,6 +661,18 @@ orcam_test() ->
[ {#ea{section = 1, offset = 8#200, islocal = false}, ?COMMA2(-1, 8#373737)} % C(1,,200) = -1,,373737
]).
orcab_test() ->
Prog =
[ {1, 8#100, ?INSN(?OP_MOVEI, 1, 0, 0, 8#707070)} % 1,,100/ MOVEI 1,707070
, {1, 8#101, ?INSN(?OP_ORCAB, 1, 0, 0, 8#200)} % 1,,101/ ORCAB 1,200
, {1, 8#102, ?INSN_INVALID} % 1,,102/ <invalid>
, {1, 8#200, ?COMMA2(0, 8#303030)} % 1,,200/ 0,,303030
],
expect(Prog, [], {1, 8#102}, ?DEFAULT_FLAGS,
[ {#ea{section = 1, offset = 8#200, islocal = false}, ?COMMA2(-1, 8#373737)} % C(1,,200) = -1,,373737
, {#ea{section = 1, offset = 1, islocal = false}, ?COMMA2(-1, 8#373737)} % AC1 = -1,,373737
]).
%% Common code to run short sequences ==========================================
expect(Prog, ACs, ExpectedPC, ExpectedFlags, ExpectedEs) ->