From 54b6bf4b0ce20872db02bae2f047c6574c09575c Mon Sep 17 00:00:00 2001 From: j8takagi Date: Sun, 7 Mar 2010 11:59:03 +0900 Subject: [PATCH 1/1] =?utf8?q?reset=E9=96=A2=E6=95=B0=E3=81=AE=E4=BD=8D?= =?utf8?q?=E7=BD=AE=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- include/casl2.h | 3 +++ include/exec.h | 2 +- src/exec.c | 14 -------------- src/struct.c | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/include/casl2.h b/include/casl2.h index 3d602c4..5d21418 100644 --- a/include/casl2.h +++ b/include/casl2.h @@ -98,6 +98,9 @@ extern CMDCODETAB **cmdtype_code; extern CMDCODETAB **code_type; extern int cmdtabsize; +/* COMET II仮想マシンのリセット */ +void reset(); + /* 命令と命令タイプがキーのハッシュ表を作成する */ bool create_cmdtype_code(); diff --git a/include/exec.h b/include/exec.h index 7262af5..bd06f39 100644 --- a/include/exec.h +++ b/include/exec.h @@ -19,7 +19,7 @@ extern EXECMODE execmode; /* 実行のエラー定義 */ bool addcerrlist_exec(); -/* 仮想マシンのリセット */ +/* COMET II仮想マシンのリセット */ void reset(); /* コードの実行 */ diff --git a/src/exec.c b/src/exec.c index 6e0af10..2cd6d8a 100644 --- a/src/exec.c +++ b/src/exec.c @@ -265,20 +265,6 @@ WORD srl(WORD val0, WORD val1) return res; } -/* COMET II仮想マシンのリセット */ -void reset() -{ - int i; - for(i = 0; i < REGSIZE; i++) { - GR[i] = 0x0; - } - SP = PR = FR = 0x0; - memory = malloc(memsize * sizeof(WORD)); - for(i = 0; i < memsize; i++) { - memory[i] = 0x0; - } -} - /* 仮想マシンCOMET IIでの実行 */ void exec() { diff --git a/src/struct.c b/src/struct.c index 89daa05..f21c92e 100644 --- a/src/struct.c +++ b/src/struct.c @@ -17,3 +17,17 @@ WORD startptr = 0x0; /* 実行終了番地 */ WORD endptr = 0x0; + +/* COMET II仮想マシンのリセット */ +void reset() +{ + int i; + for(i = 0; i < REGSIZE; i++) { + GR[i] = 0x0; + } + SP = PR = FR = 0x0; + memory = malloc(memsize * sizeof(WORD)); + for(i = 0; i < memsize; i++) { + memory[i] = 0x0; + } +} -- 2.18.0