mirror of
https://github.com/mikpe/pdp10-tools.git
synced 2026-01-22 10:32:25 +00:00
sim: sim_core:skip/2: new, implement skipping the next instruction
This commit is contained in:
parent
0915326622
commit
81fd5cb76f
@ -27,6 +27,7 @@
|
||||
-export([ run/6
|
||||
, run/2
|
||||
, next_pc/2
|
||||
, skip/2
|
||||
, page_fault/6
|
||||
, c/3
|
||||
, cset/4
|
||||
@ -81,6 +82,13 @@ next_pc(#core{pc_offset = PCOffset} = Core, Mem) ->
|
||||
PCOffset1 = (PCOffset + 1) band ((1 bsl 18) - 1),
|
||||
insn_fetch(Core#core{pc_offset = PCOffset1}, Mem).
|
||||
|
||||
%% Skip next instruction: increment PC by two but stay in current section.
|
||||
-spec skip(#core{}, sim_mem:mem())
|
||||
-> {#core{}, sim_mem:mem(), {ok, integer()} | {error, {module(), term()}}}.
|
||||
skip(#core{pc_offset = PCOffset} = Core, Mem) ->
|
||||
PCOffset2 = (PCOffset + 2) band ((1 bsl 18) - 1),
|
||||
insn_fetch(Core#core{pc_offset = PCOffset2}, Mem).
|
||||
|
||||
%% Instruction Fetch and Effective Address Calculation =========================
|
||||
%% c.f. Toad-1 Architecture Manual, page 41, Figure 1.11
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user