.title FIGFORTH VAX-11 fig-Forth Version 1.0 ; ; This public domain software is provided through the courtesy of ; Forth Interest Group, PO Box 1105, San Carlos, CA 94070 ; Futher distribution must include this notice. ; .psect virtual_machine, wrt,exe,long .entry forth, ^m start: $trnlog_s - lognam=ttname,rsllen=nlen,rslbuf=devdesc cmpb name,#^x1B bneq 10$ subl #4,nlen addl #4,naddr 10$: $assign_s - devnam=devdesc,chan=ttchan clrw ctlc $qio_s chan=ttchan,func=#IO$_SETMODE!IO$M_CTRLCAST,p1=ctrlcast,p3=#3 jmp cold firstb = ^xA000 limitb = ^xB010 .word 0 temp1: .blkb 1 ctlc: .blkw 1 seed: .blkl 1 ttname: .ascid /SYS$INPUT/ ttchan: .blkw 1 ttiosb: .blkw 1 ttiolen: .blkw 1 .blkl 1 devdesc: nlen: .long 63 naddr: .long name name: .blkb 63 .align long,0 $fibdef $iodef $rmsdef namblk: $nam fab_rblock: $fab alq=1,fac=get,fna=filnam,fns=filsiz, - fop=ctg,mrs=1024,nam=namblk,org=seq,rfm=fix fab_wblock: $fab alq=1,fac=put,fna=filnam,fns=filsiz, - fop=ctg,mrs=1024,nam=namblk,org=seq,rfm=fix rab_rblock: $rab fab=fab_rblock,rac=seq,usz=1024,rbf=firstb rab_wblock: $rab fab=fab_wblock,rac=seq,rsz=1024,rbf=firstb filnam: .ascii /SYS$DISK:/ begadr: .blkl 3 fthadr: .ascii /.FTH/ filsiz = .-filnam ; cold start routine cold: clrl r3 clrl r4 clrl r5 clrl r6 clrl r7 clrl r8 clrl r9 clrl r10 clrl r11 movw #srtparm,r10 movw #frth+14,r11 movw (r10),(r11) movb #^x0B,r4 jmp putf warm: clrl r4 movb #^x08,r4 putf: movw #srtparm+^x4,r10 movw (r10),r3 movw #srtparm,r10 movw r3,r11 wrmlp: movw (r10)+,(r11)+ sobgtr r4,wrmlp movw #abort+2,r6 jmp rp1+2 ; start of fig-Forth program .ascii /VAX 11-780/ .blkw 2 srtparm: .word task-7 .word ^x7F .word fend+^x5000 .word fend+^x4800 .word fend+^x4FFF .word fend+^x4BFF .word 31 .word 1 .word fend .word fend .word frth+16 .byte ^x83 ; lit .ascii /LI/ .byte ^xD4 .word 0 lit: .word lit+2 addw #2,r9 movw (r6)+,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x87 ; execute .ascii /EXECUT/ .byte ^xC5 .word lit-6 exe: .word exe+2 movw (r9),r7 subw #2,r9 movzwl (r7)+,r11 jmp (r11) .byte ^x86 ; branch .ascii /BRANC/ .byte ^xC8 .word exe-10 brch: .word brch+2 movw (r6)+,r6 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x87 ; 0branch .ascii /0BRANC/ .byte ^xC8 .word brch-9 zbrch: .word zbrch+2 tstw (r9) beqlu zbr1 subw #2,r9 addw #2,r6 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) zbr1: subw #2,r9 movw (r6)+,r6 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x86 ; (loop) .ascii /(LOOP/ .byte ^xA9 .word zbrch-10 lupe: .word lupe+2 addw #1,(r8) movw (r8)+,r11 subw3 r11,(r8)+,r11 bgtr lupe2 addw #2,r6 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) lupe2: subw #4,r8 movw (r6)+,r6 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x87 ; (+loop) .ascii /(+LOOP/ .byte ^xA9 .word lupe-9 plupe: .word plupe+2 tstw (r9) blss nplupe addw3 (r8),(r9),(r8) subw #2,r9 movw (r8)+,r11 subw3 r11,(r8)+,r11 bgtr plupe2 addw #2,r6 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) plupe2: subw #4,r8 movw (r6)+,r6 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) nplupe: addw3 (r8),(r9),(r8) subw #2,r9 movw (r8)+,r11 subw (r8)+,r11 bgtr plupe2 addw #2,r6 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x84 ; (do) .ascii /(DO/ .byte ^xA9 .word plupe-10 pdo: .word pdo+2 subw #2,r9 movw (r9)+,-(r8) movw (r9),-(r8) subw #4,r9 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x85 ; digit .ascii /DIGI/ .byte ^xD4 .word pdo-7 dgt: .word dgt+2 subw #2,r9 subb3 #^x30,(r9),r5 blssu bad cmpb r5,#^x0A blssu dok cmpb r5,#^x11 blssu bad cmpb r5,#^x2B bgequ bad subb #^x07,r5 dok: addw #2,r9 cmpb r5,(r9) bgequ bad subw #2,r9 movw r5,(r9)+ movw #1,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) bad: movw #0,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x86 ; (find) .ascii /(FIND/ .byte ^xA9 .word dgt-8 find: .word find+2 clrl r4 movzwl (r9),r10 movzwl -(r9),r11 find1: movzbl (r10),r5 xorb3 (r10)+,(r11)+,r4 bitb #^x3F,r4 bnequ pfind9 find2: tstb (r10) bgtr pfind8 xorb3 (r10)+,(r11)+,r4 bitb #^x7F,r4 beqlu found pfind3: tstw (r10) bnequ bok clrw (r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) pfind8: xorb3 (r10)+,(r11)+,r4 beqlu find2 pfind9: bitb #^x80,(r10)+ beqlu pfind9 jmp pfind3 found: addw #4,r10 movw r10,(r9)+ movw r5,(r9)+ movw #1,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) bok: movw (r10),r10 movw (r9),r11 jmp find1 .byte ^x87 ; enclose .ascii /ENCLOS/ .byte ^xC5 .word find-9 encl: .word encl+2 clrl r4 clrl r11 subw #2,r9 movzwl (r9)+,r10 movzbl (r9),r5 lop1: tstb (r10) beqlu null subb3 (r10),r5,r4 bnequ frst incw r10 incw r11 jmp lop1 frst: movw r11,(r9)+ lop2: tstb (r10) beqlu null1 subb3 (r10),r5,r4 beqlu delim incw r10 incw r11 jmp lop2 delim: movw r11,(r9)+ addw3 #1,r11,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) null: movw r11,(r9)+ addw3 #1,r11,(r9)+ jmp null2 null1: movw r11,(r9)+ null2: movw r11,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x85 ; cmove .ascii /CMOV/ .byte ^xC5 .word encl-10 cmove: .word cmove+2 movzwl (r9),r5 movzwl -(r9),r10 movzwl -(r9),r11 subw #2,r9 luup: movb (r11)+,(r10)+ sobgtr r5,luup movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; u* .ascii /U/ .byte ^xAA .word cmove-8 ustar: .word ustar+2 movzwl (r9),r10 movzwl -(r9),r11 mull3 r11,r10,r11 movl r11,(r9) addw #2,r9 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; u/ .ascii /U/ .byte ^xAF .word ustar-5 uslsh: .word uslsh+2 clrl r11 movzwl (r9),r4 subw #4,r9 movl (r9),r10 ediv r4,r10,r4,r10 movw r10,(r9)+ movw r4,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x83 ; and .ascii /AN/ .byte ^xC4 .word uslsh-5 fand: .word fand+2 mcomw (r9),r10 bicw r10,-(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; or .ascii /O/ .byte ^xD2 .word fand-6 ffor: .word ffor+2 bisw (r9),-(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x83 ; xor .ascii /XO/ .byte ^xD2 .word ffor-5 fxor: .word fxor+2 xorw (r9),-(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x83 ; sp@ .ascii /SP/ .byte ^xC0 .word fxor-6 fspat: .word fspat+2 movw r9,r10 addw #2,r9 movw r10,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x83 ; sp! .ascii /SP/ .byte ^xA1 .word fspat-6 sp1: .word sp1+2 addw3 #^x6,r3,r4 subw3 #2,(r4),r9 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x83 ; rp! .ascii /RP/ .byte ^xA1 .word sp1-6 rp1: .word rp1+2 addw3 #^x08,r3,r4 movw (r4),r8 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; ;s .ascii /;/ .byte ^xD3 .word rp1-6 semis: .word semis+2 movw (r8)+,r6 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x85 ; leave .ascii /LEAV/ .byte ^xC5 .word semis-5 lve: .word lve+2 movw (r8)+,r10 movw r10,(r8) subw #2,r8 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; >r .ascii />/ .byte ^xD2 .word lve-8 gr: .word gr+2 movw (r9),-(r8) subw #2,r9 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; r> .ascii /R/ .byte ^xBE .word gr-5 rg: .word rg+2 addw #2,r9 movw (r8)+,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x81 ; r .byte ^xD2 .word rg-5 r: .word r+2 addw #2,r9 movw (r8),(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; 0= .ascii /0/ .byte ^xBD .word r-4 zeqal: .word zeqal+2 tstw (r9) bneq none movw #^x01,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) none: movw #0,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x83 ; d0= .ascii /D0/ .byte ^xBD .word zeqal-5 dzeql: .word dzeql+2 subw #2,r9 tstl (r9) bneq dnone movw #^x01,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) dnone: movw #0,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; 0< .ascii /0/ .byte ^xBC .word dzeql-6 zless: .word zless+2 tstw (r9) blss zlone movw #0,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) zlone: movw #^x01,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x81 ; + .byte ^xAB .word zless-5 plus: .word plus+2 addw (r9),-(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x85 ; minus .ascii /MINU/ .byte ^xD3 .word plus-4 minus: .word minus+2 mnegw (r9),(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; d+ .ascii /D/ .byte ^xAB .word minus-8 dplus: .word dplus+2 subw #2,r9 addl (r9),-(r9) addw #2,r9 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x86 ; dminus .ascii /DMINU/ .byte ^xD3 .word dplus-5 dmin: .word dmin+2 subw #2,r9 mnegl (r9),(r9) addw #2,r9 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x84 ; drop .ascii /DRO/ .byte ^xD0 .word dmin-9 drop: .word drop+2 subw #2,r9 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x84 ; over .ascii /OVE/ .byte ^xD2 .word drop-7 over: .word over+2 subw #2,r9 movw (r9)+,r10 addw #2,r9 movw r10,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x84 ; swap .ascii /SWA/ .byte ^xD0 .word over-7 swap: .word swap+2 movw (r9),r10 movw -(r9),r11 movw r10,(r9)+ movw r11,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x83 ; dup .ascii /DU/ .byte ^xD0 .word swap-7 dup: .word dup+2 movw (r9)+,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; +! .ascii /+/ .byte ^xA1 .word dup-6 pluss: .word pluss+2 movzwl (r9),r10 addw -(r9),(r10) subw #2,r9 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x86 ; toggle .ascii /TOGGL/ .byte ^xC5 .word pluss-5 tgle: .word tgle+2 movb (r9),r4 movzwl -(r9),r10 subw #2,r9 xorb r4,(r10) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x81 ; @ .byte ^xC0 .word tgle-9 at: .word at+2 movzwl (r9),r11 movw (r11),(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; c@ .ascii /C/ .byte ^xC0 .word at-4 cat: .word cat+2 movzwl (r9),r10 movzbw (r10),(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x81 ; ! .byte ^xA1 .word cat-5 ex: .word ex+2 movzwl (r9),r10 movw -(r9),(r10) subw #2,r9 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x82 ; c! .ascii /C/ .byte ^xA1 .word ex-4 cex: .word cex+2 movzwl (r9),r10 subw #2,r9 movb (r9),(r10) subw #2,r9 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x84 ; emit .ascii /EMI/ .byte ^xD4 .word cex-5 emit: .word emit+2 movb (r9),temp1 subw #2,r9 $qio_s efn=#1,chan=ttchan,func=#IO$_WRITEVBLK!IO$M_NOFORMAT, - iosb=ttiosb,p1=temp1,p2=#1 $waitfr_s efn=#1 clrl r5 addw3 #^x1A,r3,r5 addw #1,(r5) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x83 ; key .ascii /KE/ .byte ^xD9 .word emit-7 key: .word key+2 $qio_s efn=#1,chan=ttchan,func=#IO$_TTYREADALL!IO$M_NOECHO, - iosb=ttiosb,p1=temp1,p2=#1 $waitfr_s efn=#1 addw #2,r9 movzbw temp1,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x89 ; ?terminal .ascii /?TERMINA/ .byte ^xCC .word key-6 qterm: .word qterm+2 addw #2,r9 movw ctlc,(r9) clrw ctlc movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) ctrlcast: ; service routine for .word 0 ; ctrl-c interrupt movw #1,ctlc $qio_s chan=ttchan,func=#IO$_SETMODE!IO$M_CTRLCAST, - p1=ctrlcast,p3=#3 ret .byte ^x82 ; cr .ascii /C/ .byte ^xD2 .word qterm-12 cr: .word nest .word pdq .byte ^x02 .byte ^x0D .byte ^x0A .word semis nest: movw r6,-(r8) ; run time nest movw r7,r6 movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) var: addw #2,r9 ; run time variable movw r7,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) const: addw #2,r9 ; run time constant movw (r7)+,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) user: addw #2,r9 ; run time user addw3 r3,(r7)+,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x81 ; 0 .byte ^xB0 .word cr-5 zero: .word const .word 0 .byte ^x81 ; 1 .byte ^xB1 .word zero-4 one: .word const .word 1 .byte ^x81 ; 2 .byte ^xB2 .word one-4 two: .word const .word 2 .byte ^x82 ; bl .ascii /B/ .byte ^xCC .word two-4 bl: .word const .word ^x20 .byte ^x83 ; c/l .ascii \C/\ .byte ^xCC .word bl-5 cl: .word const .word ^x40 .byte ^x85 ; first .ascii /FIRS/ .byte ^xD4 .word cl-6 first: .word const .word firstb .byte ^x85 ; limit .ascii /LIMI/ .byte ^xD4 .word first-8 limit: .word const .word limitb .byte ^x85 ; b/buf .ascii \B/BU\ .byte ^xC6 .word limit-8 bbuf: .word const .word ^x400 .byte ^x85 ; b/scr .ascii \B/SC\ .byte ^xD2 .word bbuf-8 bscr: .word const .word 1 .byte ^x86 ; origin .ascii /ORIGI/ .byte ^xCE .word bscr-8 orgn: .word const .word srtparm-^x0C .byte ^x87 ; +origin .ascii /+ORIGI/ .byte ^xCE .word orgn-9 porgn: .word nest .word orgn .word plus .word semis .byte ^x82 ; s0 .ascii /S/ .byte ^xB0 .word porgn-10 so: .word user .word 6 .byte ^x82 ; r0 .ascii /R/ .byte ^xB0 .word so-5 ro: .word user .word 8 .byte ^x83 ; tib .ascii /TI/ .byte ^xC2 .word ro-5 tib: .word user .word ^x0A .byte ^x85 ; width .ascii /WIDT/ .byte ^xC8 .word tib-6 width: .word user .word ^x0C .byte ^x87 ; warning .ascii /WARNIN/ .byte ^xC7 .word width-8 wrng: .word user .word ^x0E .byte ^x85 ; fence .ascii /FENC/ .byte ^xC5 .word wrng-10 fnce: .word user .word ^x10 .byte ^x82 ; dp .ascii /D/ .byte ^xD0 .word fnce-8 dp: .word user .word ^x12 .byte ^x88 ; voc-link .ascii /VOC-LIN/ .byte ^xCB .word dp-5 vl: .word user .word ^x14 .byte ^x83 ; blk .ascii /BL/ .byte ^xCB .word vl-11 blk: .word user .word ^x16 .byte ^x82 ; in .ascii /I/ .byte ^xCE .word blk-6 fin: .word user .word ^x18 .byte ^x83 ; out .ascii /OU/ .byte ^xD4 .word fin-5 fout: .word user .word ^x1A .byte ^x83 ; scr .ascii /SC/ .byte ^xD2 .word fout-6 fscr: .word user .word ^x1C .byte ^x86 ; offset .ascii /OFFSE/ .byte ^xD4 .word fscr-6 ofst: .word user .word ^x1E .byte ^x87 ; context .ascii /CONTEX/ .byte ^xD4 .word ofst-9 cntx: .word user .word ^x20 .byte ^x87 ; current .ascii /CURREN/ .byte ^xD4 .word cntx-10 crnt: .word user .word ^x22 .byte ^x85 ; state .ascii /STAT/ .byte ^xC5 .word crnt-10 stt: .word user .word ^x24 .byte ^x84 ; base .ascii /BAS/ .byte ^xC5 .word stt-8 base: .word user .word ^x26 .byte ^x83 ; dpl .ascii /DP/ .byte ^xCC .word base-7 dpl: .word user .word ^x28 .byte ^x83 ; fld .ascii /FL/ .byte ^xC4 .word dpl-6 fld: .word user .word ^x2A .byte ^x83 ; csp .ascii /CS/ .byte ^xD0 .word fld-6 csp: .word user .word ^x2C .byte ^x82 ; r# .ascii /R/ .byte ^xA3 .word csp-6 rnu: .word user .word ^x2E .byte ^x83 ; hld .ascii /HL/ .byte ^xC4 .word rnu-5 hld: .word user .word ^x30 .byte ^x82 ; di .ascii /D/ .byte ^xD6 .word hld-6 dis: .word user .word ^x32 .byte ^x82 ; 1+ .ascii /1/ .byte ^xAB .word dis-5 plus1: .word nest .word one .word plus .word semis .byte ^x82 ; 2+ .ascii /2/ .byte ^xAB .word plus1-5 plus2: .word nest .word two .word plus .word semis .byte ^x84 ; here .ascii /HER/ .byte ^xC5 .word plus2-5 here: .word nest .word dp .word at .word semis .byte ^x85 ; allot .ascii /ALLO/ .byte ^xD4 .word here-7 allot: .word nest .word dp .word pluss .word semis .byte ^x81 ; , .byte ^xAC .word allot-8 comma: .word nest .word here .word ex .word two .word allot .word semis .byte ^x82 ; c, .ascii /C/ .byte ^xAC .word comma-4 ccma: .word nest .word here .word cex .word one .word allot .word semis .byte ^x81 ; - .byte ^xAD .word ccma-5 mins: .word nest .word minus .word plus .word semis .byte ^x81 ; = .byte ^xBD .word mins-4 eql: .word nest .word mins .word zeqal .word semis .byte ^x81 ; < .byte ^xBC .word eql-4 less: .word nest .word mins .word zless .word semis .byte ^x81 ; > .byte ^xBE .word less-4 gtr: .word nest .word swap .word less .word semis .byte ^x83 ; rot .ascii /RO/ .byte ^xD4 .word gtr-4 rot: .word nest .word gr .word swap .word rg .word swap .word semis .byte ^x85 ; space .ascii /SPAC/ .byte ^xC5 .word rot-6 spc: .word nest .word bl .word emit .word semis .byte ^x84 ; -dup .ascii /-DU/ .byte ^xD0 .word spc-8 mdup: .word nest .word dup .word zbrch .word .+4 .word dup .word semis .byte ^x88 ; traverse .ascii /TRAVERS/ .byte ^xC5 .word mdup-7 trvs: .word nest .word swap tr1: .word over .word plus .word lit .word ^x7F .word over .word cat .word less .word zbrch .word tr1 .word swap .word drop .word semis .byte ^x86 ; latest .ascii /LATES/ .byte ^xD4 .word trvs-11 ltst: .word nest .word crnt .word at .word at .word semis .byte ^x83 ; lfa .ascii /LF/ .byte ^xC1 .word ltst-9 lfa: .word nest .word lit .word 4 .word mins .word semis .byte ^x83 ; cfa .ascii /CF/ .byte ^xC1 .word lfa-6 cfa: .word nest .word two .word mins .word semis .byte ^x83 ; nfa .ascii /NF/ .byte ^xC1 .word cfa-6 nfa: .word nest .word lit .word 5 .word mins .word lit .word ^xFFFF .word trvs .word semis .byte ^x83 ; pfa .ascii /PF/ .byte ^xC1 .word nfa-6 pfa: .word nest .word one .word trvs .word lit .word 5 .word plus .word semis .byte ^x84 ; !csp .ascii /!CS/ .byte ^xD0 .word pfa-6 dcsp: .word nest .word fspat .word csp .word ex .word semis .byte ^x86 ; ?error .ascii /?ERRO/ .byte ^xD2 .word dcsp-7 qerr: .word nest .word swap .word zbrch .word .+8 .word error .word brch .word .+4 .word drop .word semis .byte ^x85 ; ?comp .ascii /?COM/ .byte ^xD0 .word qerr-9 qcmp: .word nest .word stt .word at .word zeqal .word lit .word ^x11 .word qerr .word semis .byte ^x85 ; ?exec .ascii /?EXE/ .byte ^xC3 .word qcmp-8 exc: .word nest .word stt .word at .word lit .word ^x12 .word qerr .word semis .byte ^x86 ; ?pairs .ascii /?PAIR/ .byte ^xD3 .word exc-8 qpr: .word nest .word mins .word lit .word ^x13 .word qerr .word semis .byte ^x84 ; ?csp .ascii /?CS/ .byte ^xD0 .word qpr-9 qcsp: .word nest .word fspat .word csp .word at .word mins .word lit .word ^x14 .word qerr .word semis .byte ^x88 ; ?loading .ascii /?LOADIN/ .byte ^xC7 .word qcsp-7 qldg: .word nest .word blk .word at .word zeqal .word lit .word ^x14 .word qerr .word semis .byte ^x87 ; compile .ascii /COMPIL/ .byte ^xC5 .word qldg-11 cmpl: .word nest .word qcmp .word rg .word dup .word plus2 .word gr .word at .word comma .word semis .byte ^xC1 ; [ .byte ^xDB .word cmpl-10 lb: .word nest .word zero .word stt .word ex .word semis .byte ^x81 ; ] .byte ^xDD .word lb-4 rb: .word nest .word lit .word ^xC0 .word stt .word ex .word semis .byte ^x86 ; smudge .ascii /SMUDG/ .byte ^xC5 .word rb-4 smdg: .word nest .word ltst .word lit .word ^x20 .word tgle .word semis .byte ^x83 ; hex .ascii /HE/ .byte ^xD8 .word smdg-9 mhex: .word nest .word lit .word ^x10 .word base .word ex .word semis .byte ^x87 ; decimal .ascii /DECIMA/ .byte ^xCC .word mhex-6 mdcml: .word nest .word lit .word ^x0A .word base .word ex .word semis .byte ^x87 ; (;code) .ascii /(;CODE/ .byte ^xA9 .word mdcml-10 pcode: .word nest .word rg .word ltst .word pfa .word cfa .word ex .word semis .byte ^xC5 ; ;code .ascii /;COD/ .byte ^xC5 .word pcode-10 code: .word nest .word qcsp .word cmpl .word pcode .word lb .word smdg .word semis .byte ^x85 ; count .ascii /COUN/ .byte ^xD4 .word code-8 cnt: .word nest .word dup .word plus1 .word swap .word cat .word semis .byte ^x84 ; type .ascii /TYP/ .byte ^xC5 .word cnt-8 type: .word nest .word mdup .word zbrch .word .+24 .word over .word plus .word swap .word pdo typ1: .word r .word cat .word emit .word lupe .word typ1 .word brch .word .+4 .word drop .word semis .byte ^x89 ; -trailing .ascii /-TRAILIN/ .byte ^xC7 .word type-7 trlg: .word nest .word dup .word zero .word pdo trl1: .word over .word over .word plus .word one .word mins .word cat .word bl .word mins .word zbrch .word .+8 .word lve .word brch .word .+6 .word one .word mins .word lupe .word trl1 .word semis .byte ^x84 ; (.") .ascii /(."/ .byte ^xA9 .word trlg-12 pdq: .word nest .word r .word cnt .word dup .word plus1 .word rg .word plus .word gr .word type .word semis .byte ^x86 ; expect .ascii /EXPEC/ .byte ^xD4 .word pdq-7 expt: .word nest .word over .word plus .word over .word pdo expt4: .word key .word dup .word lit .word ^x0E .word porgn .word at .word eql .word zbrch .word expt1 .word drop .word lit .word 8 .word over .word r .word eql .word dup .word rg .word two .word mins .word plus .word gr .word mins .word emit .word lit .word ^x20 .word emit .word lit .word ^x08 .word brch .word expt2 expt1: .word dup .word lit .word ^x0D .word eql .word zbrch .word expt3 .word lve .word drop .word bl .word zero .word brch .word expt5 expt3: .word dup expt5: .word r .word cex .word zero .word r .word plus1 .word ex expt2: .word emit .word lupe .word expt4 .word drop .word semis .byte ^x85 ; query .ascii /QUER/ .byte ^xD9 .word expt-9 quer: .word nest .word tib .word at .word lit .word ^x50 .word expt .word zero .word fin .word ex .word semis .byte ^xC1 ; null .byte ^x80 .word quer-8 x: .word nest .word blk .word at .word zbrch .word x2 .word one .word blk .word pluss .word zero .word fin .word ex .word blk .word at .word lit .word 7 .word fand .word zeqal .word zbrch .word x1 .word exc .word rg .word drop x1: .word brch .word xend x2: .word rg .word drop xend: .word semis .byte ^x84 ; fill .ascii /FIL/ .byte ^xCC .word x-4 fill: .word nest .word swap .word gr .word over .word cex .word dup .word plus1 .word rg .word one .word mins .word cmove .word semis .byte ^x85 ; erase .ascii /ERAS/ .byte ^xC5 .word fill-7 ers: .word nest .word zero .word fill .word semis .byte ^x86 ; blanks .ascii /BLANK/ .byte ^xD3 .word ers-8 blnk: .word nest .word bl .word fill .word semis .byte ^x84 ; hold .ascii /HOL/ .byte ^xC4 .word blnk-9 hold: .word nest .word lit .word ^xFFFF .word hld .word pluss .word hld .word at .word cex .word semis .byte ^x83 ; pad .ascii /PA/ .byte ^xC4 .word hold-7 pad: .word nest .word here .word lit .word ^x44 .word plus .word semis .byte ^x84 ; word .ascii /WOR/ .byte ^xC4 .word pad-6 word: .word nest .word blk .word at .word zbrch .word wd1 .word blk .word at .word block .word brch .word wd2 wd1: .word tib .word at wd2: .word fin .word at .word plus .word swap .word encl .word here .word lit .word ^x22 .word blnk .word fin .word pluss .word over .word mins .word gr .word r .word here .word cex .word plus .word here .word plus1 .word rg .word cmove .word semis .byte ^x88 ; (number) .ascii /(NUMBER/ .byte ^xA9 .word word-7 pnmbr: .word nest .word plus1 .word dup .word gr .word cat .word base .word at .word dgt .word zbrch .word pnm2 .word swap .word base .word at .word ustar .word drop .word rot .word base .word at .word ustar .word dplus .word dpl .word at .word plus1 .word zbrch .word pnm1 .word one .word dpl .word pluss pnm1: .word rg .word brch .word pnmbr+2 pnm2: .word rg .word semis .byte ^x86 ; number .ascii /NUMBE/ .byte ^xD2 .word pnmbr-11 nmbr: .word nest .word zero .word zero .word rot .word dup .word plus1 .word cat .word lit .word ^x2D .word eql .word dup .word gr .word plus .word lit .word ^xFFFF nmb1: .word dpl .word ex .word pnmbr .word dup .word cat .word bl .word mins .word zbrch .word nmb2 .word dup .word cat .word lit .word ^x2E .word mins .word zero .word qerr .word zero .word brch .word nmb1 nmb2: .word drop .word rg .word zbrch .word nmb3 .word dmin nmb3: .word semis .byte ^x85 ; -find .ascii /-FIN/ .byte ^xC4 .word nmbr-9 mfind: .word nest .word bl .word word .word here .word cntx .word at .word at .word find .word dup .word zeqal .word zbrch .word mf1 .word drop .word here .word ltst .word find mf1: .word semis .byte ^x87 ; (abort) .ascii /(ABORT/ .byte ^xA9 .word mfind-8 pabrt: .word nest .word abort .word semis .byte ^x85 ; error .ascii /ERRO/ .byte ^xD2 .word pabrt-10 error: .word nest .word wrng .word at .word zless .word zbrch .word err1 .word pabrt err1: .word here .word cnt .word type .word pdq .byte ^x03 .ascii / ?/ .word msg .word sp1 .word fin .word at .word blk .word at .word quit .word semis .byte ^x83 ; min .ascii /MI/ .byte ^xCE .word error-8 min: .word nest .word over .word over .word gtr .word zbrch .word mn1 .word swap mn1: .word drop .word semis .byte ^x83 ; id. .ascii /ID/ .byte ^xAE .word min-6 id: .word nest .word pad .word lit .word ^x20 .word lit .word ^x5F .word fill .word dup .word pfa .word lfa .word over .word mins .word pad .word swap .word cmove .word pad .word cnt .word lit .word ^x1F .word fand .word type .word spc .word semis .byte ^x86 ; create .ascii /CREAT/ .byte ^xC5 .word id-6 crte: .word nest .word fspat .word here .word lit .word ^xA0 .word plus .word less .word two .word qerr .word mfind .word zbrch .word crt1 .word drop .word nfa .word id .word lit .word 4 .word msg .word spc crt1: .word here .word dup .word cat .word width .word at .word min .word plus1 .word allot .word dup .word lit .word ^xA0 .word tgle .word here .word one .word mins .word lit .word ^x80 .word tgle .word ltst .word comma .word crnt .word at .word ex .word here .word plus2 .word comma .word semis .byte ^xC1 ; : .byte ^xBA .word crte-9 colon: .word nest .word exc .word dcsp .word crnt .word at .word cntx .word ex .word crte .word rb .word lit .word ^xFFFE .word dp .word pluss .word cmpl .word nest .word semis .byte ^x85 ; !code .ascii /!COD/ .byte ^xC5 .word colon-4 dcode: .word nest .word crte .word smdg .word ltst .word pfa .word cfa .word ex .word comma .word semis .byte ^x88 ; constant .ascii /CONSTAN/ .byte ^xD4 .word dcode-8 cnst: .word nest .word lit .word const .word dcode .word semis .byte ^x88 ; variable .ascii /VARIABL/ .byte ^xC5 .word cnst-11 varb: .word nest .word lit .word var .word dcode .word semis .byte ^x84 ; user .ascii /USE/ .byte ^xD2 .word varb-11 usr: .word nest .word lit .word user .word dcode .word semis .byte ^x87 ; .ascii /DOES/ .byte ^xBE .word lbld-10 doesg: .word nest .word rg .word ltst .word pfa .word ex .word pcode duz1: movw r6,-(r8) movw (r7)+,r6 addw #2,r9 movw r7,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^xC7 ; literal .ascii /LITERA/ .byte ^xCC .word doesg-8 ltl: .word nest .word stt .word at .word zbrch .word lt1 .word cmpl .word lit .word comma lt1: .word semis .byte ^xC8 ; dliteral .ascii /DLITERA/ .byte ^xCC .word ltl-10 dltl: .word nest .word stt .word at .word zbrch .word dltl1 .word swap .word ltl .word ltl dltl1: .word semis .byte ^x86 ; ?stack .ascii /?STAC/ .byte ^xCB .word dltl-11 qstk: .word nest .word so .word at .word dup .word fspat .word gtr .word one .word qerr .word lit .word ^x100 .word plus .word fspat .word less .word lit .word 7 .word qerr .word semis .byte ^x89 ; interpret .ascii /INTERPRE/ .byte ^xD4 .word qstk-9 inpt: .word nest .word mfind .word zbrch .word pt1 .word stt .word at .word less .word zbrch .word pt2 .word cfa .word comma .word brch .word pt3 pt2: .word cfa .word exe pt3: .word qstk .word brch .word pt4 pt1: .word here .word nmbr .word dpl .word at .word plus1 .word zbrch .word pt5 .word dltl .word brch .word pt6 pt5: .word drop .word ltl pt6: .word qstk pt4: .word brch .word inpt+2 .word semis .byte ^x8A ; vocabulary .ascii /VOCABULAR/ .byte ^xD9 .word inpt-12 vbly: .word nest .word lbld .word lit .word ^x81A0 .word comma .word crnt .word at .word cfa .word comma .word here .word vl .word at .word comma .word vl .word ex .word doesg vb1: .word plus2 .word cntx .word ex .word semis frth: .byte ^xC5 ; forth .ascii /FORT/ .byte ^xC8 .word vbly-13 .word duz1 .word vb1 .word ^x81A0 .word task-7 .word 0 .byte ^x8B ; definitions .ascii /DEFINITION/ .byte ^xD3 .word frth dfn: .word nest .word cntx .word at .word crnt .word ex .word semis .byte ^x84 ; quit .ascii /QUI/ .byte ^xD4 .word dfn-14 quit: .word nest .word zero .word blk .word ex .word lb q2: .word rp1 .word cr .word quer .word inpt .word stt .word at .word zeqal .word zbrch .word q1 .word pdq .byte ^x04 .ascii / OK/ q1: .word brch .word q2 .word semis .byte ^x85 ; abort .ascii /ABOR/ .byte ^xD4 .word quit-7 abort: .word nest .word sp1 .word mdcml .word cr .word lit .word ^x15 .word spacs .word pdq .ascic /VAX-11 fig-Forth Version 1.0/ .word drzer .word mtbuf .word first .word dup .word prev .word ex .word use .word ex .word frth+8 .word dfn .word quit .word semis .byte ^xC1 ; ; .byte ^xBB .word abort-8 semic: .word nest .word qcsp .word cmpl .word semis .word smdg .word lb .word semis .byte ^xc2 ; ." .ascii /./ .byte ^xA2 .word semic-4 dotq: .word nest .word lit .word ^x22 .word stt .word at .word zbrch .word dotq1 .word cmpl .word pdq .word word .word here .word cat .word plus1 .word allot .word brch .word dotq2 dotq1: .word word .word here .word cnt .word type dotq2: .word semis .byte ^xC9 ; [compile] .ascii /[COMPILE/ .byte ^xDD .word dotq-5 bcomp: .word nest .word mfind .word zeqal .word zero .word qerr .word drop .word cfa .word comma .word semis .byte ^x89 .ascii /IMMEDIAT/ .byte ^xC5 .word bcomp-12 immed: .word nest .word ltst .word lit .word ^x40 .word tgle .word semis .byte ^xC1 ; ( .byte ^xA8 .word immed-12 paren: .word nest .word lit .word ^x29 .word word .word semis .byte ^x81 ; 3 .byte ^xB3 .word paren-4 three: .word const .word 3 .byte ^xC1 ; ' .byte ^xA7 .word three-4 tick: .word nest .word mfind .word zeqal .word zero .word qerr .word drop .word ltl .word semis .byte ^x86 ; forget .ascii /FORGE/ .byte ^xD4 .word tick-4 forg: .word nest .word crnt .word at .word cntx .word at .word mins .word lit .word ^x18 .word qerr .word tick .word dup .word fnce .word at .word less .word lit .word ^x15 .word qerr .word dup .word nfa .word dp .word ex .word lfa .word at .word cntx .word at .word ex .word semis .byte ^x82 ; +- .ascii /+/ .byte ^xAD .word forg-9 pm: .word nest .word zless .word zbrch .word pm1 .word minus pm1: .word semis .byte ^x83 ; d+- .ascii /D+/ .byte ^xAD .word pm-5 dpm: .word nest .word zless .word zbrch .word dpm1 .word dmin dpm1: .word semis .byte ^x83 ; abs .ascii /AB/ .byte ^xD3 .word dpm-6 abs: .word nest .word dup .word pm .word semis .byte ^x84 ; dabs .ascii /DAB/ .byte ^xD3 .word abs-6 dabs: .word nest .word dup .word dpm .word semis .byte ^x82 ; d- .ascii /D/ .byte ^xAD .word dabs-7 dmins: .word nest .word dmin .word dplus .word semis .byte ^x82 ; d@ .ascii /D/ .byte ^xC0 .word dmins-5 dat: .word nest .word dup .word lit .word ^x02 .word plus .word at .word swap .word at .word semis .byte ^x82 ; d! .ascii /D/ .byte ^xA1 .word dat-5 dex: .word nest .word dup .word rot .word swap .word ex .word lit .word ^x02 .word plus .word ex .word semis .byte ^x84 ; 2dup .ascii /2DU/ .byte ^xD0 .word dex-5 ddup: .word nest .word over .word over .word semis .byte ^x85 ; 2drop .ascii /2DRO/ .byte ^xD0 .word ddup-7 ddrop: .word nest .word drop .word drop .word semis .byte ^x85 ; 2swap .ascii /2SWA/ .byte ^xD0 .word ddrop-8 dswap: .word nest .word rot .word gr .word rot .word rg .word semis .byte ^x85 ; 2over .ascii /2OVE/ .byte ^xD2 .word dswap-8 dover: .word nest .word dswap .word ddup .word gr .word gr .word dswap .word rg .word rg .word semis .byte ^x82 ; d* .ascii /D/ .byte ^xAA .word dover-8 dstar: .word nest .word dup .word rot .word star .word rot .word rot .word ustar .word rot .word plus .word semis .byte ^x82 ; d/ .ascii /D/ .byte ^xAF .word dstar-5 dslas: .word nest .word swap .word over .word slmod .word over .word dup .word zless .word zbrch .word dsl1 .word plus .word brch .word dsl2 dsl1: .word drop dsl2: .word gr .word swap .word mslas .word swap .word drop .word rg .word semis .byte ^x85 ; d/mod .ascii \D/MO\ .byte ^xC4 .word dslas-5 dsmod: .word nest .word uslsh .word semis .byte ^x83 ; max .ascii /MA/ .byte ^xD8 .word dsmod-8 max: .word nest .word over .word over .word less .word zbrch .word max1 .word swap max1: .word drop .word semis .byte ^x82 ; m+ .ascii /M/ .byte ^xAB .word max-6 mplus: .word nest .word stod .word dplus .word semis .byte ^x82 ; m* .ascii /M/ .byte ^xAA .word mplus-5 mstar: .word nest .word over .word over .word fxor .word gr .word abs .word swap .word abs .word ustar .word rg .word dpm .word semis .byte ^x82 ; m/ .ascii /M/ .byte ^xAF .word mstar-5 mslas: .word nest .word over .word gr .word gr .word dabs .word r .word abs .word uslsh .word rg .word r .word fxor .word pm .word swap .word rg .word pm .word swap .word semis .byte ^x81 ; * .byte ^xAA .word mslas-5 star: .word nest .word mstar .word drop .word semis .byte ^x84 ; /MOD .ascii \/MO\ .byte ^xC4 .word star-4 slmod: .word slmod+2 clrl r11 cvtwl (r9),r4 tstw -(r9) bgeq slmod1 movl #^xFFFFFFFF,r11 slmod1: cvtwl (r9),r10 ediv r4,r10,r10,r4 movw r4,(r9)+ movw r10,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x81 ; / .byte ^xAF .word slmod-7 slash: .word slash+2 divw (r9),-(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x83 ; mod .ascii /MO/ .byte ^xC4 .word slash-4 modd: .word nest .word slmod .word drop .word semis .byte ^x85 ; */mod .ascii \*/MO\ .byte ^xC4 .word modd-6 ssmod: .word nest .word gr .word mstar .word rg .word mslas .word semis .byte ^x82 ; */ .ascii /*/ .byte ^xAF .word ssmod-8 ssla: .word nest .word ssmod .word swap .word drop .word semis .byte ^x85 ; m/mod .ascii \M/MO\ .byte ^xC4 .word ssla-5 msmod: .word nest .word gr .word zero .word r .word uslsh .word rg .word swap .word gr .word uslsh .word rg .word semis .byte ^x83 ; mon .ascii /MO/ .byte ^xCE .word msmod-8 mon: .word mon+2 movl #SS$_NORMAL,r0 ret .byte ^x83 ; bye .ascii /BY/ .byte ^xC5 .word mon-6 bye: .word nest .word cr .word flush .word mon .word semis .byte ^x84 ; back .ascii /BAC/ .byte ^xCB .word bye-6 back: .word nest .word comma .word semis .byte ^xC5 ; begin .ascii /BEGI/ .byte ^xCE .word back-7 begin: .word nest .word qcmp .word here .word one .word semis .byte ^xC5 ; endif .ascii /ENDI/ .byte ^xC6 .word begin-8 endiff: .word nest .word qcmp .word two .word qpr .word here .word swap .word ex .word semis .byte ^xC4 ; then .ascii /THE/ .byte ^xCE .word endiff-8 then: .word nest .word endiff .word semis .byte ^xC2 ; do .ascii /D/ .byte ^xCF .word then-7 do: .word nest .word cmpl .word pdo .word here .word three .word semis .byte ^xC4 ; loop .ascii /LOO/ .byte ^xD0 .word do-5 loop: .word nest .word three .word qpr .word cmpl .word lupe .word back .word semis .byte ^xC5 ; +loop .ascii /+LOO/ .byte ^xD0 .word loop-7 ploop: .word nest .word three .word qpr .word cmpl .word plupe .word back .word semis .byte ^xC5 ; until .ascii /UNTI/ .byte ^xCC .word ploop-8 until: .word nest .word one .word qpr .word cmpl .word zbrch .word back .word semis .byte ^xC3 ; end .ascii /EN/ .byte ^xC4 .word until-8 endd: .word nest .word until .word semis .byte ^xC5 ; again .ascii /AGAI/ .byte ^xCE .word endd-6 again: .word nest .word one .word qpr .word cmpl .word brch .word back .word semis .byte ^xC6 ; repeat .ascii /REPEA/ .byte ^xD4 .word again-8 repea: .word nest .word gr .word gr .word again .word rg .word rg .word two .word mins .word endiff .word semis .byte ^xC2 ; if .ascii /I/ .byte ^xC6 .word repea-9 iff: .word nest .word cmpl .word zbrch .word here .word zero .word comma .word two .word semis .byte ^xC4 ; else .ascii /ELS/ .byte ^xC5 .word iff-5 elsee: .word nest .word two .word qpr .word cmpl .word brch .word here .word zero .word comma .word swap .word two .word endiff .word two .word semis .byte ^xC5 ; while .ascii /WHIL/ .byte ^xC5 .word elsee-7 while: .word nest .word iff .word plus2 .word semis .byte ^x86 ; spaces .ascii /SPACE/ .byte ^xD3 .word while-8 spacs: .word nest .word zero .word max .word mdup .word zbrch .word spax1 .word zero .word pdo spax2: .word spc .word lupe .word spax2 spax1: .word semis .byte ^x82 ; <# .byte ^x3C .byte ^xA3 .word spacs-9 bdigs: .word nest .word pad .word hld .word ex .word semis .byte ^x82 ; #> .byte ^x23 .byte ^xBE .word bdigs-5 edigs: .word nest .word drop .word drop .word hld .word at .word pad .word over .word mins .word semis .byte ^x84 ; sign .ascii /SIG/ .byte ^xCE .word edigs-5 sign: .word nest .word rot .word zless .word zbrch .word sign1 .word lit .word ^x2D .word hold sign1: .word semis .byte ^x81 ; # .byte ^xA3 .word sign-7 dig: .word nest .word base .word at .word msmod .word rot .word lit .word 9 .word over .word less .word zbrch .word dig1 .word lit .word 7 .word plus dig1: .word lit .word ^x30 .word plus .word hold .word semis .byte ^x82 ; #s .ascii /#/ .byte ^xD3 .word dig-4 digs: .word nest digs1: .word dig .word over .word over .word ffor .word zeqal .word zbrch .word digs1 .word semis .byte ^x83 ; d.r .ascii /D./ .byte ^xD2 .word digs-5 ddotr: .word nest .word gr .word swap .word over .word dabs .word bdigs .word digs .word sign .word edigs .word rg .word over .word mins .word spacs .word type .word semis .byte ^x82 ; .r .byte ^x2E .byte ^xD2 .word ddotr-6 dotr: .word nest .word gr .word stod .word rg .word ddotr .word semis .byte ^x82 ; d. .byte ^x44 .byte ^xAE .word dotr-5 ddot: .word nest .word zero .word ddotr .word spc .word semis .byte ^x81 ; . .byte ^xAE .word ddot-5 dot: .word nest .word stod .word ddot .word semis .byte ^x81 ; ? .byte ^xBF .word dot-4 ques: .word nest .word at .word dot .word semis .byte ^x82 ; u. .byte ^x55 .byte ^xAE .word ques-4 udot: .word nest .word zero .word ddot .word semis .byte ^x85 ; vlist .ascii /VLIS/ .byte ^xD4 .word udot-5 vlist: .word nest .word cr .word lit .word ^x80 .word fout .word ex .word cntx .word at .word at vlis1: .word fout .word at .word lit .word ^x45 .word gtr .word zbrch .word vlis2 .word cr .word zero .word fout .word ex vlis2: .word dup .word id .word spc .word spc .word pfa .word lfa .word at .word dup .word zeqal .word qterm .word ffor .word zbrch .word vlis1 .word drop .word semis .byte ^x87 ; message .ascii /MESSAG/ .byte ^xC5 .word vlist-8 msg: .word nest .word wrng .word at .word zbrch .word mess1 .word mdup .word zbrch .word mess2 .word lit .word 4 .word ofst .word at .word bscr .word slash .word mins .word dline .word spc mess2: .word brch .word mess3 mess1: .word pdq .byte ^x07 .ascii / MSG # / .word dot mess3: .word semis .byte ^x81 ; i .byte ^xC9 .word msg-10 i: .word i+2 addw #2,r9 movw (r8),(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x84 ; warm .ascii /WAR/ .byte ^xCD .word i-4 wrm: .word wrm+2 jmp warm .byte ^x84 ; cold .ascii /COL/ .byte ^xC4 .word wrm-7 cld: .word cld+2 jmp cold .byte ^x84 ; s->d .ascii /S->/ .byte ^xC4 .word cld-7 stod: .word stod+2 bitw #^x8000,(r9)+ beqlu sskp sneg: movw #^xFFFF,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) sskp: movw #0,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x86 ; (line) .ascii /(LINE/ .byte ^xA9 .word stod-7 pline: .word nest .word gr .word lit .word ^x40 .word bbuf .word ssmod .word rg .word bscr .word star .word plus .word block .word plus .word lit .word ^x40 .word semis .byte ^x85 ; .line .ascii /.LIN/ .byte ^xC5 .word pline-9 dline: .word nest .word pline .word trlg .word type .word semis .byte ^x83 ; use .ascii /US/ .byte ^xC5 .word dline-8 use: .word var .word firstb .byte ^x84 ; prev .ascii /PRE/ .byte ^xD6 .word use-6 prev: .word var .word firstb .byte ^x84 ; +buf .ascii /+BU/ .byte ^xC6 .word prev-7 pbuf: .word nest .word bbuf .word lit .word 4 .word plus .word plus .word dup .word limit .word eql .word zbrch .word pbuf1 .word drop .word first pbuf1: .word dup .word prev .word at .word mins .word semis .byte ^x86 ; update .ascii /UPDAT/ .byte ^xC5 .word pbuf-7 updat: .word nest .word prev .word at .word at .word lit .word ^x8000 .word ffor .word prev .word at .word ex .word semis .byte ^x8D ; empty-buffers .ascii /EMPTY-BUFFER/ .byte ^xD3 .word updat-9 mtbuf: .word nest .word first .word limit .word over .word mins .word ers .word semis .byte ^x86 ; buffer .ascii /BUFFE/ .byte ^xD2 .word mtbuf-16 buffe: .word nest .word use .word at .word dup .word gr buff1: .word pbuf .word zbrch .word buff1 .word use .word ex .word r .word at .word zless .word zbrch .word buff2 .word r .word plus2 .word r .word at .word lit .word ^x7FFF .word fand .word zero .word rslw buff2: .word r .word ex .word r .word prev .word ex .word rg .word plus2 .word semis .byte ^x85 ; block .ascii /BLOC/ .byte ^xCB .word buffe-9 block: .word nest .word ofst .word at .word plus .word gr .word prev .word at .word dup .word at .word r .word mins .word dup .word plus .word zbrch .word bloc1 bloc2: .word pbuf .word zeqal .word zbrch .word bloc3 .word drop .word r .word buffe .word dup .word r .word one .word rslw .word two .word mins bloc3: .word dup .word at .word r .word mins .word dup .word plus .word zeqal .word zbrch .word bloc2 .word dup .word prev .word ex bloc1: .word rg .word drop .word plus2 .word semis .byte ^x83 ; r/w .ascii \R/\ .byte ^xD7 .word block-8 rslw: .word nest .word gr .word dup .word lit .word ^x7FFF .word gtr .word zbrch .word gdnews .word rg .word drop .word drop .word lit .word ^x01 .word lit .word ^x08 .word qerr .word semis gdnews: .word base .word at .word gr .word mdcml .word stod .word bdigs .word digs .word edigs .word rg .word base .word ex .word rg .word zbrch .word rslw1 .word blkrd .word brch .word rslw2 rslw1: .word blkwt rslw2: .word qerr .word semis .byte ^x0A ; block-read .ascii /BLOCK-REA/ .byte ^xC4 .word rslw-6 blkrd: .word blkrd+2 movzwl (r9),r11 movzwl -(r9),r10 pushr #^m movc3 r11,(r10),begadr movc3 #4,fthadr,begadr(r11) popr #^m moval fab_rblock,r0 addw #^x0D,r11 movb r11,FAB$B_FNS(r0) moval rab_rblock,r0 movzwl -(r9),RAB$L_UBF(r0) $open fab=fab_rblock blbc r0,badnews $connect rab=rab_rblock blbc r0,badnews1 $get rab=rab_rblock blbc r0,badnews2 $close fab=fab_rblock clrw (r9)+ clrw (r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) badnews: movw #1,(r9)+ movw #8,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) badnews1: movw #1,(r9)+ movw #9,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) badnews2: movw #1,(r9)+ movw #^x0A,(r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x0B ; block-write .ascii /BLOCK-WRIT/ .byte ^xC5 .word blkrd-13 blkwt: .word blkwt+2 movzwl (r9),r11 movzwl -(r9),r10 pushr #^m movc3 r11,(r10),begadr movc3 #4,fthadr,begadr(r11) popr #^m moval fab_wblock,r0 addw #^x0D,r11 movb r11,FAB$B_FNS(r0) moval rab_wblock,r0 movzwl -(r9),RAB$L_RBF(r0) $create fab=fab_wblock $connect rab=rab_wblock $put rab=rab_wblock $close fab=fab_wblock clrw (r9)+ clrw (r9) movw (r6)+,r7 movzwl (r7)+,r11 jmp (r11) .byte ^x84 ; load .ascii /LOA/ .byte ^xC4 .word blkwt-14 load: .word nest .word blk .word at .word gr .word fin .word at .word gr .word zero .word fin .word ex .word bscr .word star .word blk .word ex .word inpt .word rg .word fin .word ex .word rg .word blk .word ex .word semis .byte ^xC3 ; --> .ascii /--/ .byte ^xBE .word load-7 arrow: .word nest .word qldg .word zero .word fin .word ex .word bscr .word blk .word at .word over .word modd .word mins .word blk .word pluss .word semis .byte ^x83 ; dr0 .ascii /DR/ .byte ^xB0 .word arrow-6 drzer: .word nest .word zero .word ofst .word ex .word semis .byte ^x83 ; dr1 .ascii /DR/ .byte ^xB1 .word drzer-6 drone: .word nest .word bscr .word lit .word ^xFA .word star .word ofst .word ex .word semis .byte ^x84 ; list .ascii /LIS/ .byte ^xD4 .word drone-6 list: .word nest .word mdcml .word cr .word dup .word fscr .word ex .word pdq .ascic /SCR # / .word dot .word lit .word ^x10 .word zero .word pdo list1: .word cr .word i .word lit .word 3 .word dotr .word spc .word i .word fscr .word at .word dline .word qterm .word zbrch .word list2 .word lve list2: .word lupe .word list1 .word cr .word semis .byte ^x85 ; index .ascii /INDE/ .byte ^xD8 .word list-7 index: .word nest .word cr .word plus1 .word swap .word pdo inde1: .word cr .word i .word lit .word 3 .word dotr .word spc .word zero .word i .word dline .word qterm .word zbrch .word inde2 .word lve inde2: .word lupe .word inde1 .word semis .byte ^x85 ; triad .ascii /TRIA/ .byte ^xC4 .word index-8 triad: .word nest .word cr .word lit .word 3 .word slash .word lit .word 3 .word star .word lit .word 3 .word over .word plus .word swap .word pdo tria1: .word cr .word i .word list .word qterm .word zbrch .word tria2 .word lve tria2: .word lupe .word tria1 .word cr .word lit .word ^x0F .word msg .word cr .word semis .byte ^x85 ; flush .ascii /FLUS/ .byte ^xC8 .word triad-8 flush: .word nest .word limit .word first .word mins .word bbuf .word lit .word 4 .word plus .word slash .word zero .word pdo fl1: .word lit .word ^x7FFF .word buffe .word drop .word lupe .word fl1 .word semis .byte ^x84 ; task .ascii /TAS/ .byte ^xCB .word flush-8 task: .word nest .word semis fend: . = ^xF000 .end forth