ADDL、SUBL命令の内部構造を変更
[YACASL2.git] / src / word.c
index d2deaee..83ae9bd 100644 (file)
@@ -40,12 +40,16 @@ WORD h2word(const char *str)
 }
 
 /* 10進数または16進数の文字列をWORD値に変換 */
-WORD a2word(const char *str)
+WORD nh2word(const char *str)
 {
-    WORD word = 0x0;
+    WORD word;
+    if(!isdigit(*str) && *str != '-' && *str != '#') {
+        setcerr(114, str);    /* not integer */
+        return 0x0;
+    }
     if(*str == '#') {
         word = h2word(str);
-    } else if(isdigit(*str) || *str == '-') {
+    } else {
         word = n2word(str);
     }
     return word;