各種エントリポイント
実行バイナリ自体のmain関数
https://github.com/open-simh/simh/blob/4c1aee08875e91a8016a4ad1de0cdaaabd85b5a0/scp.c#L2729
標準入力で受け取ったSimHコマンドの解釈を行っている関数
scp.c:2984
t_stat process_stdin_commands (t_stat stat, char *argv[], t_bool do_called)
SimHコマンドが定義されているテーブル
scp.c:2512
static CTAB cmd_table[] = {
examine/depositコマンドの関数
scp.c:9544
/* Examine/deposit commands
examine modifiers list examine
deposit modifiers list val deposit
iexamine modifiers list interactive examine
ideposit modifiers list interactive deposit
modifiers
@filename output file
-letter(s) switches
devname'n device name and unit number
{&|^}value{=|==|!|!=|>|>=|<|<=} value search specification
list list of addresses and registers
addr:addr|-addr address range
ALL all addresses
register:register|-register register range
registerindex register array element
registerstart:end register array range
STATE all registers
*/
t_stat exdep_cmd (int32 flag, CONST char *cptr)
{
run/go/step/next/continue/bootコマンドで実行される関数
scp.c:9109
/* Run, go, boot, cont, step, next commands
run new PC reset and start simulation
go new PC start simulation
cont start simulation
step step limit start simulation for 'limit' instructions
next start simulation for 1 instruction
stepping over subroutine calls
boot device bootstrap from device and start simulation
switches:
-Q quiet return status
-T (only for step), causes the step limit to
be a number of microseconds to run for
*/
t_stat run_cmd (int32 flag, CONST char *cptr)
{
1命令分のフェッチ・デコード・実行を行っている関数
https://github.com/open-simh/simh/blob/4c1aee08875e91a8016a4ad1de0cdaaabd85b5a0/PDP18B/pdp18b_cpu.c#L576
↑run_cmd()から呼び出される
各命令の実装はこの行以降にある
ちなみに、アセンブリ表記での使用可能な命令一覧はここにある
そして、アセンブリ表記に対応する機械語はここに定義されている
type340周期処理
おそらく↓
display/type340.c:161
void
ty340_cycle(void)
{
struct type340 *u = UNIT(0);
if (u->status == 0) {
ty340word insn = ty340_fetch(u->DAC);
u->status = ty340_instruction (insn);
u->DAC = (u->DAC + 1) & 07777;
}
}
type340命令処理
display/type340.c:855
/*
* execute one type340 instruction
* returns status word
* (could return number of microseconds)
*/
ty340word
ty340_instruction(ty340word inst)
{
struct type340 *u = UNIT(0);
int i, escape;