sim: sim_moves: handle MOVSI, add unit test

This commit is contained in:
Mikael Pettersson
2020-07-14 14:00:02 +02:00
parent 3b96e2333c
commit 6561814cd8
3 changed files with 18 additions and 0 deletions

View File

@@ -48,6 +48,7 @@
-define(OP_MOVEM, 8#202).
-define(OP_MOVES, 8#203).
-define(OP_MOVS, 8#204).
-define(OP_MOVSI, 8#205).
-define(OP_EXCH, 8#250).
%% 2.1.1 Exchange Instruction ==================================================
@@ -144,6 +145,15 @@ movs_test() ->
[ {#ea{section = 1, offset = 1, islocal = false}, ?COMMA2(8#42, 8#27)} % AC1 = 42,,27
]).
movsi_test() ->
Prog =
[ {1, 8#100, ?INSN(?OP_MOVSI, 1, 0, 0, -1)} % 1,,100/ MOVSI 1,-1
, {1, 8#101, ?INSN_INVALID} % 1,,101/ <invalid>
],
expect(Prog, [], {1, 8#101}, ?DEFAULT_FLAGS,
[ {#ea{section = 1, offset = 1, islocal = false}, ?COMMA2(-1, 0)} % AC1 = -1,,0
]).
%% Common code to run short sequences ==========================================
expect(Prog, ACs, ExpectedPC, ExpectedFlags, ExpectedEs) ->