YACAL2: CASL2処理系
[YACASL2.git] / test / utest / getgr / getgr.c
1 #include "casl2.h"
2 #include "assemble.h"
3
4 int main(){
5     int i, j;
6     char *title = malloc(64);
7     WORD r;
8     bool is_x[] = {
9         false, true
10     };
11     char *str[] = {
12         "", "0", "aaa", "GR", "GR8", "GR20",
13         "GR0", "GR1", "GR2", "GR3", "GR4", "GR5", "GR6", "GR7"
14     };
15     for(i = 0; i <= 1; i++) {
16         title = (is_x[i] == false) ? "Generel Register" : "Index Register";
17         printf("== %s ==\n", title);
18         for(j = 0; j < sizeof(str)/sizeof(str[0]); j++) {
19             r = getgr(str[j], is_x[i]);
20             printf("%s\t#%04X", str[j], r);
21             if(cerrno > 0) {
22                 printf("\tError - %d\t%s", cerrno, cerrmsg);
23                 freecerr();
24             }
25             printf("\n");
26         }
27     }
28     return 0;
29 }