9 { 101, "label already defined" },
10 { 102, "label table is full" },
11 { 103, "label not found" },
12 { 104, "label length is too long" },
13 { 105, "no command in the line" },
14 { 106, "operand count mismatch" },
15 { 107, "no label in START" },
16 { 108, "not command of operand \"r\"" },
17 { 109, "not command of operand \"r1,r2\"" },
18 { 110, "not command of operand \"r,adr[,x]\"" },
19 { 111, "not command of operand \"adr[,x]\"" },
20 { 112, "not command of no operand" },
21 { 113, "command not defined" },
22 { 114, "not integer" },
24 { 116, "out of hex range" },
25 { 117, "operand is too many" },
26 { 118, "operand length is too long" },
27 { 119, "out of COMET II memory" },
28 { 120, "GR0 in operand x" },
29 { 121, "cannot get operand token" },
30 { 122, "cannot create hash table" },
31 { 201, "execute - out of COMET II memory" },
32 { 202, "SVC input - out of Input memory" },
33 { 203, "SVC output - out of COMET II memory" },
34 { 204, "Program Register (PR) - out of COMET II memory" },
35 { 205, "Stack Pointer (SP) - cannot allocate stack buffer" },
36 { 206, "Address - out of COMET II memory" }
42 char *p = malloc(6), *q = malloc(6);
45 *(p + i++) = word % 10 + '0';
46 } while((word /= 10) > 0);
47 for(j = 0; j < i; j++) {
48 *(q + j) = *(p + (i - 1) - j);
54 /* エラー番号とエラーメッセージを設定する */
55 void setcerr(int num, const char *val)
58 cerrmsg = malloc(256);
61 strcat(cerrmsg, ": ");
62 strcat(cerrmsg, getcerrmsg(cerrno));
64 strcpy(cerrmsg, getcerrmsg(cerrno));
69 char *getcerrmsg(int num)
73 for(i = 0; i < ARRAYSIZE(cerr); i++) {
74 if((&cerr[i])->num == num) {
75 return (&cerr[i])->msg;
78 return "unkown error";
86 if(strlen(cerrmsg) > 0) {