+++ /dev/null
-;;; ABSを呼び出す
-MAIN START
- LAD GR2,0
-MLOOP CPA GR2,MLEN
- JZE MFIN
- LD GR1,MVAL,GR2
- CALL OUTA
- CALL ABS
- JOV PUTOV
- JMI PUTM
- OUT PLUS,=1
- JUMP PUTD
-PUTM OUT MINUS,=1
- JUMP PUTD
-PUTOV OUT OV,=2
-PUTD CALL OUTA
- OUT SEP,MLEN
- LAD GR2,1,GR2
- JUMP MLOOP
-MFIN RET
-MVAL DC 12,-12,1,-1,32767,-32767,0,-32768
-MLEN DC 8
-SEP DC '--------'
-PLUS DC '+'
-MINUS DC '-'
-OV DC 'OV'
- END
-../../../../casl2 abs.casl ../../../../as/casl2lib/outa.casl ../../../../as/casl2lib/abs.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+../../../../casl2 ../../../../as/casl2lib/sample/call_abs.casl ../../../../as/casl2lib/outa.casl ../../../../as/casl2lib/abs.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+++ /dev/null
-MAIN START
- LAD GR1,A
- LAD GR2,B
- CALL ADDL32
- LD GR2,GR0
- LD GR1,1,GR2
- CALL OUTL
- LD GR1,0,GR2
- CALL OUTL
- RET
-A DC 6,10
-B DC 2,65530
- END
-../../../../casl2 addl32.casl ../../../../as/casl2lib/addl32.casl ../../../../as/casl2lib/outl.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+../../../../casl2 ../../../../as/casl2lib/sample/call_addl32.casl ../../../../as/casl2lib/addl32.casl ../../../../as/casl2lib/outl.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
-../../../../casl2 -M640 divl.casl ../../../../as/casl2lib/outl.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+../../../../casl2 -M640 ../../../../as/casl2lib/sample/call_divl.casl ../../../../as/casl2lib/outl.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+++ /dev/null
-MAIN START
- LD GR1,XMAX
-LOOPX CPA GR1,XMIN
- JMI FIN
- OUT SEP,SLEN
- LD GR2,YMIN
-LOOPY CPL GR2,YMAX
- JPL XNEXT
- CALL OUTL
- PUSH 0,GR1
- LD GR1,GR2
- CALL OUTL
- POP GR1
- CALL DIVL
- JOV WOV
- PUSH 0,GR1
- LD GR1,GR0
- CALL OUTL
- LD GR1,GR3
- CALL OUTL
- POP GR1
-YNEXT OUT SEP,SLEN
- LAD GR2,1,GR2
- JUMP LOOPY
-WOV OUT Y0MSG,YLEN
- JUMP YNEXT
-XNEXT LAD GR1,-1,GR1
- JUMP LOOPX
-FIN RET
-XMAX DC 100
-XMIN DC 0
-YMAX DC 10
-YMIN DC 0
-SEP DC '--------------------'
-SLEN DC 20
-Y0MSG DC 'Error: div by 0'
-YLEN DC 15
- END
-../../../../casl2 -M720 inl.casl ../../../../as/casl2lib/inl.casl ../../../../as/casl2lib/outl.casl ../../../../as/casl2lib/mull.casl ../../../../as/casl2lib/str2l.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl <teststr.txt
+../../../../casl2 -M720 ../../../../as/casl2lib/sample/call_inl.casl ../../../../as/casl2lib/inl.casl ../../../../as/casl2lib/outl.casl ../../../../as/casl2lib/mull.casl ../../../../as/casl2lib/str2l.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl <teststr.txt
+++ /dev/null
-;;; casl2 inl.casl ../casl2lib/inl.casl ../casl2lib/outl.casl
-MAIN START
-LOOP CALL INL ; GR1に数値、GR0に文字列の長さ
- JOV OV
- AND GR0,GR0
- JZE FIN
- CPL GR0,=#FFFF
- JZE NAN
- CALL OUTL
- JUMP LOOP
-OV CPL GR0,=#FFFF
- JZE LENOV
- OUT OVMSG,MLEN1
- JUMP LOOP
-NAN OUT NANMSG,MLEN2
- JUMP LOOP
-LENOV OUT LENOVMSG,MLEN3
-FIN RET
-OVMSG DC 'Over 65535'
-MLEN1 DC 10
-NANMSG DC 'Not A Number'
-MLEN2 DC 12
-LENOVMSG DC 'Str too long. Stop'
-MLEN3 DC 18
- END
-../../../../casl2 minim.casl ../../../../as/casl2lib/minim.casl ../../../../as/casl2lib/outa.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl ../../../../as/casl2lib/abs.casl
+../../../../casl2 ../../../../as/casl2lib/sample/call_minim.casl ../../../../as/casl2lib/minim.casl ../../../../as/casl2lib/outa.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl ../../../../as/casl2lib/abs.casl
+++ /dev/null
-;;; casl2 minim.casl $(LIBDIR)/minim.casl $(LIBDIR)/outa.casl
-MAIN START
- LAD GR1,DATA
- LD GR2,CNT
- CALL MINIM
- LD GR1,GR0
- CALL OUTA
- RET
-DATA DC 23,78,2,45,67,-39,86
-CNT DC 7
- END
-../../../../casl2 -M640 mula.casl ../../../../as/casl2lib/mula.casl ../../../../as/casl2lib/mull.casl ../../../../as/casl2lib/outa.casl ../../../../as/casl2lib/abs.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
\ No newline at end of file
+../../../../casl2 -M640 ../../../../as/casl2lib/sample/call_mula.casl ../../../../as/casl2lib/mula.casl ../../../../as/casl2lib/mull.casl ../../../../as/casl2lib/outa.casl ../../../../as/casl2lib/abs.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+++ /dev/null
-MAIN START
- LAD GR3,0 ; Xのインデックス
-LOOPX CPA GR3,XCNT
- JZE FIN
- LD GR1,X,GR3
- LAD GR4,0 ; Yのインデックス
-LOOPY CPA GR4,YCNT
- JZE XNEXT
- LD GR2,Y,GR4
- CALL OUTA
- PUSH 0,GR1
- LD GR1,GR2
- CALL OUTA
- POP GR1
- CALL MULA
- JOV WOV
- PUSH 0,GR1
- LD GR1,GR0
- CALL OUTA
- POP GR1
-YNEXT OUT SEP,SLEN
- LAD GR4,1,GR4
- JUMP LOOPY
-WOV OUT YOMSG,YLEN
- JUMP YNEXT
-XNEXT LAD GR3,1,GR3
- JUMP LOOPX
-FIN RET
-X DC 0,1,2,127,128,151,217,255,256,257,32767,-32768,-32767,-257,-256,-255,-217,-151,-128,-127,-2,-1
-Y DC 0,1,2,127,128,151,217,255,256,257,32767,-32768,-32767,-257,-256,-255,-217,-151,-128,-127,-2,-1
-XCNT DC 22
-YCNT DC 22
-SEP DC '--------------------'
-SLEN DC 20
-YOMSG DC 'Warning: overflow'
-YLEN DC 17
- END
-../../../../casl2 -M4096 mull.casl ../../../../as/casl2lib/mull.casl ../../../../as/casl2lib/outl.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+../../../../casl2 -M4096 ../../../../as/casl2lib/sample/call_mull.casl ../../../../as/casl2lib/mull.casl ../../../../as/casl2lib/outl.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+++ /dev/null
-MAIN START
- LAD GR4,0 ; Xのインデックス
-LOOPX CPA GR4,XCNT ; (GR4 = XCNT)の場合、ループ脱出
- JZE FIN ; ↓
- LD GR1,X,GR4 ; GR1に、(X+GR4)番地の値を転送
- LAD GR5,0 ; Yのインデックス
-LOOPY CPA GR5,YCNT ; (GR5 = YCNT)の場合、ループ脱出
- JZE XNEXT ; ↓
- LD GR2,Y,GR5 ; GR2に、(X+GR5)番地の値を転送
- CALL OUTL ; GR1の数値を出力
- PUSH 0,GR1 ; GR2の数値を出力
- LD GR1,GR2 ; ↓
- CALL OUTL ; ↓
- POP GR1 ; ↓
- CALL MULL ; GR0 <- GR1 * GR2
- JOV WOV ; オーバーフローの場合は、WOVへジャンプ
- PUSH 0,GR1 ; GR0の数値を出力
- LD GR1,GR0 ; ↓
- CALL OUTL ; ↓
- POP GR1 ; ↓
-YNEXT OUT SEP,SLEN ; 区切り線を出力
- LAD GR5,1,GR5 ; GR5 <- GR5 + 1
- JUMP LOOPY ; LOOPYへジャンプ
-WOV OUT YOMSG,YLEN ; オーバーフローした場合のメッセージを表示
- PUSH 0,GR1 ; GR0の数値を出力
- LD GR1,GR0 ; ↓
- CALL OUTL ; ↓
- POP GR1 ; ↓
- PUSH 0,GR1 ; GR3の数値を出力
- LD GR1,GR3 ; ↓
- CALL OUTL ; ↓
- POP GR3 ; ↓
- JUMP YNEXT ; YNEXTへジャンプ
-XNEXT LAD GR4,1,GR4 ; GR4 <- GR4 + 1
- JUMP LOOPX ; LOOPXへジャンプ
-FIN RET
-X DC 0,1,2,127,128,255,256,257,32767,#8000,#FFFF
-Y DC 0,1,2,127,128,255,256,257,32767,#8000,#FFFF
-XCNT DC 11
-YCNT DC 11
-SEP DC '--------------------'
-SLEN DC 20
-YOMSG DC 'overflow'
-YLEN DC 8
- END
-../../../../casl2 outa.casl ../../../../as/casl2lib/outa.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/abs.casl ../../../../as/casl2lib/rev.casl
+../../../../casl2 ../../../../as/casl2lib/sample/call_outa.casl ../../../../as/casl2lib/outa.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/abs.casl ../../../../as/casl2lib/rev.casl
+++ /dev/null
-;; casl2 outi_call.casl outi.casl
-MAIN START
- LAD GR1,VAL
- LAD GR2,0
-LOOP CPA GR2,CNT
- JZE FIN
- LD GR1,VAL,GR2
- CALL OUTA
- LAD GR2,1,GR2
- JUMP LOOP
-FIN RET
-VAL DC 0
- DC #0001,#0002,#0004,#0008
- DC #0010,#0020,#0040,#0080
- DC #0100,#0200,#0400,#0800
- DC #1000,#2000,#4000,#7FFF
- DC #8000
- DC #8001,#C000,#E000,#F000
- DC #F800,#FC00,#FE00,#FF00
- DC #FF80,#FFC0,#FFE0,#FFF0
- DC #FFF8,#FFFC,#FFFE,#FFFF
-CNT DC 34
- END
-../../../../casl2 outa_q15.casl ../../../../as/casl2lib/outa_q15.casl ../../../../as/casl2lib/mull.casl ../../../../as/casl2lib/abs.casl
+../../../../casl2 ../../../../as/casl2lib/sample/call_outa_q15.casl ../../../../as/casl2lib/outa_q15.casl ../../../../as/casl2lib/mull.casl ../../../../as/casl2lib/abs.casl
+++ /dev/null
-;; outd_q15.caslを呼び出し、33個の数値を表示する
-MAIN START
- LAD GR2,0
-LOOP LD GR1,VAL,GR2
- CALL OUTAQ15
- LAD GR2,1,GR2
- CPA GR2,CNT
- JZE FIN
- JUMP LOOP
-FIN RET
-VAL DC #7FFF,#4000,#2000,#1000
- DC #0800,#0400,#0200,#0100
- DC #0080,#0040,#0020,#0010
- DC #0008,#0004,#0002,#0001
- DC #8000
- DC #8001,#C000,#E000,#F000
- DC #F800,#FC00,#FE00,#FF00
- DC #FF80,#FFC0,#FFE0,#FFF0
- DC #FFF8,#FFFC,#FFFE,#FFFF
-CNT DC 33
- END
-../../../../casl2 outb.casl ../../../../as/casl2lib/outb.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+../../../../casl2 ../../../../as/casl2lib/sample/call_outb.casl ../../../../as/casl2lib/outb.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+++ /dev/null
-;;; casl2 outb_call.casl outb.casl
-MAIN START
- LAD GR2,0
-LOOP LD GR1,VAL,GR2
- CALL OUTB
- LAD GR2,1,GR2
- CPA GR2,CNT
- JZE FIN
- JUMP LOOP
-FIN RET
-VAL DC 0
- DC #0001,#0002,#0004,#0008
- DC #0010,#0020,#0040,#0080
- DC #0100,#0200,#0400,#0800
- DC #1000,#2000,#4000,#7FFF
- DC #8000
- DC #8001,#C000,#E000,#F000
- DC #F800,#FC00,#FE00,#FF00
- DC #FF80,#FFC0,#FFE0,#FFF0
- DC #FFF8,#FFFC,#FFFE,#FFFF
-CNT DC 34
- END
-../../../../casl2 outb_w.casl ../../../../as/casl2lib/outb_w.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+../../../../casl2 ../../../../as/casl2lib/sample/call_outb_w.casl ../../../../as/casl2lib/outb_w.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+++ /dev/null
-../../../../casl2 outb_w0.casl ../../../../as/casl2lib/outb_w.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+++ /dev/null
-;;; casl2 outb_call.casl outb.casl
-MAIN START
- LAD GR2,0
-LOOP LD GR1,VAL,GR2
- CALL OUTB
- LAD GR2,1,GR2
- CPA GR2,CNT
- JZE FIN
- JUMP LOOP
-FIN RET
-VAL DC 0
- DC #0001,#0002,#0004,#0008
- DC #0010,#0020,#0040,#0080
- DC #0100,#0200,#0400,#0800
- DC #1000,#2000,#4000,#7FFF
- DC #8000
- DC #8001,#C000,#E000,#F000
- DC #F800,#FC00,#FE00,#FF00
- DC #FF80,#FFC0,#FFE0,#FFF0
- DC #FFF8,#FFFC,#FFFE,#FFFF
-CNT DC 34
- END
+++ /dev/null
-;;; casl2 outb_call.casl outb.casl
-MAIN START
- LAD GR2,0
-LOOP LD GR1,VAL,GR2
- CALL OUTB
- LAD GR2,1,GR2
- CPA GR2,CNT
- JZE FIN
- JUMP LOOP
-FIN RET
-VAL DC #0001,#8000
-CNT DC 2
- END
-../../../../casl2 outl.casl ../../../../as/casl2lib/outl.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+../../../../casl2 ../../../../as/casl2lib/sample/call_outl.casl ../../../../as/casl2lib/outl.casl ../../../../as/casl2lib/divl.casl ../../../../as/casl2lib/rev.casl
+++ /dev/null
-;;; casl2 outl_call.casl outl.casl
-MAIN START
- LAD GR2,0
-LOOP LD GR1,VAL,GR2
- CALL OUTL
- LAD GR2,1,GR2
- CPA GR2,CNT
- JZE FIN
- JUMP LOOP
-FIN RET
-VAL DC 0
- DC #0001,#0002,#0004,#0008
- DC #0010,#0020,#0040,#0080
- DC #0100,#0200,#0400,#0800
- DC #1000,#2000,#4000,#7FFF
- DC #8000
- DC #8001,#C000,#E000,#F000
- DC #F800,#FC00,#FE00,#FF00
- DC #FF80,#FFC0,#FFE0,#FFF0
- DC #FFF8,#FFFC,#FFFE,#FFFF
-CNT DC 34
- END
-../../../../casl2 outl_q15.casl ../../../../as/casl2lib/outl_q15.casl ../../../../as/casl2lib/mull.casl
+../../../../casl2 ../../../../as/casl2lib/sample/call_outl_q15.casl ../../../../as/casl2lib/outl_q15.casl ../../../../as/casl2lib/mull.casl
+++ /dev/null
-;; outd_q15.caslを呼び出し、33個の数値を表示する
-MAIN START
- LAD GR2,0
-LOOP LD GR1,VAL,GR2
- CALL OUTLQ15
- LAD GR2,1,GR2
- CPA GR2,CNT
- JZE FIN
- JUMP LOOP
-FIN RET
-VAL DC #0001,#0002,#0004,#0008
- DC #0010,#0020,#0040,#0080
- DC #0100,#0200,#0400,#0800
- DC #1000,#2000,#4000,#7FFF
- DC #8000
- DC #8001,#C000,#E000,#F000
- DC #F800,#FC00,#FE00,#FF00
- DC #FF80,#FFC0,#FFE0,#FFF0
- DC #FFF8,#FFFC,#FFFE,#FFFF
-CNT DC 33
- END
-../../../../casl2 rev.casl ../../../../as/casl2lib/rev.casl
+../../../../casl2 ../../../../as/casl2lib/sample/call_rev.casl ../../../../as/casl2lib/rev.casl
+++ /dev/null
-MAIN START
- OUT STR,LEN
- LAD GR1,STR
- LD GR2,LEN
- CALL REV
- OUT STR,LEN
- RET
-STR DC '12345'
-LEN DC 5
- END