エラー表をコマンドごとに持つよう内部構造を変更
[YACASL2.git] / src / exec.c
index 94c7925..b9f9871 100644 (file)
@@ -40,10 +40,9 @@ void svcout()
         if(memory[GR[1]+i] == '\0') {
             break;
         }
-        /* 「文字の組」の符号表に記載された文字と、改行(CR)/タブを表示
-           それ以外の文字は、「.」で表す */
-        if(((c = (char)(memory[GR[1]+i])) >= 0x20 && c <= 0x7E) || c == 0xA || c == '\t')
-        {
+        /* 「文字の組」の符号表に記載された文字と、改行(CR)/タブを表示 */
+        /* それ以外の文字は、「.」で表す */
+        if(((c = (char)(memory[GR[1]+i])) >= 0x20 && c <= 0x7E) || c == 0xA || c == '\t') {
             putchar(c);
         } else {
             putchar('.');
@@ -231,7 +230,7 @@ WORD srl(WORD val0, WORD val1)
     return res;
 }
 
-/* 仮想マシンのリセット */
+/* COMET II仮想マシンのリセット */
 void reset()
 {
     int i;
@@ -253,7 +252,7 @@ void exec()
     char *errpr = malloc(8);
     clock_t clock_begin, clock_end;
 
-    if(tracemode) {
+    if((&execmode)->tracemode) {
         fprintf(stdout, "\nExecuting machine codes\n");
     }
     /* フラグレジスタの初期値設定 */
@@ -289,15 +288,15 @@ void exec()
         if(cerrno > 0) {
             goto execerr;
         }
-        if(tracemode){
+        if((&execmode)->tracemode){
             fprintf(stdout, "#%04X: Register::::\n", PR);
             dspregister();
         }
-        if(dumpmode){
+        if((&execmode)->dumpmode){
             fprintf(stdout, "#%04X: Memory::::\n", PR);
             dumpmemory();
         }
-        if(dumpmode || tracemode) {
+        if((&execmode)->dumpmode || (&execmode)->tracemode) {
             fprintf(stdout, "\n");
         }
         PR++;