From: j8takagi Date: Wed, 17 Feb 2010 17:03:50 +0000 (+0900) Subject: シフト演算のバグ修正 X-Git-Tag: v0.1~25 X-Git-Url: https://j8takagi.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b062dc382203af031ac92d40ca94c2b0bd1e495c;p=YACASL2.git シフト演算のバグ修正 --- diff --git a/src/exec.c b/src/exec.c index c102d32..9f01dbd 100644 --- a/src/exec.c +++ b/src/exec.c @@ -138,7 +138,7 @@ void cpl(WORD val0, WORD val1) /* 算術演算なので、第15ビットは送り出されない */ WORD sla(WORD val0, WORD val1) { - WORD sign, res, last; + WORD sign, res, last = 0x0; int i; FR = 0x0; @@ -169,7 +169,7 @@ WORD sla(WORD val0, WORD val1) /* 空いたビット位置には符号と同じものが入る */ WORD sra(WORD val0, WORD val1) { - WORD sign, res, last; + WORD sign, res, last = 0x0; int i; FR = 0x0; @@ -201,7 +201,7 @@ WORD sra(WORD val0, WORD val1) /* 論理左シフト。フラグを設定して値を返す */ WORD sll(WORD val0, WORD val1) { - WORD res = val0, last; + WORD res = val0, last = 0x0; int i; FR = 0x0; @@ -227,7 +227,7 @@ WORD sll(WORD val0, WORD val1) /* 論理右シフト。フラグを設定して値を返す */ WORD srl(WORD val0, WORD val1) { - WORD res = val0, last; + WORD res = val0, last = 0x0; int i; FR = 0x0;