[RECCOM.REC] [CNVRT compiler for REC] [a version which compiles "assembler" code] [Harold V. McIntosh, 28 April 1982] [Harold V. McIntosh, 2 June 1983] [Harold V. McIntosh, 28 December 1983] [[]] { { [find/make FCB] (Jj'TTY:'EQZD;(':'UQD':'ED\64-%;0%;) ('.'U<(8a;@b;)Q|D>;Z'.DAT'IJj:) '.'FJDZ(3a;@b;)Q|JZDI 32(dpGm$r0=npGpGd0&$Sm@znpGQ&$rrS0; r12wQmwnEn;n:)D;) f [blank fill by count] (Zz(d' 'I:;)JZ;) b [zero fill] (cmpw0%(f:;)w;) 0 [zero FCB & buffer] ($m33@0130@0nn&0||pLnS;) z [set default input file] (0,30$S'5C'H12wA' 'Ew4@0n0|0|pL31$S 'TTY:'31$rrS; B9aQD(3a' 'E 'DAT';Q;)|mw31@zn31$rrS31@r;) i [open for read] (@hr15K(255='NO FILE'I;L;)L;) r [open for write] (@hpGpG4+1&SrpG19k22k^^r128&S;) w [set DMA address] ($rpG^^r^^26k;) h [open] (m@f0=n@@;nLL;) O [read] (''(AL@f(0=pG@r;'TTY:'(='T');)) ('T'='';L31pG$rr12w'TTY:'Ew;w) L@&'> 'TL(@#I;:); $r(pG^^rpGmr(0=(npGpGm128&S^^26kpGr 20K0=L;LL1npGpGm129+26%&SS;)npGmr;;) pG130&-n+&dm(u13%=;10%(=)pGI(26%=; L);ndm:)L^^rn&S;LpG^^r0&S:);) R [write] (Jj'='U<(A@f'TTY:'(=)(0=pG@w;;))>'='ED ZqtD; >'='EDZ<@g;) W [write to disk] ($r(pG^^rpGpGmrpGm- 130+n&maQD>ZnSnSL;);) g [close all files] (31pGm($r0=;pG4+r(0=L;LJj26%I;J>);nLA:0&$SL>)>LL;) > [body of variable search] (pG$r(0=)yGEz@=L;pG$r(0=;LL) Z<((jJQmpGl&$S zZ<@=>;J>);nLA:0&$S>)>L;) < [insert variable] ($ryGI;) [ [individual cases] {(0@( 1@( {(0@: 1@: ;); ( @;(J2573TL'A:'TLZqtj()JZD;); @;(J(A)JZD;); [space, <,>] @;(J [or] Z<(' 'Ez; J','Ez;>)> [or] 0@]JZD0@[;): [number] @;(J [and] Z<(@c jJ><0@](A);>)> [and] 1@]JZD'/call NU/db 'I39%I0@[39%Iz<1@[@AZ>;); [quote] @;(J [and] Z<( [or] Z<(@e; J@f;>)> [or] jJ><0@](A);>)> [and] 1@]JZD'/call QU/db 'I0@[z<1@[@AZ>;); [arroba] @;(J'@'Ez [and] Z<(1(a;L)z jJ><0@](A);>)> [and] 1@]JZD'/call AR/db 'I39%I0@[39%Iz<1@[@AZ>;); [comment] @;(J@d0@]JZD0@[;): [operator] @;(J [and] Z<(@o jJ><0@](A);>)> [and] 1@]JZD'/call op$'I0@[z<1@[@AZ>;); [predicate] @;(J [and] Z<(@p jJ><0@](A);>)> [and] 1@]JZD'/call pr$'I0@['/jmp #'Iz<1@[@AZ>;); [colon] @;(J':'Ez1@]JZD'/jmp %/#:'Iz<1@[@AZ>;); [semicolon] @;(J';'Ez1@]JZD'/jmp $/#:'Iz<1@[@AZ>;); [parenthesis] @;(J [and] Z<(@i jJ><'('Ez {[vbl] (')'Ez(A);) = (0@<;)}[vbl] (A);>)> [and] 1@]JZD'/%:'Iz<0@[@AZ>'/jmp ##/$:/#:'Iz<1@[@AZ>;); [brace] @;(J [and] Z<(@j jJ><'{'Ez {[vbl] ('}'Ez;) = ('}'0@>;)}[vbl] (A);>)> [and] 1@]JZD'/call main/jmp #/jmp $'Iz<'[]'I0@[@BZ>z<1@[@AZ>'/$:'I;); [more source] @;(J0@]JZD0@[z@CZ>;): ;)} 0@) 1@) nn$S nn$S;)} A [string of definitions inside braces] {(0@( 1@( 2@( 3@( {(0@: 1@: 2@: 3@: ;); ( @;(J2573TL'B:'TLZqtj()JZD;); [main] @;(J'['Ez {[vbl] (']'Ez [and] Z<( [or] Z<(@i; J@j;>)> [or] jJ><1@](A);>)> [and] ' 'Ez [and] Z<(@a jJ><2@](A);>)> [and] ' 'Ez3@];) = (']'0@>;)}[vbl] JZD'/'I2@[':'Iz<1@[@AZ>z<@EZ>z<'['I0@[z<2@[@pZ>']'I3@[@BZ>z<2@[@qZ>;); [subroutines] @;(J'['Ez {[vbl] (']'Ez [and] Z<( [or] Z<(@i; J@j;>)> [or] jJ><1@](A);>)> [and] ;) = (']'0@>;)}[vbl] JZD'/pprg:'Iz<1@[@AZ>z<@EZ>'/main:'I0@['/call pprg'Iz<@rZ>;); ;)} 0@) 1@) 2@) 3@) nn$S nn$S nn$S nn$S;)} B [exclude the portion of a file following ^Z] {(0@( {(0@: ;); (@;(J {[vbl] (26%Ez;) = (0@<;)}[vbl] JZD0@[;);;)} 0@) nn$S;)} C [push macro] {(0@( {(0@: ;); (@;(J0@]JZD'/lhld t$'I0@['/xthl/push h/lxi h,'I0@[':/shld t$'I0@[;);;)} 0@) nn$S;)} p [pop macro] {(0@( {(0@: ;); (@;(J0@]JZD'/pop h/xthl/shld t$'I0@[;);;)} 0@) nn$S;)} q [macro to transfer skip to stack] {(((JJZD'/jmp $$/xthl/inx h/inx h/inx h/xthl/$$:'I;);;) ;)} r [main program] { [alfanum] ( [and] Z<(1(a;L)z jJ><' ''~'Mz(A);>)> [and] ;) a [numeric] ( [and] Z<(1(a;L)z jJ><'0''9'Mz(A);>)> [and] ;) b [number] ( [or] Z<('-'Ez; J;>)> [or] @b([ITR] Z<@b>:J>;)[ITR] ;) c [comment] ('['Ez([ITR] Z< [or] Z<(@d; J [and] Z<(1(a;L)z jJ><[not] (Z< [or] Z<('['Ez; J']'Ez;>)> [or] J>)J>[not] Zz(A);>)> [and] ;>)> [or] >:J>;)[ITR] ']'Ez;) d [s-quote] (39%Ez([ITR] Z< [or] Z<(@e; J@f; J [and] Z<(1(a;L)z jJ><[not] (Z< [or] Z<(39%Ez; J34%Ez;>)> [or] J>)J>[not] Zz(A);>)> [and] ;>)> [or] >:J>;)[ITR] 39%Ez;) e [d-quote] (34%Ez([ITR] Z< [or] Z<(@e; J@f; J [and] Z<(1(a;L)z jJ><[not] (Z< [or] Z<(39%Ez; J34%Ez;>)> [or] J>)J>[not] Zz(A);>)> [and] ;>)> [or] >:J>;)[ITR] 34%Ez;) f ( [or] Z<(@c; J@d; J@e; J@f; J'@'Ez1(a;L)z; J@i; J@j;>)> [or] ;) g ( [and] Z<(1(a;L)z jJ><[not] (Z< [or] Z<('('Ez; J')'Ez; J'{'Ez; J'}'Ez; J'['Ez; J']'Ez; J'@'Ez; J39%Ez; J34%Ez;>)> [or] J>)J>[not] Zz(A);>)> [and] ;) h [paren] ('('Ez([ITR] Z< [or] Z<(@g; J@h;>)> [or] >:J>;)[ITR] ')'Ez;) i [brace] ('{'Ez([ITR] Z< [or] Z<(@g; J@h;>)> [or] >:J>;)[ITR] '}'Ez;) j [oper] ( [or] Z<('!'Ez; J'#'Ez; J'$'Ez; J'%'Ez; J'&'Ez; J'*'Ez; J'+'Ez; J'/'Ez; J'<'Ez; J'>'Ez; J'D'Ez; J'G'Ez; J'I'Ez; J'J'Ez; J'K'Ez; J'L'Ez; J'P'Ez; J'Q'Ez; J'R'Ez; J'S'Ez; J'T'Ez; J'W'Ez; J'X'Ez; J'Z'Ez; J'\'Ez; J'^'Ez; J'_'Ez; J'c'Ez; J'g''z'Mz; J'|'Ez; J'~'Ez;>)> [or] ;) o [pred] ( [or] Z<('='Ez; J'?'Ez; J'A'Ez; J'B'Ez; J'C'Ez; J'E'Ez; J'F'Ez; J'H'Ez; J'M'Ez; J'O'Ez; J'U'Ez; J'V'Ez; J'`'Ez; J'a'Ez; J'b'Ez; J'd'Ez; J'e'Ez; J'f'Ez;>)> [or] ;) p (z<8@['R'@%Z>;) R ('/skip/#:/ret'I;) E (0@( 8@( 9@( {(0@: 8@: 9@: ;); ( @;(J [or] Z<((A); J';'Ez;>)> [or] JZD'goodbye'I;); @;(J'='Ez {[vbl] (','Ez9@];) = (8@<;)}[vbl] JZDz<8@['r''O'@%Z>z<9@['w''O'@%Z>z<9@['='Izz<@RZ>@AZ>z<@EZ>'T'@%Z>'W'@%Z>z<'c'@%Z>;); @;(J0@]JZDzz<@EZ>'C'@%Z>z<'R'@%Z>;): ;)} 0@) 8@) 9@) nn$S nn$S nn$S;)} ~ ('i'@%'D'@%'R'@%@~JZqt'c'@%;) } [end]