mirror of
https://github.com/mikpe/pdp10-tools.git
synced 2026-05-04 23:16:14 +00:00
sim: sim_boolean: handle ANDCBM, add unit test
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
, handle_ANDCAM/4
|
||||
, handle_ANDCB/4
|
||||
, handle_ANDCBI/4
|
||||
, handle_ANDCBM/4
|
||||
, handle_ANDCM/4
|
||||
, handle_ANDCMB/4
|
||||
, handle_ANDCMI/4
|
||||
@@ -427,6 +428,20 @@ handle_ANDCBI(Core, Mem, IR, EA) ->
|
||||
Word = ((bnot CA) band (bnot EA#ea.offset)) band ((1 bsl 36) - 1),
|
||||
sim_core:next_pc(sim_core:set_ac(Core, AC, Word), Mem).
|
||||
|
||||
-spec handle_ANDCBM(#core{}, sim_mem:mem(), IR :: word(), #ea{})
|
||||
-> {#core{}, sim_mem:mem(), {ok, integer()} | {error, {module(), term()}}}.
|
||||
handle_ANDCBM(Core, Mem, IR, EA) ->
|
||||
case sim_core:c(Core, Mem, EA) of
|
||||
{ok, CE} ->
|
||||
AC = IR band 8#17,
|
||||
CA = sim_core:get_ac(Core, AC),
|
||||
Word = ((bnot CE) band (bnot CA)) band ((1 bsl 36) - 1),
|
||||
handle_ANDM_1(Core, Mem, EA, Word);
|
||||
{error, Reason} ->
|
||||
sim_core:page_fault(Core, Mem, ea_address(EA), read, Reason,
|
||||
fun(Core1, Mem1) -> handle_ANDCBM(Core1, Mem1, IR, EA) end)
|
||||
end.
|
||||
|
||||
%% Miscellaneous ===============================================================
|
||||
|
||||
ea_address(#ea{section = Section, offset = Offset}) ->
|
||||
|
||||
@@ -287,6 +287,7 @@ dispatch(Core, Mem, IR, EA) ->
|
||||
8#437 -> sim_boolean:handle_IORB(Core, Mem, IR, EA);
|
||||
8#440 -> sim_boolean:handle_ANDCB(Core, Mem, IR, EA);
|
||||
8#441 -> sim_boolean:handle_ANDCBI(Core, Mem, IR, EA);
|
||||
8#442 -> sim_boolean:handle_ANDCBM(Core, Mem, IR, EA);
|
||||
_ ->
|
||||
PC = (Core#core.pc_section bsl 18) bor Core#core.pc_offset,
|
||||
{Core, Mem, {error, {?MODULE, {dispatch, PC, IR, EA}}}}
|
||||
|
||||
Reference in New Issue
Block a user