X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=src%2Fexec.c;h=4851aeac1d15d629eb20db77f76085178d47cba0;hp=a757dfaa0bfb7161a547edd76b4d8518b446df32;hb=dc4c4e843192f433bd0f14d88d5f101ebbd23820;hpb=f1803bd560071fb724b2c7ff2f5f35fa5086d10a diff --git a/src/exec.c b/src/exec.c index a757dfa..4851aea 100644 --- a/src/exec.c +++ b/src/exec.c @@ -1,6 +1,9 @@ #include "casl2.h" #include "exec.h" +/* 実行モード: trace, logical, dump */ +EXECMODE execmode = {false, false, false}; + /* 標準入力から文字データを読込(SVC 1) */ void svcin() { @@ -8,11 +11,10 @@ void svcin() char *buffer = malloc(INSIZE + 1); if(fgets(buffer, INSIZE, stdin) == NULL) { - memory[GR[1]] = 0x0; - memory[GR[2]] = 0x0; + memory[GR[1]] = memory[GR[2]] = 0x0; return; } - for(i = 0; i < GR[1] && i < INSIZE; i++) { + for(i = 0; i < INSIZE; i++) { if(*(buffer + i) == '\0' || *(buffer + i) == '\n') { --i; break; @@ -149,7 +151,7 @@ WORD sla(WORD val0, WORD val1) last = res & 0x4000; res <<= 1; } - res = sign | (res & 0x7F); + res = sign | (res & 0x7FFF); /* OFに、レジスタから最後に送り出されたビットの値を設定 */ if(last > 0x0) { FR += OF;