-;;; AND r,adr[,x]
+;;; AND r,adr
MAIN START
LD GR1,A
AND GR1,B
-;;; AND r,adr[,x] 演算結果の符号が負
+;;; AND r,adr 演算結果の符号が負
MAIN START
LD GR1,A
AND GR1,B
-;;; AND r,adr[,x] 演算結果が零
+;;; AND r,adr 演算結果が零
MAIN START
LD GR1,A
AND GR1,B
-;;; AND r1,r2
+;;; AND r,adr
MAIN START
LD GR1,A
- LD GR2,B
- AND GR1,GR2
+ AND GR1,1,A
RET
A DC #3000
-B DC #4FFF
+ DC #4FFF
END
--- /dev/null
+;;; AND r1,r2
+MAIN START
+ LD GR1,A
+ LD GR2,B
+ AND GR1,GR2
+ RET
+A DC #3000
+B DC #4FFF
+ END
--- /dev/null
+;;; IN IBUF,ILEN
+MAIN START
+LOOP IN IBUF,ILEN
+FIN RET
+IBUF DS 20
+ILEN DS 1
+ END
+++ /dev/null
-;;; LAD r,adr
-MAIN START
- LAD GR1,='A'
- RET
- END
+++ /dev/null
-LAD1 START
- LAD GR1,10
- LAD GR1,65534,GR1
- RET
- END
+++ /dev/null
-LAD1 START
- LAD GR1,-1
- LAD GR1,65535,GR1
- RET
- END
+++ /dev/null
-MAIN START BEGIN
-BEGIN LD GR7,A
- LAD GR7,1,GR7
- RET
-A DC 3
- END
--- /dev/null
+;;; LD r,adr
+MAIN START
+ LD GR1,='"'
+ LD GR1,='#'
+ LD GR1,='$'
+ LD GR1,='%'
+ LD GR1,='&'
+ LD GR1,=''''
+ LD GR1,='('
+ LD GR1,=')'
+ LD GR1,='*'
+ LD GR1,='+'
+ LD GR1,=','
+ LD GR1,='-'
+ LD GR1,='.'
+ LD GR1,='/'
+ LD GR1,='0'
+ LD GR1,='1'
+ LD GR1,='2'
+ LD GR1,='3'
+ LD GR1,='4'
+ LD GR1,='5'
+ LD GR1,='6'
+ LD GR1,='7'
+ LD GR1,='8'
+ LD GR1,='9'
+ LD GR1,=':'
+ LD GR1,=';'
+ LD GR1,='<'
+ LD GR1,='='
+ LD GR1,='>'
+ LD GR1,='?'
+ LD GR1,='@'
+ LD GR1,='A'
+ LD GR1,='B'
+ LD GR1,='C'
+ LD GR1,='D'
+ LD GR1,='E'
+ LD GR1,='F'
+ LD GR1,='G'
+ LD GR1,='H'
+ LD GR1,='I'
+ LD GR1,='J'
+ LD GR1,='K'
+ LD GR1,='L'
+ LD GR1,='M'
+ LD GR1,='N'
+ LD GR1,='O'
+ LD GR1,='P'
+ LD GR1,='Q'
+ LD GR1,='R'
+ LD GR1,='S'
+ LD GR1,='T'
+ LD GR1,='U'
+ LD GR1,='V'
+ LD GR1,='W'
+ LD GR1,='X'
+ LD GR1,='Y'
+ LD GR1,='Z'
+ LD GR1,='['
+ LD GR1,='\'
+ LD GR1,=']'
+ LD GR1,='^'
+ LD GR1,='_'
+ LD GR1,='`'
+ LD GR1,='a'
+ LD GR1,='b'
+ LD GR1,='c'
+ LD GR1,='d'
+ LD GR1,='e'
+ LD GR1,='f'
+ LD GR1,='g'
+ LD GR1,='h'
+ LD GR1,='i'
+ LD GR1,='j'
+ LD GR1,='k'
+ LD GR1,='l'
+ LD GR1,='m'
+ LD GR1,='n'
+ LD GR1,='o'
+ LD GR1,='p'
+ LD GR1,='q'
+ LD GR1,='r'
+ LD GR1,='s'
+ LD GR1,='t'
+ LD GR1,='u'
+ LD GR1,='v'
+ LD GR1,='w'
+ LD GR1,='x'
+ LD GR1,='y'
+ LD GR1,='z'
+ LD GR1,='{'
+ LD GR1,='|'
+ LD GR1,='}'
+ LD GR1,='~'
+ RET
+ END
+++ /dev/null
-MAIN START
-BEGIN LD GR1,I
- RET
-I DC 17
- END
+++ /dev/null
-; LDコマンド
-MAIN START BEGIN
-BEGIN LD GR1,A
- LD GR2,B
- ADDL GR1,GR2
- RET
-A DC 32767
-B DC 32675
- END
+++ /dev/null
-; LDコマンド
-MAIN START BEGIN
-BEGIN LAD GR2,1
- LD GR1,A,GR2
- RET
-A DC 1
-B DC 2
- END
+++ /dev/null
-;;; ループを使い、連続でGR1にデータを転送する
-MAIN START
- LAD GR2,0
-MLOOP CPA GR2,LEN
- JZE MEND
- LD GR1,DATA,GR2
- LAD GR2,1,GR2
- JUMP MLOOP
-MEND RET
-DATA DC #9600,#F000,#A400
-LEN DC 3
- END
+;;; NOP
MAIN START
NOP
NOP
NOP
RET
END
-
\ No newline at end of file
--- /dev/null
+;;; OR r,adr
+MAIN START
+ LD GR1,A
+ OR GR1,B
+ RET
+A DC #3000
+B DC #4FFF
+ END
--- /dev/null
+;;; OR r,adr 演算結果の符号が負
+MAIN START
+ LD GR1,A
+ OR GR1,B
+ RET
+A DC #8000
+B DC #FFFF
+ END
--- /dev/null
+;;; OR r,adr 演算結果が零
+MAIN START
+ LD GR1,A
+ OR GR1,B
+ RET
+A DC #0001
+B DC #FFFE
+ END
--- /dev/null
+;;; OR r,adr
+MAIN START
+ LD GR1,A
+ OR GR1,1,A
+ RET
+A DC #3000
+ DC #4FFF
+ END
--- /dev/null
+;;; OR r1,r2
+MAIN START
+ LD GR1,A
+ LD GR2,B
+ OR GR1,GR2
+ RET
+A DC #3000
+B DC #4FFF
+ END
-;;; OUTの使用例
-OTEST START
+;;; OUT buf.len
+MAIN START
OUT BUF1,L1
OUT BUF2,L2
OUT BUF3,L3
+++ /dev/null
-MAIN START
- OUT BUF,LEN
- RET
-BUF DC '0'
-LEN DC 1
- END
--- /dev/null
+;;; PUSH / POP 値の復元
+MAIN START
+ LD GR1,A
+ LD GR1,0,GR7
+ LD GR2,1,GR7
+ LD GR3,2,GR7
+ LD GR4,3,GR7
+ LD GR5,4,GR7
+ LD GR6,5,GR7
+ LD GR7,6,GR7
+ PUSH 0,GR1
+ PUSH 0,GR2
+ PUSH 0,GR3
+ PUSH 0,GR4
+ PUSH 0,GR5
+ PUSH 0,GR6
+ PUSH 0,GR7
+ POP GR7
+ POP GR6
+ POP GR5
+ POP GR4
+ POP GR3
+ POP GR2
+ POP GR1
+ RET
+A DC 1,2,3,4,5,6,7
+ END
--- /dev/null
+;;; PUSH / POP 値の交換
+MAIN START
+ LD GR1,A
+ LD GR1,0,GR7
+ LD GR2,1,GR7
+ LD GR3,2,GR7
+ LD GR4,3,GR7
+ LD GR5,4,GR7
+ LD GR6,5,GR7
+ LD GR7,6,GR7
+ PUSH 0,GR1
+ PUSH 0,GR2
+ PUSH 0,GR3
+ PUSH 0,GR4
+ PUSH 0,GR5
+ PUSH 0,GR6
+ PUSH 0,GR7
+ POP GR1
+ POP GR2
+ POP GR3
+ POP GR4
+ POP GR5
+ POP GR6
+ POP GR7
+ RET
+A DC 1,2,3,4,5,6,7
+ END
+++ /dev/null
-PUSHPOP START
- LAD GR1,1
- LAD GR2,2
- PUSH 0,GR1
- PUSH 0,GR2
- LAD GR1,0
- LAD GR2,0
- POP GR2
- POP GR1
- RET
- END
--- /dev/null
+;;; RPOP 値の復元
+MAIN START
+ LD GR1,A
+ LD GR1,0,GR7
+ LD GR2,1,GR7
+ LD GR3,2,GR7
+ LD GR4,3,GR7
+ LD GR5,4,GR7
+ LD GR6,5,GR7
+ LD GR7,6,GR7
+ PUSH 0,GR1
+ PUSH 0,GR2
+ PUSH 0,GR3
+ PUSH 0,GR4
+ PUSH 0,GR5
+ PUSH 0,GR6
+ PUSH 0,GR7
+ RPOP
+ RET
+A DC 1,2,3,4,5,6,7
+ END
--- /dev/null
+;;; PUSH / POP 値の復元
+MAIN START
+ LD GR1,A
+ LD GR1,0,GR7
+ LD GR2,1,GR7
+ LD GR3,2,GR7
+ LD GR4,3,GR7
+ LD GR5,4,GR7
+ LD GR6,5,GR7
+ LD GR7,6,GR7
+ RPUSH
+ POP GR7
+ POP GR6
+ POP GR5
+ POP GR4
+ POP GR3
+ POP GR2
+ POP GR1
+ RET
+A DC 1,2,3,4,5,6,7
+ END
--- /dev/null
+MAIN START
+ LAD GR1,3
+ SLA GR1,2
+ RET
+ END
--- /dev/null
+SLA2 START BEGIN
+BEGIN LAD GR1,#FFFD
+ SLA GR1,2
+ RET
+ END
--- /dev/null
+SLA2 START BEGIN
+BEGIN LAD GR1,#FFFD
+ SLA GR1,2
+ RET
+ END
--- /dev/null
+MAIN START
+ LAD GR1,#4000
+ SLA GR1,1
+ RET
+ END
--- /dev/null
+MAIN START
+ LAD GR1,#C000
+ SLA GR1,1
+ RET
+ END
--- /dev/null
+SLA2 START BEGIN
+BEGIN LAD GR1,#8000
+ SLA GR1,1
+ RET
+ END
--- /dev/null
+MAIN START
+ LAD GR1,#C000
+ SLA GR1,1
+ RET
+ END
--- /dev/null
+;;; SRA r,adr
+MAIN START
+ LAD GR1,12
+ SRA GR1,2
+ RET
+ END
--- /dev/null
+SLA2 START BEGIN
+BEGIN LAD GR1,#FFFD
+ SLA GR1,2
+ RET
+ END
--- /dev/null
+MAIN START
+ LAD GR1,#4000
+ SLA GR1,1
+ RET
+ END
--- /dev/null
+MAIN START
+ LAD GR1,#C000
+ SLA GR1,1
+ RET
+ END
--- /dev/null
+SLA2 START BEGIN
+BEGIN LAD GR1,#8000
+ SLA GR1,1
+ RET
+ END
--- /dev/null
+MAIN START
+ LAD GR1,#C000
+ SLA GR1,1
+ RET
+ END
+++ /dev/null
-; リテラルに「=' '」を指定
-MAIN START
- LD GR1,=' '
- ST GR1,BUF
- OUT BUF,LEN
- RET
-BUF DS 1
-LEN DC 1
- END
-MAIN START
-BEGIN LD GR1,A
- LD GR2,A
- XOR GR1,GR2
- RET
-A DC #8001
-B DC #3521
- END
+;;; XOR r,adr
+MAIN START
+ LD GR1,A
+ XOR GR1,B
+ RET
+A DC #3000
+B DC #4FFF
+ END
--- /dev/null
+;;; XOR r,adr 演算結果の符号が負
+MAIN START
+ LD GR1,A
+ XOR GR1,B
+ RET
+A DC #8000
+B DC #FFFF
+ END
--- /dev/null
+;;; XOR r,adr 演算結果が零
+MAIN START
+ LD GR1,A
+ XOR GR1,B
+ RET
+A DC #0001
+B DC #FFFE
+ END
-MAIN START
-BEGIN LAD GR0,#3444
- LD GR1,A
- XOR GR0,A
- RET
-A DC #00DD
- END
+;;; XOR r,adr
+MAIN START
+ LD GR1,A
+ XOR GR1,1,A
+ RET
+A DC #3000
+ DC #4FFF
+ END
--- /dev/null
+;;; XOR r1,r2
+MAIN START
+ LD GR1,A
+ LD GR2,B
+ XOR GR1,GR2
+ RET
+A DC #3000
+B DC #4FFF
+ END
+;;; XOR r,r rの内容をクリア
MAIN START
BEGIN LD GR1,A
- XOR GR1,B
+ XOR GR1,GR1
RET
A DC 3
-B DC #FFFF
END
+++ /dev/null
-MAIN START
-BEGIN LAD GR0,#3444
- LD GR1,A
- XOR GR0,A
- RET
-A DC #00DD
- END
+++ /dev/null
-;;; XORで、GR1の内容をクリア
-MAIN START
-BEGIN XOR GR2,GR2
-LOOP CPA GR2,LEN
- JZE FIN
- LD GR1,A,GR2
- XOR GR1,GR1
- LAD GR2,1,GR2
- JUMP LOOP
-FIN RET
-A DC #8001,#8000,#FFFF,#51,#7FFF
-LEN DC 5
- END
{
OPD *opd = malloc(sizeof(OPD));
char *p, *q, *sepp;
- int sepc = ',', len;
+ int sepc = ',', len = 0;
bool quoting = false;
opd->opdc = 0;
}
p = q = strdup(str);
do {
- len = 0;
/* オペランド数が多すぎる場合はエラー */
if(opd->opdc >= OPDSIZE) {
setcerr(117, str); /* operand is too many */
../../../../as/ERR/cmd_err0.casl: 3: LAD GR2,2
../../../../as/ERR/cmd_err0.casl: 4: LEA GR1,GR2
Assemble error - 109: LEA: not command of operand "r1,r2"
- ../../../../as/ERR/cmd_err0.casl:4: LEA GR1,GR2
-
+../../../../as/ERR/cmd_err0.casl: 4: LEA GR1,GR2
../../../../as/ERR/cmd_err1.casl: 1:MAIN START BEGIN
../../../../as/ERR/cmd_err1.casl: 2:BEGIN LEA GR1,A
Assemble error - 110: LEA: not command of operand "r,adr[,x]"
- ../../../../as/ERR/cmd_err1.casl:2: BEGIN LEA GR1,A
-
+../../../../as/ERR/cmd_err1.casl: 2:BEGIN LEA GR1,A
--- /dev/null
+../../../../casl2 -slatd ../../../../as/ERR/ds_err.casl
+
+Assemble ../../../../as/ERR/ds_err.casl (0)
+../../../../as/ERR/ds_err.casl: 1:MAIN START
+../../../../as/ERR/ds_err.casl: 2: LAD GR0,=10
+../../../../as/ERR/ds_err.casl: 3: ST GR0,A
+../../../../as/ERR/ds_err.casl: 4:A DS
+Assemble error - 106: operand count mismatch
+../../../../as/ERR/ds_err.casl: 4:A DS
../../../../as/ERR/labeldup_err.casl: 5:A DC 3
../../../../as/ERR/labeldup_err.casl: 6:A DC 1
Assemble error - 101: A: label already defined
- ../../../../as/ERR/labeldup_err.casl:6: A DC 1
-
+../../../../as/ERR/labeldup_err.casl: 6:A DC 1
Assemble ../../../../as/ERR/literalstr_err.casl (0)
Assemble error - 124: 'abcdeABCDE': more than one character in literal
- ../../../../as/ERR/literalstr_err.casl:2: LAD GR1,='abcdeABCDE'
-
+../../../../as/ERR/literalstr_err.casl: 2: LAD GR1,='abcdeABCDE'
../../../../as/ERR/opdspc_err.casl: 1:MAIN START BEGIN
../../../../as/ERR/opdspc_err.casl: 2:BEGIN LD GR1, A
Assemble error - 121: cannot get operand token
- ../../../../as/ERR/opdspc_err.casl:2: BEGIN LD GR1, A
-
+../../../../as/ERR/opdspc_err.casl: 2:BEGIN LD GR1, A
Assemble ../../../../as/ERR/quoteend_err.casl (0)
Assemble error - 123: 'Hello, World!: unclosed quote
- ../../../../as/ERR/quoteend_err.casl:4: BUF DC 'Hello, World!
-
+../../../../as/ERR/quoteend_err.casl: 4:BUF DC 'Hello, World!