From: j8takagi Date: Sun, 7 Mar 2010 02:59:03 +0000 (+0900) Subject: reset関数の位置を変更 X-Git-Tag: v0.1p15~53 X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=commitdiff_plain;h=54b6bf4b0ce20872db02bae2f047c6574c09575c;ds=sidebyside reset関数の位置を変更 --- 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; + } +}