READMEのCASL II仕様書へのリンクを修正
[YACASL2.git] / test / unit / nh2word / cmd.c
1 #include <stdio.h>
2 #include "assemble.h"
3 #include "cerr.h"
4 #include "word.h"
5
6 int main(){
7     int i;
8     WORD r;
9     char *str[] = {
10         "#32768", "#-1", "#G", "#FFFF", "#0", "#1", "#ab", "#AB", "#20"
11         "0", "01", "1a", "-5G", "123", "32767", "32768", "32769",
12         "-1", "-2345", "-32768", "-32769", "-32770"
13     };
14
15     cerr_init();    /* エラーの初期化 */
16     addcerrlist_word();
17     for(i = 0; i < sizeof(str)/sizeof(str[0]); i++) {
18         cerr->num = 0;
19         r = nh2word(str[i]);
20         printf("%s\t#%04X", str[i], r);
21         if(cerr->num > 0) {
22             printf("\tError - %d\t%s", cerr->num, cerr->msg);
23         }
24         printf("\n");
25     }
26     freecerr();
27     return 0;
28 }