sim: sim_boolean: handle ORCBI, add unit test

This commit is contained in:
Mikael Pettersson
2020-07-25 19:08:03 +02:00
parent 6bb0b768b8
commit 261042b823
3 changed files with 21 additions and 0 deletions

View File

@@ -53,6 +53,7 @@
, handle_ORCAI/4
, handle_ORCAM/4
, handle_ORCB/4
, handle_ORCBI/4
, handle_ORCM/4
, handle_ORCMB/4
, handle_ORCMI/4
@@ -722,6 +723,14 @@ handle_ORCB(Core, Mem, IR, EA) ->
fun(Core1, Mem1) -> handle_ORCB(Core1, Mem1, IR, EA) end)
end.
-spec handle_ORCBI(#core{}, sim_mem:mem(), IR :: word(), #ea{})
-> {#core{}, sim_mem:mem(), {ok, integer()} | {error, {module(), term()}}}.
handle_ORCBI(Core, Mem, IR, EA) ->
AC = IR band 8#17,
CA = sim_core:get_ac(Core, AC),
Word = ((bnot CA) bor (bnot EA#ea.offset)) band ((1 bsl 36) - 1),
sim_core:next_pc(sim_core:set_ac(Core, AC, Word), Mem).
%% Miscellaneous ===============================================================
ea_address(#ea{section = Section, offset = Offset}) ->

View File

@@ -310,6 +310,7 @@ dispatch(Core, Mem, IR, EA) ->
8#466 -> sim_boolean:handle_ORCMM(Core, Mem, IR, EA);
8#467 -> sim_boolean:handle_ORCMB(Core, Mem, IR, EA);
8#470 -> sim_boolean:handle_ORCB(Core, Mem, IR, EA);
8#471 -> sim_boolean:handle_ORCBI(Core, Mem, IR, EA);
_ ->
PC = (Core#core.pc_section bsl 18) bor Core#core.pc_offset,
{Core, Mem, {error, {?MODULE, {dispatch, PC, IR, EA}}}}