X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=src%2Fexec.c;h=2cd6d8ae2dd0ebbe87ab47bdf474c3cea480eed6;hp=8f91d486fd803766d58d8448a71b38ec15f77485;hb=b0f981469cdea23225ca5c3ef0ca6759d6a92b43;hpb=5f2f1bc616559d5bfd6dd557bf7d2396c2b8aa72 diff --git a/src/exec.c b/src/exec.c index 8f91d48..2cd6d8a 100644 --- a/src/exec.c +++ b/src/exec.c @@ -1,6 +1,21 @@ #include "casl2.h" #include "exec.h" +/* 実行のエラー定義 */ +CERRARRAY cerr_exec[] = { + { 202, "SVC input - out of Input memory" }, + { 203, "SVC output - out of COMET II memory" }, + { 204, "Program Register (PR) - out of COMET II memory" }, + { 205, "Stack Pointer (SP) - cannot allocate stack buffer" }, + { 206, "Address - out of COMET II memory" }, + { 207, "Stack Pointer (SP) - out of COMET II memory" }, +}; + +bool addcerrlist_exec() +{ + return addcerrlist(ARRAYSIZE(cerr_exec), cerr_exec); +} + /* 実行モード: trace, logical, dump */ EXECMODE execmode = {false, false, false}; @@ -250,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); - for(i = 0; i < memsize; i++) { - memory[i] = 0x0; - } -} - /* 仮想マシンCOMET IIでの実行 */ void exec() { @@ -272,6 +273,7 @@ void exec() char *errpr = malloc(CERRSTRSIZE + 1); clock_t clock_begin, clock_end; + addcerrlist_exec(); if(execmode.trace) { fprintf(stdout, "\nExecuting machine codes\n"); }