--- /dev/null
+#include "cerr.h"
+
+/* エラー番号とエラーメッセージ */
+CERRARRAY cerr[] = {
+ { 101, "label already defined" },
+ { 102, "label table is full" },
+ { 103, "label not found" },
+ { 104, "label length is too long" },
+ { 105, "no command in the line" },
+ { 106, "operand count mismatch" },
+ { 107, "no label in START" },
+ { 108, "not command of operand \"r\"" },
+ { 109, "not command of operand \"r1,r2\"" },
+ { 110, "not command of operand \"r,adr[,x]\"" },
+ { 111, "not command of operand \"adr[,x]\"" },
+ { 112, "not command of no operand" },
+ { 113, "command not defined" },
+ { 114, "not integer" },
+ { 115, "not hex" },
+ { 116, "out of hex range" },
+ { 117, "operand is too many" },
+ { 118, "operand length is too long" },
+ { 119, "out of COMET II memory" },
+ { 120, "GR0 in operand x" },
+ { 121, "cannot get operand token" },
+ { 122, "cannot create hash table" },
+ { 123, "unclosed quote" },
+ { 124, "more than one character in literal" },
+ { 125, "not GR in operand x" },
+ { 201, "execute - out of COMET II memory" },
+ { 202, "SVC input - out of Input memory" },
+ { 203, "SVC output - out of COMET II memory" },
+ { 204, "Program Register (PR) - out of COMET II memory" },
+ { 205, "Stack Pointer (SP) - cannot allocate stack buffer" },
+ { 206, "Address - out of COMET II memory" },
+ { 207, "Stack Pointer (SP) - out of COMET II memory" },
+ { 0, NULL },
+};
cleanall: clean
@rm -f 0.txt
a.out: $(SRC) $(TESTSRCFILE)
- @make -C $(SRCDIR)
- @gcc $(CFLAGS) $(SRC) $(TESTSRCFILE)
+ @make -sC $(SRCDIR)
+ gcc $(CFLAGS) $(SRC) $(TESTSRCFILE)
0.txt 1.txt: a.out
@./a.out >$@ 2>&1
diff.txt: 1.txt
120: (null) - 120 GR0 in operand x
121: (null) - 121 cannot get operand token
122: (null) - 122 cannot create hash table
-123: (null) - 123 unkown error
-124: (null) - 124 unkown error
+123: (null) - 123 unclosed quote
+124: (null) - 124 more than one character in literal
201: (null) - 201 execute - out of COMET II memory
202: (null) - 202 SVC input - out of Input memory
203: (null) - 203 SVC output - out of COMET II memory
120: foobar - 120 foobar: GR0 in operand x
121: foobar - 121 foobar: cannot get operand token
122: foobar - 122 foobar: cannot create hash table
-123: foobar - 123 foobar: unkown error
-124: foobar - 124 foobar: unkown error
+123: foobar - 123 foobar: unclosed quote
+124: foobar - 124 foobar: more than one character in literal
201: foobar - 201 foobar: execute - out of COMET II memory
202: foobar - 202 foobar: SVC input - out of Input memory
203: foobar - 203 foobar: SVC output - out of COMET II memory
UCLASS = COMMON
-TESTSRCFILE = cerrtest.c
+TESTSRCFILE = ../CERRARRAY.c cerrtest.c
include ../TEST.mk
UCLASS = COMMON
-TESTSRCFILE = getcmdcode.c
+TESTSRCFILE = ../CERRARRAY.c getcmdcode.c
include ../TEST.mk
UCLASS = COMMON
-TESTSRCFILE = getcmdtype.c
+TESTSRCFILE = ../CERRARRAY.c getcmdtype.c
include ../TEST.mk
UCLASS = AS
-TESTSRCFILE = getgr.c
+TESTSRCFILE = ../CERRARRAY.c getgr.c
include ../TEST.mk
for(i = 0; i <= 1; i++) {
title = (is_x[i] == false) ? "Generel Register" : "Index Register";
printf("== %s ==\n", title);
- for(j = 0; j < sizeof(str)/sizeof(str[0]); j++) {
+ for(j = 0; j < ARRAYSIZE(str); j++) {
r = getgr(str[j], is_x[i]);
printf("%s\t#%04X", str[j], r);
if(cerrno > 0) {
UCLASS = AS
-TESTSRCFILE = gethex.c
+TESTSRCFILE = ../CERRARRAY.c h2word.c
include ../TEST.mk
HASH VALUE: 20
HASH VALUE: 11
-HASH VALUE: 21
+HASH VALUE: 1
UCLASS = COMMON
-TESTSRCFILE = hash.c
+TESTSRCFILE = ../CERRARRAY.c hash.c
include ../TEST.mk
UCLASS = AS
-TESTSRCFILE = linetok.c
+TESTSRCFILE = ../CERRARRAY.c linetok.c
include ../TEST.mk
UCLASS = AS
-TESTSRCFILE = getint.c
+TESTSRCFILE = ../CERRARRAY.c getint.c
include ../TEST.mk
OPDC:0
+Error - 121: cannot get operand token
GR0,GR1
OPDC:2
'12345678901234567890123456789012345678901'
OPDC:0
-Error - 118: '12345678901234567890123456789012345678901': operand length is too long
+Error - 118: operand length is too long
UCLASS = AS
-TESTSRCFILE = opdtok.c
+TESTSRCFILE = ../CERRARRAY.c opdtok.c
include ../TEST.mk
-TESTSRCFILE = print_cmdtype_code.c
UCLASS = COMMON
+TESTSRCFILE = ../CERRARRAY.c print_cmdtype_code.c
include ../TEST.mk
}
return 0;
}
-
-/* エラー番号とエラーメッセージ */
-CERRARRAY cerr[] = {
- { 101, "label already defined" },
- { 102, "label table is full" },
- { 103, "label not found" },
- { 104, "label length is too long" },
- { 105, "no command in the line" },
- { 106, "operand count mismatch" },
- { 107, "no label in START" },
- { 108, "not command of operand \"r\"" },
- { 109, "not command of operand \"r1,r2\"" },
- { 110, "not command of operand \"r,adr[,x]\"" },
- { 111, "not command of operand \"adr[,x]\"" },
- { 112, "not command of no operand" },
- { 113, "command not defined" },
- { 114, "not integer" },
- { 115, "not hex" },
- { 116, "out of hex range" },
- { 117, "operand is too many" },
- { 118, "operand length is too long" },
- { 119, "out of COMET II memory" },
- { 120, "GR0 in operand x" },
- { 121, "cannot get operand token" },
- { 122, "cannot create hash table" },
- { 123, "illegal string" },
- { 124, "more than one character in literal" },
- { 201, "execute - out of COMET II memory" },
- { 202, "SVC input - out of Input memory" },
- { 203, "SVC output - out of COMET II memory" },
- { 204, "Program Register (PR) - out of COMET II memory" },
- { 205, "Stack Pointer (SP) - cannot allocate stack buffer" },
- { 206, "Address - out of COMET II memory" },
- { 207, "Stack Pointer (SP) - out of COMET II memory" },
- { 0, NULL },
-};
UCLASS = COMMON
-TESTSRCFILE = print_code_type.c
+TESTSRCFILE = ../CERRARRAY.c print_code_type.c
include ../TEST.mk
}
return 0;
}
-
-/* エラー番号とエラーメッセージ */
-CERRARRAY cerr[] = {
- { 101, "label already defined" },
- { 102, "label table is full" },
- { 103, "label not found" },
- { 104, "label length is too long" },
- { 105, "no command in the line" },
- { 106, "operand count mismatch" },
- { 107, "no label in START" },
- { 108, "not command of operand \"r\"" },
- { 109, "not command of operand \"r1,r2\"" },
- { 110, "not command of operand \"r,adr[,x]\"" },
- { 111, "not command of operand \"adr[,x]\"" },
- { 112, "not command of no operand" },
- { 113, "command not defined" },
- { 114, "not integer" },
- { 115, "not hex" },
- { 116, "out of hex range" },
- { 117, "operand is too many" },
- { 118, "operand length is too long" },
- { 119, "out of COMET II memory" },
- { 120, "GR0 in operand x" },
- { 121, "cannot get operand token" },
- { 122, "cannot create hash table" },
- { 123, "illegal string" },
- { 124, "more than one character in literal" },
- { 201, "execute - out of COMET II memory" },
- { 202, "SVC input - out of Input memory" },
- { 203, "SVC output - out of COMET II memory" },
- { 204, "Program Register (PR) - out of COMET II memory" },
- { 205, "Stack Pointer (SP) - cannot allocate stack buffer" },
- { 206, "Address - out of COMET II memory" },
- { 207, "Stack Pointer (SP) - out of COMET II memory" },
- { 0, NULL },
-};