SECOND = 1,
} PASS;
-/* ラベル表からアドレスを検索する */
+/* プログラム名とラベルに対応するハッシュ値を返す */
+unsigned labelhash(const char *prog, const char *label);
+
+/* プログラム名とラベルに対応するアドレスをラベル表から検索する */
WORD getlabel(const char *prog, const char *label);
/* ラベルを表に追加する */
/* アドレスを返す */
/* アドレスには、リテラル/10進定数/16進定数/アドレス定数が含まれる */
-WORD getadr(const char *str, PASS pass);
+WORD getadr(const char *prog, const char *str, PASS pass);
/* 定数の前に等号(=)をつけて記述される、リテラルを返す */
/* リテラルには、10進定数/16進定数/文字定数が含まれる */
#include <assert.h>
#include <stdbool.h>
#include <time.h>
+#include "hash.h"
#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
DEFAULT_CLOCKS = 5000000, /* デフォルトのクロック周波数。COMET II規格では、未定義 */
};
-/* ハッシュ値を取得する */
-unsigned hash(const char *key, int size);
-
/* COMET IIの基本データサイズ */
typedef unsigned short WORD;
$(CC) $(CFLAGS) -o $@ $^
%.o: %.c
$(CC) -c $(CFLAGS) $<
-casl2.o comet2.o $(COMMONSRC) $(ASSRC) $(EXECSRC): $(INCLUDE)/casl2.h
+casl2.o comet2.o $(COMMONSRC) $(ASSRC) $(EXECSRC): $(INCLUDE)/casl2.h $(INCLUDE)/hash.h
casl2.o $(ASSRC): $(INCLUDE)/assemble.h
comet2.o $(EXECSRC): $(INCLUDE)/exec.h
TAGS: $(INCLUDE)/*.h *.c
/* アドレスを返す
アドレスには、リテラル/10進定数/16進定数/アドレス定数が含まれる */
-WORD getadr(const char *str, PASS pass)
+WORD getadr(const char *prog, const char *str, PASS pass)
{
WORD adr = 0x0;
if(*str == '=') {
}
cmd |= x;
}
- adr = getadr(cmdl->opd->opdv[1], pass);
+ adr = getadr(prog, cmdl->opd->opdv[1], pass);
writememory(cmd, ptr++, pass);
writememory(adr, ptr++, pass);
if(cerrno == 0) {
}
cmd |= x;
}
- adr = getadr(cmdl->opd->opdv[0], pass);
+ /* CALLの場合はプログラムの入口名を表すラベル、
+ それ以外の場合は同一プログラム内のラベルを取得 */
+ if(cmd == 0x8000) { /* CALL命令 */
+ adr = getadr(NULL, cmdl->opd->opdv[0], pass);
+ } else {
+ adr = getadr(prog, cmdl->opd->opdv[0], pass);
+ }
writememory(cmd, ptr++, pass);
writememory(adr, ptr++, pass);
if(cerrno == 0) {
+#include "hash.h"
+
/* ハッシュ値を取得する */
-unsigned hash(const char *key, int size){
- unsigned hashval;
+unsigned hash(int keyc, HKEY *keyv[], int tabsize)
+{
+ int i;
+ char *p;
+ unsigned hashval = 0;
- for(hashval = 0; *key != '\0'; key++){
- hashval = *key + 31 * hashval;
+ for(i = 0; i < keyc; i++) {
+ switch(keyv[i]->type) {
+ case CHARS:
+ for(p = keyv[i]->val.s; *p != '\0'; p++) {
+ hashval = *p + 31 * hashval;
+ }
+ break;
+ case INT:
+ hashval = keyv[i]->val.i + 31 * hashval;
+ break;
+ default:
+ break;
+ }
}
- return hashval % size;
+ return (hashval % tabsize);
}
LABELTAB *labels[LABELTABSIZE];
+/* プログラム名とラベルに対応するハッシュ値を返す */
+unsigned labelhash(const char *prog, const char *label)
+{
+ HKEY *keys[2];
+ int i = 0;
+ if(prog != NULL) {
+ keys[i] = malloc(sizeof(HKEY));
+ keys[i]->type = CHARS;
+ keys[i++]->val.s = strdup(prog);
+ }
+ keys[i] = malloc(sizeof(HKEY));
+ keys[i]->type = CHARS;
+ keys[i]->val.s = strdup(label);
+ /* ハッシュ値を返す */
+ return hash(i+1, keys, LABELTABSIZE);
+}
+
/* ラベル表からアドレスを検索する */
WORD getlabel(const char *prog, const char *label)
{
LABELTAB *np;
-
- for(np = labels[hash(label, LABELTABSIZE)]; np != NULL; np = np->next) {
- if(strcmp(label, np->label) == 0) {
+ for(np = labels[labelhash(prog, label)]; np != NULL; np = np->next) {
+ if(((prog == NULL && np->prog == NULL) ||
+ (prog != NULL && np->prog != NULL && strcmp(prog, np->prog) == 0)) &&
+ strcmp(label, np->label) == 0)
+ {
return np->adr;
}
}
{
LABELTAB *np;
unsigned hashval;
+ char *keys[2];
+ int i = 0;
if(getlabel(prog, label) != 0xFFFF) {
setcerr(101, label); /* label already defined */
setcerr(102, NULL); /* label table is full */
return false;
}
- hashval = hash(label, LABELTABSIZE);
+ if(prog != NULL) {
+ keys[i++] = strdup(prog);
+ }
+ keys[i] = strdup(label);;
+ hashval = labelhash(prog, label);
np->next = labels[hashval];
labels[hashval] = np;
np->adr = adr;
writememory(0x0, ptr++, pass);
/* LAD GR1,IBUF */
writememory(0x1210, ptr++, pass);
- writememory(getadr(ibuf, pass), ptr++, pass);
+ writememory(getadr(prog, ibuf, pass), ptr++, pass);
/* LAD GR2,LEN */
writememory(0x1220, ptr++, pass);
- writememory(getadr(len, pass), ptr++, pass);
+ writememory(getadr(prog, len, pass), ptr++, pass);
/* SVC 1 */
writememory(0xF000, ptr++, pass);
writememory(0x0001, ptr++, pass);
writememory(0x0, ptr++, pass);
/* LAD GR1,OBUF */
writememory(0x1210, ptr++, pass);
- writememory(getadr(obuf, pass), ptr++, pass);
+ writememory(getadr(prog, obuf, pass), ptr++, pass);
/* LD GR2,OLEN */
writememory(0x1020, ptr++, pass);
- writememory(getadr(len, pass), ptr++, pass);
+ writememory(getadr(prog, len, pass), ptr++, pass);
/* SVC 2 */
writememory(0xF000, ptr++, pass);
writememory(0x0002, ptr++, pass);
setcerr(121, NULL); /* cannot get operand token */
break;
}
- if(strlen(p) > OPDSIZE + 2) {
+ if(strlen(p) > OPDSIZE + 2) { /* OPDSIZE + 「'」2文字分 */
setcerr(118, p); /* operand length is too long */
break;
}
1.txt
report.txt
diff.txt
+err.txt
TEST.log
echo "$$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \
if test $$success -eq $$all; then \
echo "All tests are succeded."; \
- else \
- grep "Failure" $(LOGFILE); \
fi
clean:
@for target in $(TESTS); do $(MAKE) clean -C $$target; done
create:
ifdef UNITNAME
@mkdir $(UNITNAME)
- @echo 'CMD = ' >>$(UNITNAME)/Makefile
+ @echo 'CMD = ' >>$(UNITNAME)/Makefile; \
+ echo 'include ../TEST.mk' >>$(UNITNAME)/Makefile
else
@echo "no test created. set UNITNAME"
endif
done
$(LOGFILE):
@for target in $(TESTS); do \
- cat <$$target/report.txt >>$(LOGFILE); \
+ cat <$$target/report.txt >>$(LOGFILE) || echo $$target ": no report" >>$(LOGFILE); \
done
report: $(LOGFILE)
@success=`grep "Success" $(LOGFILE) | wc -l`; \
echo "$$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \
if test $$success -eq $$all; then \
echo "All tests are succeded."; \
- else \
- grep "Failure" $(LOGFILE); \
fi
clean:
@for target in $(TESTS); do $(MAKE) clean -C $$target; done
+++ /dev/null
-Assemble error - 109: LEA: not command of operand "r1,r2"
- ../../../../as/ERR/cmd_err0.casl:4: LEA GR1,GR2
-
+++ /dev/null
-Assemble error - 110: LEA: not command of operand "r,adr[,x]"
- ../../../../as/ERR/cmd_err1.casl:2: BEGIN LEA GR1,A
-
+++ /dev/null
-Assemble error - 106: operand count mismatch
- ../../../../as/ERR/ds_err.casl:4: A DS
-
+++ /dev/null
-Assemble error - 101: A: label already defined
- ../../../../as/ERR/labeldup_err.casl:6: A DC 1
-
+++ /dev/null
-Assemble error - 121: cannot get operand token
- ../../../../as/ERR/opdspc_err.casl:2: BEGIN LD GR1, A
-
done
$(LOGFILE):
@for target in $(TESTS); do \
- cat <$$target/report.txt >>$(LOGFILE); \
+ cat <$$target/report.txt >>$(LOGFILE) 2>/dev/null || echo "Failure:" $$target "no report" >>$(LOGFILE); \
done
report: $(LOGFILE)
@success=`grep "Success" $(LOGFILE) | wc -l`; \
echo "$$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \
if test $$success -eq $$all; then \
echo "All tests are succeded."; \
- else \
- grep "Failure" $(LOGFILE); \
fi
clean:
@for target in $(TESTS); do \
cleanall: clean
@rm -f 0.txt $(OBJFILE)
$(OBJFILE): $(CASL2) $(ASFILE)
- @$(CASL2) $(CASL2FLAG) -O$(OBJFILE) $(ASFILE)
+ @$(CASL2) $(CASL2FLAG) -O$(OBJFILE) $(ASFILE) 2>$(ERRFILE)
0.txt 1.txt: $(COMET2) $(OBJFILE)
@echo $(CMD) >$@; \
$(CMD) >>$@ 2>$(ERRFILE); \
done
$(LOGFILE):
@for target in $(TESTS); do \
- cat <$$target/report.txt >>$(LOGFILE); \
+ cat <$$target/report.txt >>$(LOGFILE) || echo $$target ": no report"; \
done
report: $(LOGFILE)
@success=`grep "Success" $(LOGFILE) | wc -l`; \
echo "$$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \
if test $$success -eq $$all; then \
echo "All tests are succeded."; \
- else \
- grep "Failure" $(LOGFILE); \
fi
clean:
@for target in $(TESTS); do \
+++ /dev/null
-TESTS = \
-cerrtest \
-getcmdcode \
-getcmdtype \
-linetok \
-opdtok \
-print_cmdtype_code \
-print_code_type \
-getgr \
-getint \
-gethex \
-include List.mk
-LOGFILE = test.log
-ifdef UNITNAME
- define create
- @mkdir $(UNITNAME)
- @echo "UNITNAME = $(UNITNAME)" >$(UNITNAME)/Makefile; \
- echo "UCLASS = $(UCLASS)" >>$(UNITNAME)/Makefile; \
- echo "include ../Test.mk" >>$(UNITNAME)/Makefile
- @echo "$(UNITNAME) \\" >>List.mk;
- @cp Template.c $(UNITNAME)/$(UNITNAME).c;
- endef
-else
- define create
- @echo "no test created. set UNITNAME, UCLASS={ AS | EXEC | COMMON }"
- endef
-endif
+# テストグループ
+# make : すべてのテストを実施し、ログを作成
+# make all : ↓
+# make clean : すべてのテストで、「make」で生成されたファイルをクリア
+# make check : すべてのテストを実施
+# make cleanall: すべてのテストで、「make」と「make prepare」で生成されたファイルをクリア
+# make prepare : すべてのテストの、想定結果を出力
+# make create : UNITNAMEで指定されたテストを新規に作成
+TESTS = `ls | grep "^[^A-Z].*"`
+LOGFILE = TEST.log
-.PHONY: all logclean testclean check prepare
-all: logclean check clean report
-clean: logclean testclean
-logclean:
+.PHONY: all check report clean cleanall prepare create
+all: check report
+check:
@rm -f $(LOGFILE)
-testclean:
@for target in $(TESTS); do \
- $(MAKE) testclean -C $$target; \
+ $(MAKE) check -C $$target; \
done
-check: $(LOGFILE)
$(LOGFILE):
@for target in $(TESTS); do \
- $(MAKE) -C $$target; \
+ cat <$$target/report.txt >>$(LOGFILE) || echo $$target ": no report"; \
done
-prepare:
- @for target in $(TESTS) ; do \
- $(MAKE) prepare -C $$target ;\
- done
-create:
- $(create)
report: $(LOGFILE)
@success=`grep "Success" $(LOGFILE) | wc -l`; \
- all=`cat $(LOGFILE) | wc -l`; \
- echo "$$success / $$all tests passed."; \
- if test $$success -eq $$all; then \
- echo "All Tests are passed."; \
- else \
- grep "Failure" $(LOGFILE); \
- fi
+ all=`cat $(LOGFILE) | wc -l`; \
+ echo "$$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \
+ if test $$success -eq $$all; then \
+ echo "All tests are succeded."; \
+ fi
+clean:
+ @for target in $(TESTS); do $(MAKE) clean -C $$target; done
+ @rm -f $(LOGFILE)
+cleanall:
+ @for target in $(TESTS); do $(MAKE) cleanall -C $$target; done
+ @rm -f $(LOGFILE)
+prepare:
+ @for target in $(TESTS) ; do $(MAKE) prepare -C $$target ; done
+create:
+ifdef UNITNAME
+ @mkdir $(UNITNAME); \
+ echo 'UCLASS = ' >>$(UNITNAME)/Makefile; \
+ echo 'TESTSRCFILE = $(UNITNAME).c' >>$(UNITNAME)/Makefile; \
+ echo 'include ../TEST.mk' >>$(UNITNAME)/Makefile; \
+ cp TEMPLATE.c $(UNITNAME)/$(UNITNAME).c
+else
+ @echo "no test created. set UNITNAME"
+endif
+++ /dev/null
-#include <stdio.h>
-#include "casl2.h"
-#include "assemble.h"
-#include "exec.h"
-
-int main(){
- int i;
- WORD r;
- char *str[] = {
- "str0", "str1", "str2", "str3", "str4", "str5", "str6", ...
- };
- for(i = 0; i < sizeof(str)/sizeof(str[0]); i++) {
- r = <testfunc>(str[i]);
- printf("%s\t0x%04x", str[i], r);
- if(cerrno > 0) {
- printf("\tError - %d\t%s", cerrno, cerrmsg);
- freecerr();
- }
- printf("\n");
- }
- return 0;
-}
+++ /dev/null
-LOGFILE = ../test.log
-INCLUDE = ../../../include
-CC = gcc
-CFLAGS = -g -Wall -I $(INCLUDE)
-COMMONSRC = ../../../src/struct.c ../../../src/cmd.c ../../../src/cerr.c
-ASSRC = ../../../src/assemble.c ../../../src/token.c ../../../src/label.c ../../../src/macro.c
-EXECSRC = ../../../exec.c ../../../dump.c
-ifeq "$(UCLASS)" "AS"
- SRC = $(COMMONSRC) $(ASSRC)
-endif
-ifeq "$(UCLASS)" "EXEC"
- SRC = $(COMMONSRC) $(EXECSRC)
-endif
-ifeq "$(UCLASS)" "COMMON"
- SRC = $(COMMONSRC)
-endif
-define report
- @echo -n "$(UNITNAME): Test " >$@
- @if test ! -s $^; then \
- echo -n "Success " >>$@; \
- else \
- echo -n "Failure " >>$@; \
- fi
- @echo `date +"%F %T"` >>$@
-endef
-
-.PHPNY: all prepare clean
-all: check
-prepare: orgclean testclean 0.txt
-check: testclean logadd
-orgclean:
- @rm -f 0.txt
-testclean:
- @rm -f 1.txt diff.txt report.txt
-$(UNITNAME): $(COMMONSRC) $(ASSRC) $(UNITNAME).c
- gcc $(CFLAGS) -o $(UNITNAME) $(SRC) $(UNITNAME).c
-0.txt 1.txt: $(UNITNAME)
- ./$(UNITNAME) >$@ 2>&1
-diff.txt: 1.txt
- @-diff 0.txt 1.txt >$@ 2>&1
-report.txt: diff.txt
- $(report)
-logadd: report.txt
- @cat $^ >>$(LOGFILE)
+++ /dev/null
-101: (null) - 101 label already defined
-102: (null) - 102 label table is full
-103: (null) - 103 label not found
-104: (null) - 104 label length is too long
-105: (null) - 105 no command in the line
-106: (null) - 106 operand count mismatch
-107: (null) - 107 no label in START
-108: (null) - 108 not command of operand "r"
-109: (null) - 109 not command of operand "r1,r2"
-110: (null) - 110 not command of operand "r,adr[,x]"
-111: (null) - 111 not command of operand "adr[,x]"
-112: (null) - 112 not command of no operand
-113: (null) - 113 command not defined
-114: (null) - 114 not integer
-115: (null) - 115 not hex
-116: (null) - 116 out of hex range
-117: (null) - 117 operand is too many
-118: (null) - 118 operand length is too long
-119: (null) - 119 out of COMET II memory
-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
-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
-204: (null) - 204 Program Register (PR) - out of COMET II memory
-205: (null) - 205 Stack Pointer (SP) - cannot allocate stack buffer
-206: (null) - 206 unkown error
-207: (null) - 207 unkown error
-999: (null) - 999 unkown error
-101: foobar - 101 foobar: label already defined
-102: foobar - 102 foobar: label table is full
-103: foobar - 103 foobar: label not found
-104: foobar - 104 foobar: label length is too long
-105: foobar - 105 foobar: no command in the line
-106: foobar - 106 foobar: operand count mismatch
-107: foobar - 107 foobar: no label in START
-108: foobar - 108 foobar: not command of operand "r"
-109: foobar - 109 foobar: not command of operand "r1,r2"
-110: foobar - 110 foobar: not command of operand "r,adr[,x]"
-111: foobar - 111 foobar: not command of operand "adr[,x]"
-112: foobar - 112 foobar: not command of no operand
-113: foobar - 113 foobar: command not defined
-114: foobar - 114 foobar: not integer
-115: foobar - 115 foobar: not hex
-116: foobar - 116 foobar: out of hex range
-117: foobar - 117 foobar: operand is too many
-118: foobar - 118 foobar: operand length is too long
-119: foobar - 119 foobar: 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
-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
-204: foobar - 204 foobar: Program Register (PR) - out of COMET II memory
-205: foobar - 205 foobar: Stack Pointer (SP) - cannot allocate stack buffer
-206: foobar - 206 foobar: unkown error
-207: foobar - 207 foobar: unkown error
-999: foobar - 999 foobar: unkown error
-UNITNAME = cerrtest
UCLASS = COMMON
-include ../Test.mk
+TESTSRCFILE = cerrtest.c
+include ../TEST.mk
+++ /dev/null
-LD:000 ---> 0xffff
-LD:066 ---> 0xffff
-NOEX:020 ---> 0xffff
-NOP:000 ---> 0x0000
-LD:011 ---> 0x1000
-ST:010 ---> 0x1100
-LAD:010 ---> 0x1200
-LD:020 ---> 0x1400
-ADDA:011 ---> 0x2000
-SUBA:011 ---> 0x2100
-ADDL:011 ---> 0x2200
-SUBL:011 ---> 0x2300
-ADDA:020 ---> 0x2400
-SUBA:020 ---> 0x2500
-ADDL:020 ---> 0x2600
-SUBL:020 ---> 0x2700
-AND:011 ---> 0x3000
-OR:011 ---> 0x3100
-XOR:011 ---> 0x3200
-AND:020 ---> 0x3400
-OR:020 ---> 0x3500
-XOR:020 ---> 0x3600
-CPA:011 ---> 0x4000
-CPL:011 ---> 0x4100
-CPA:020 ---> 0x4400
-CPL:020 ---> 0x4500
-SLA:010 ---> 0x5000
-SRA:010 ---> 0x5100
-SLL:010 ---> 0x5200
-SRL:010 ---> 0x5300
-JMI:030 ---> 0x6100
-JNZ:030 ---> 0x6200
-JZE:030 ---> 0x6300
-JUMP:030 ---> 0x6400
-JPL:030 ---> 0x6500
-JOV:030 ---> 0x6600
-PUSH:030 ---> 0x7000
-POP:040 ---> 0x7100
-CALL:030 ---> 0x8000
-SVC:030 ---> 0xf000
-RET:000 ---> 0x8100
-UNITNAME = getcmdcode
UCLASS = COMMON
-include ../Test.mk
+include ../TEST.mk
+++ /dev/null
-0xffff ---> 000
-0x0001 ---> 000
-0x0000 ---> 000
-0x1000 ---> 011
-0x1100 ---> 010
-0x1200 ---> 010
-0x1400 ---> 020
-0x2000 ---> 011
-0x2100 ---> 011
-0x2200 ---> 011
-0x2300 ---> 011
-0x2400 ---> 020
-0x2500 ---> 020
-0x2600 ---> 020
-0x2700 ---> 020
-0x3000 ---> 011
-0x3100 ---> 011
-0x3200 ---> 011
-0x3400 ---> 020
-0x3500 ---> 020
-0x3600 ---> 020
-0x4000 ---> 011
-0x4100 ---> 011
-0x4400 ---> 020
-0x4500 ---> 020
-0x5000 ---> 010
-0x5100 ---> 010
-0x5200 ---> 010
-0x5300 ---> 010
-0x6100 ---> 030
-0x6200 ---> 030
-0x6300 ---> 030
-0x6400 ---> 030
-0x6500 ---> 030
-0x6600 ---> 030
-0x7000 ---> 030
-0x7100 ---> 040
-0x8000 ---> 030
-0xf000 ---> 030
-0x8100 ---> 000
-UNITNAME = getcmdtype
UCLASS = COMMON
-include ../Test.mk
+include ../TEST.mk
+++ /dev/null
-== Generel Register ==
- #FFFF
-0 #FFFF
-aaa #FFFF
-GR #FFFF
-GR8 #FFFF
-GR20 #FFFF
-GR0 #0000
-GR1 #0001
-GR2 #0002
-GR3 #0003
-GR4 #0004
-GR5 #0005
-GR6 #0006
-GR7 #0007
-== Index Register ==
- #FFFF
-0 #FFFF
-aaa #FFFF
-GR #FFFF
-GR8 #FFFF
-GR20 #FFFF
-GR0 #0000 Error - 120 GR0 in operand x
-GR1 #0001
-GR2 #0002
-GR3 #0003
-GR4 #0004
-GR5 #0005
-GR6 #0006
-GR7 #0007
-UNITNAME = getgr
UCLASS = AS
-include ../Test.mk
+include ../TEST.mk
+++ /dev/null
-#32768 #0000 Error - 122 #32768: out of hex range
-#-1 #0000 Error - 122 #-1: out of hex range
-#G #0000 Error - 115 #G: not hex
-#FFFF #FFFF
-#0 #0000
-#1 #0001
-#ab #00AB
-#AB #00AB
-#20 #0020
-UNITNAME = gethex
UCLASS = AS
-include ../Test.mk
+include ../TEST.mk
+++ /dev/null
-0 0x0000
-01 0x0001
-1a 0x0000 Error - 114 1a: not integer
--5G 0x0000 Error - 114 -5G: not integer
-123 0x007b
-32767 0x7fff
-32768 0x0000
-32769 0x0001
--1 0xffff
--2345 0xf6d7
--32768 0x8000
--32769 0xffff
--32770 0xfffe
-UNITNAME = getint
UCLASS = AS
-include ../Test.mk
+include ../TEST.mk
+++ /dev/null
-0: IOTEST START
-cl->label: IOTEST
-cl->cmd: START
-cl->opdc: 0
-
-1: OUT OBUF1,OLEN1
-cl->cmd: OUT
-cl->opdc: 2
-cl->opdv[0]: OBUF1
-cl->opdv[1]: OLEN1
-
-2: OUT OBUF2,OLEN2 ;comment
-cl->cmd: OUT
-cl->opdc: 2
-cl->opdv[0]: OBUF2
-cl->opdv[1]: OLEN2
-
-3: OUT OBUF1,OLEN1
-cl->cmd: OUT
-cl->opdc: 2
-cl->opdv[0]: OBUF1
-cl->opdv[1]: OLEN1
-
-4: OUT OBUF1,OLEN1
-cl->cmd: OUT
-cl->opdc: 2
-cl->opdv[0]: OBUF1
-cl->opdv[1]: OLEN1
-
-5: OUT OBUF2,OLEN2
-cl->cmd: OUT
-cl->opdc: 2
-cl->opdv[0]: OBUF2
-cl->opdv[1]: OLEN2
-
-6: OUT OBUF1, OLEN1
-cl->cmd: OUT
-cl->opdc: 1
-cl->opdv[0]: OBUF1
- error - 121: cannot get operand token
-
-7: BEGIN LD GR1, A
-cl->label: BEGIN
-cl->cmd: LD
-cl->opdc: 1
-cl->opdv[0]: GR1
- error - 121: cannot get operand token
-
-8:
-cl is NULL
-
-9: ;comment
-cl is NULL
-
-UNITNAME = linetok
UCLASS = AS
-include ../Test.mk
+TESTSRCFILE = linetok.c
+include ../TEST.mk
+++ /dev/null
-
-OPDC:0
-
-GR0,GR1
-OPDC:2
-OPDC[0]:GR0
-OPDC[1]:GR1
-
-GR0,A
-OPDC:2
-OPDC[0]:GR0
-OPDC[1]:A
-
-GR1,12
-OPDC:2
-OPDC[0]:GR1
-OPDC[1]:12
-
-GR0,0,GR1
-OPDC:3
-OPDC[0]:GR0
-OPDC[1]:0
-OPDC[2]:GR1
-
-'aaa',0
-OPDC:2
-OPDC[0]:'aaa'
-OPDC[1]:0
-
-'aaa','bbb'
-OPDC:2
-OPDC[0]:'aaa'
-OPDC[1]:'bbb'
-
-'aaa'',''bbb'
-OPDC:1
-OPDC[0]:'aaa'',''bbb'
-
-'aaa,bbb'
-OPDC:1
-OPDC[0]:'aaa,bbb'
-
-1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0
-OPDC:40
-OPDC[0]:1
-OPDC[1]:2
-OPDC[2]:3
-OPDC[3]:4
-OPDC[4]:5
-OPDC[5]:6
-OPDC[6]:7
-OPDC[7]:8
-OPDC[8]:9
-OPDC[9]:0
-OPDC[10]:1
-OPDC[11]:2
-OPDC[12]:3
-OPDC[13]:4
-OPDC[14]:5
-OPDC[15]:6
-OPDC[16]:7
-OPDC[17]:8
-OPDC[18]:9
-OPDC[19]:0
-OPDC[20]:1
-OPDC[21]:2
-OPDC[22]:3
-OPDC[23]:4
-OPDC[24]:5
-OPDC[25]:6
-OPDC[26]:7
-OPDC[27]:8
-OPDC[28]:9
-OPDC[29]:0
-OPDC[30]:1
-OPDC[31]:2
-OPDC[32]:3
-OPDC[33]:4
-OPDC[34]:5
-OPDC[35]:6
-OPDC[36]:7
-OPDC[37]:8
-OPDC[38]:9
-OPDC[39]:0
-
-1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1
-OPDC:40
-OPDC[0]:1
-OPDC[1]:2
-OPDC[2]:3
-OPDC[3]:4
-OPDC[4]:5
-OPDC[5]:6
-OPDC[6]:7
-OPDC[7]:8
-OPDC[8]:9
-OPDC[9]:0
-OPDC[10]:1
-OPDC[11]:2
-OPDC[12]:3
-OPDC[13]:4
-OPDC[14]:5
-OPDC[15]:6
-OPDC[16]:7
-OPDC[17]:8
-OPDC[18]:9
-OPDC[19]:0
-OPDC[20]:1
-OPDC[21]:2
-OPDC[22]:3
-OPDC[23]:4
-OPDC[24]:5
-OPDC[25]:6
-OPDC[26]:7
-OPDC[27]:8
-OPDC[28]:9
-OPDC[29]:0
-OPDC[30]:1
-OPDC[31]:2
-OPDC[32]:3
-OPDC[33]:4
-OPDC[34]:5
-OPDC[35]:6
-OPDC[36]:7
-OPDC[37]:8
-OPDC[38]:9
-OPDC[39]:0
-Error - 117: operand is too many
-
-'1234567890123456789012345678901234567890'
-OPDC:1
-OPDC[0]:'1234567890123456789012345678901234567890'
-
-'12345678901234567890123456789012345678901'
-OPDC:0
-Error - 118: '12345678901234567890123456789012345678901': operand length is too long
-
+++ /dev/null
-== CMDTYPE_CODE TABLE ==
-( 0) - SVC 030 #F000
-( 1) - JZE 030 #6300
-( 1) - SLL 010 #5200
-( 2) - SLA 010 #5000
-( 3) - ADDL 011 #2200
-( 3) - NOP 000 #0000
-( 4) - ADDA 011 #2000
-( 7) - OR 020 #3500
-(10) - CALL 030 #8000
-(11) - ADDL 020 #2600
-(12) - ADDA 020 #2400
-(13) - RET 000 #8100
-(14) - SUBL 011 #2300
-(15) - SUBA 011 #2100
-(19) - LAD 010 #1200
-(20) - JMI 030 #6100
-(21) - AND 011 #3000
-(22) - JUMP 030 #6400
-(22) - SUBL 020 #2700
-(23) - CPL 011 #4100
-(23) - SUBA 020 #2500
-(24) - CPA 011 #4000
-(25) - XOR 011 #3200
-(26) - JNZ 030 #6200
-(26) - LD 011 #1000
-(27) - JOV 030 #6600
-(29) - SRL 010 #5300
-(29) - AND 020 #3400
-(29) - ST 010 #1100
-(30) - SRA 010 #5100
-(31) - CPL 020 #4500
-(32) - JPL 030 #6500
-(32) - CPA 020 #4400
-(33) - POP 040 #7100
-(33) - XOR 020 #3600
-(34) - PUSH 030 #7000
-(34) - LD 020 #1400
-(37) - OR 011 #3100
-UNITNAME = print_cmdtype_code
+TESTSRCFILE = print_cmdtype_code.c
UCLASS = COMMON
-include ../Test.mk
+include ../TEST.mk
+++ /dev/null
-== CODE_TYPE TABLE ==
-( 0) - #2600 020 ADDL
-( 0) - #0000 000 NOP
-( 1) - #2700 020 SUBL
-( 4) - #5000 010 SLA
-( 5) - #5100 010 SRA
-( 6) - #5200 010 SLL
-( 7) - #5300 010 SRL
-(10) - #3000 011 AND
-(11) - #3100 011 OR
-(12) - #F000 030 SVC
-(12) - #3200 011 XOR
-(14) - #8000 030 CALL
-(14) - #3400 020 AND
-(15) - #8100 000 RET
-(15) - #3500 020 OR
-(16) - #3600 020 XOR
-(16) - #1000 011 LD
-(17) - #1100 010 ST
-(18) - #1200 010 LAD
-(20) - #1400 020 LD
-(21) - #6100 030 JMI
-(22) - #6200 030 JNZ
-(23) - #6300 030 JZE
-(24) - #6400 030 JUMP
-(25) - #6500 030 JPL
-(26) - #6600 030 JOV
-(26) - #4000 011 CPA
-(27) - #4100 011 CPL
-(30) - #4400 020 CPA
-(31) - #4500 020 CPL
-(32) - #2000 011 ADDA
-(33) - #2100 011 SUBA
-(34) - #2200 011 ADDL
-(35) - #2300 011 SUBL
-(36) - #7000 030 PUSH
-(36) - #2400 020 ADDA
-(37) - #7100 040 POP
-(37) - #2500 020 SUBA
-UNITNAME = print_code_type
UCLASS = COMMON
-include ../Test.mk
+TESTSRCFILE = print_code_type.c
+include ../TEST.mk