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