.TITLE VL2 ; stored on VL2.MAC last revised: 5-Mar-84 ; The VLISP interpreter consists of 9 seperate modules written in the PDP-11 ; macro assembly language. ; The module names are: VL1, VL2, VL3, VL4, VL5, VL6, VL7, VL8, VL9 ; MODULE PAGE CONTENTS ; VL1 1 ****** conditionals and definitions ; 4 ****** macros ; VL2 9 ****** module discriptions, assembly and link instructions ; 12 ****** acknowledgments, revision history ; 15 ****** zone pile, buffers, zones de travail. ; VL3 10 ****** TRUCS SPECIAUX : STATUS, SYNONYM, MEMORY. ; 12 ****** Fonctions sur COLORIX. [JER] JUL-79 ; VL4 9 ****** eval. ; 12 ****** evaluation des subrs. ; 13 ****** evaluation des expr. ; 16 ****** evaluation des fexpr, macros, et escapes. ; 18 ****** apply perdant. ; 21 ****** autres fonctions interprete. ; 24 ****** fonctions de definition dynamiques et statiques. ; VL5 10 ****** fonctions de controle. ; 13 ****** predicats, true, false. ; 20 ****** recherches. ; 25 ****** creation d'objets. ; 30 ****** modifications d'objets. ; 34 ****** fonctions sur p-listes. ; VL6 10 ****** fonctions numeriques. ; 15 ****** fonctions flottantes. ; 18 ****** MAPC, MAP, MAPCAR, MAPLIST, MAPCONC. ; 22 ****** cons et garb. ; 26 ****** MARK ET GC. ; 29 ****** creation et valeurs de nombres. ; 31 ****** marquage des nombres, bits-tables et freres. ; 33 ****** multiplication et division: mlt, dvd. ; VL7 9 ****** initialisation de buffers : INIOTT, INIODK. ; 11 ****** read. ; 14 ****** rd1. ; 19 ****** tryat, crato, crach, givchi. ; 27 ****** getcv, getch, tabch. ; VL8 9 ****** inchb, inci. ; 12 ****** outb, outs, erreurs. ; 17 ****** prch, prspc, prstr. ; 19 ****** prnum. ; 22 ****** prflt. ; 28 ****** prast, prato, probj. ; 31 ****** print, pcrlf, prin, trfrdk. ; VL9 10 ****** FICHIERS : radx50. ; 11 ****** FICHIERS : FIC, INPUT, OUTPUT, ect. ; 17 ****** TRUCS RT-11 DEPENDANTS : TYI, TYS, TYO. ; 18 ****** initialisations start, toplevel. ; 27 ****** zones nombres, atomes, listes. ; note: each line is a seperate editor page (i.e. deliminated by form feeds) .page ; All the options that are selectable at assembly time are specified withen ; VL1x.MAC (where x is the "option specifier" - a letter between A and Z) ; ; Presently I have built 3 options sets (option specifiers A,B, and C) ; with the associated executable save files (called VLISP.A, VLISP.B, VLISP.C) ; The options selected are as follows: ; ; Option A: eis=fis=clock=recor=0, i11.04=1 ; This option set will run on any PDP-11 or LSI-11 series computer, but does ; not support floating point numbers. ; ; Option B: fis=recor=i11.04=0, eis=clock=1 ; This option set is similar to A except that the eis instruction set is ; utilized whenever possible, making it slightly smaller and faster. The ; clock option is also turned on which causes the interpreter to print out ; the elapsed time for each toplevel evaluation. Floating point numbers are ; not supported. This can be run on the following computers: ; 1.) LSI-11/23 ; 2.) LSI-11 OR LSI-11/2 with the optional EIS/FIS chip ; 3.) PDP-11/34 ; 4.) PDP-11/35 or /40 with the EIS option (KE11-E) ; ; Option C: recor=i11.04=0, fis=eis=clock=1 ; This option set is the same as B except that floating point numbers are ; supported, thus making the interpreter slightly larger. Since the fis ; instruction set is used, it can only be run on the following computers: ; 1.) LSI-11 or LSI-11/2 with the optional EIS/FIS chip ; 2.) PDP-11/35 or /40 with the EIS and FIS options (KE11-E and KE11-F) .page ; To creat a VLISP interpreter with a different set of options, edit VL1x.MAC ; to select the desired options (using a new option letter) and proceed ; as follows: ; ; .RUN MACRO ; *VL2x.OBJ,VL2x.LST/C=VL1x,VL2 ; *VL3x.OBJ,VL3x.LST/C=LISTIT,VL1x,VL3 ; *VL4x.OBJ,VL4x.LST/C=VL1x,VL4 ; *VL5x.OBJ,VL5x.LST/C=VL1x,VL5 ; *VL6x.OBJ,VL6x.LST/C=VL1x,VL6 ; *VL7x.OBJ,VL7x.LST/C=VL1x,VL7 ; *VL8x.OBJ,VL8x.LST/C=VL1x,VL8 ; *VL9x.OBJ,VL9x.LST/C=VL1x,VL9 ; ; note: the file LISTIT.MAC only contains the single line: .LIST ; thus causing VL1x.MAC to be included in the list file. ; ; ; if fis=0 was selected, link as follows: ; ; .LINK/BOTTOM:600/BOUNDRY:40/EXECUTE:VLISP.x/MAP:VLISP.MPx/PROMPT ; files? VL2x ; *VL3x ; *VL4x ; *VL5x ; *VL6x ; *VL7x ; *VL8x ; *VL9x ; *// ; boundry section? BOXNUM ; ; if fis=1 was selected, link as above except use BOUNDRY:100 ; ; to make a globl cross reference listing, type: ; ; .RUN GCREF ; *VLISP.XRx=VL2x,VL3x,VL4x/C ; *VL5x,VL6x,VL7x/C ; *VL8x,VL9x ; ; if a listing set is needed type: ; ; .PRINT VL2x,VL3x,VL4x,VL5x ; .PRINT VL6x,VL7x,VL8x,VL9x ; .PRINT VLISP.MPx,VLISP.XRx ; ; to start vlisp, using option set x, type: ; ; .RUN VLISP.x ; ****** ACKNOWLEDGMENTS ****** ; The original version of this Lisp interpreter was written by: ; Patrick R. Greussay. ; Universite Paris-8-Vincennes. ; Aout 1979. ; Some of the early changes and fixes are due to: (marked as [JER]) ; Jerome Chailloux ; Paris, France ; All fixes and enhancements starting in 1980 are due to me: ; Paul Mennen ; 756 Clara Drive ; Palo Alto, CA 94303 ; 415-856-9383 ; All of the following code which is marked by [PM] or which has English ; comments was written or modified by me, so beware. Also the VLISP programs ; supplied in this release are written by me, with the exception of the ; Debugger (Author Unknown). I am interested in any problems you encounter ; using VLISP-11. ; ****** a faire et journal de bord. ; produit et quotient particulierement merdiques. revoir ca U.D.C.J. ; ne PAS oublier les %%%%%% PROVISOIRES !!!!!!!!!!!! ; use bhis et blo & friends pour les comparaisons d'adresses. ; beaucoup de zones de travail peuvent des BYTES et non des WORDs. ; on pourrait faire de valnb et de car une macro. ; -1979- ; Aug 22 : bits-tables pour nombres. ; Aug 25 : cons semi-open. ; Aug 26 : scale accepte des arguments negatifs. ; : fonction LITATOM ; : (OUTPUT fic T) pour concatener a fic. ; Aug 30 : (ALPHALE AT1 AT2) comme le vieux SORT. ; : accepte une chaine vide. ; : 1ere page nombres: petits negatifs [-1:-15]. ; Oct 31 : flottants : from s12.mac .page ; -1980- [PM] - INDICATES CHANGED BY PAUL MENNEN ; Feb 21 : added conditional I11.04 to allow running on 11/04 ; Mar 23 : put trfrdk [pg. 41-1] under conditional assembly (RECOR) ; Mar 23 : put 4 lines in OUTPUT [pg. 43-4] under conditional assembly (RECOR) ; Mar 23 : changed MEMORY from subr2 to subr3 to allow byte writes ; Mar 23 : changed default for RMARGIN from 71 to 69 ; Mar 23 : added condition "CLOCK" so as not to assume we have one ; May 10 : changed VLAS (pg 32) to make PRINCH and OUTBUF more flexible ; May 10 : changed "rec" to "jsr pc," to cause code generation in listing ; May 10 : changed link bottom address from 1000 to 200 ; May 10 : changed + to ignore overflows, and to accumulate carry's into ; a new pre-defined atom called CARRY ; May 19 : changed MEMORY so that write operations dont also read. ; May 19 : changed French error messages to english. ; Aug 8 : changed INIOTT to clear 128 bytes instead of 80 ; (allows RMARGIN up to 127) ; Aug 8 : changed maxpn (max # of char. in pname) from 80 to 128 ; Sep 22 : major modifications to INPUT, OUTPUT, RECORD ; a.) changed INPUT from SUBR1 to FSUBR ; b.) changed OUTPUT from SUBR2 to FSUBR ; c.) allowed use of any RT11 device (was only DK) ; d.) changed OUTPUT and RECORD to use same control ; block as used by INPUT (blki) ; e.) eliminated use of UNDEF.VLI cludge for copy ; operation of OUTPUT [now use (COP)] ; ; Sep 22 : Added a new function called COP (with no arguments) ; useful for making copies of files and other uses. ; Sep 22 : Added a new function called DEL (with no arguemnts) ; provides the ability to delete files from directory ; Sep 22 : changed READLINE function - removed first instruction ; (jsr pc,teread). this fixes problem of missing ; first character. also allows readline to be used ; to read files without skipping to the next block ; for each read. preceed with (INPUT) to obtain the ; old effect when using terminal as input. ; Also changed readline to ignore carriage returns ; and use line feeds to detect end of line. ; Sep 22 : moved the disk output buffer (bfodk) so that it ; overlaps the start up code since it is not needed ; after it executes (this saves space) ; Sep 22 : Added the new function PROG (subr 2) which is the ; same as PROG1 for 2 arguments (but faster). it looks ; like this used to be called MULTIPLE but was removed ; Sep 22 : renamed "STOP" function to "S" for convenience ; Sep 22 : change initialization routine to print the file found ; message (for VLISP.INI) instead of by EOF. ; Sep 22 : numerous simple transformations to save space .page ; Dec 6 : fixed bug in INCR and DECR (didnt work with boxed numbers) ; Dec 6 : eliminated need for storage words bnum and hnum. instead ; used absolute #bnum, #hnum for the number zone boundries ; and used the linker to allign them on proper boundry ; Dec 8 : changed number page method for non fis systems (non floating point) ; The number paging for FIS systems (FIS=1) remaines identical to ; before, i.e. 1 page = 32 words = 15 numbers. For integer only ; systems it is changed to, 1 page = 16 words = 15 numbers, thus ; using only one word per integer, and the type-word is eliminated. ; Dec 8 : added a new function - MUL32 (SUBR2) to return a 32 bit product ; ; -1981- ; May 2 : split vlisp into 9 modules for ease of editing ; Jun 21 : changed many routines to make better use of EIS ; Jun 21 : rewrote elapsed time computation in toplevel to ; get 50 or 60 hertz decision from RT11 config. ; Jun 21 : fixed bug in multiply (*), didnt work with boxed numbers ; Sep 19 : fixed bug in prstr which caused traps when using very ; small values of rmargin (when lcou < 20 ) ; Sep 19 : fixed tryflo so that (EXPLODE ".") gives (.) instead of (0.) ; note: it's bad when (EXPLODE "12.34") gives (1 2 0. 3 4) ; Nov 30 : changed initialization sequence so stack is set before being used ; ; -1982- ; Mar 31 : changed TYS so that it does not echo ; Sep 6 : fixed bug in givchi (in VL7) for hex input ; Sep 8 : fixed very rare bug in MEMORY (in VL3) ; ; -1983- ; Apr 1 : first submittion of VLISP package to DECUS (#11-617) ; Nov 29 : these modifications for TSX+ compatibility: ; - eliminated trap to 4 and 10 interrupt routines and ; replaced them with a .TRPSET monitor request. ; - eliminated TT: interrupt routine and replaced the ; control-C intercept there with the .SCCA monitor ; request. the control-C checking was put in eval. ; Nov 29 : fixed stop function so (S "cmd") works correctly. ; Nov 29 : changed version letter from D to E. ; Dec 20 : added contol-C check to inchb (in VL8) ; Dec 20 : change reenter message to: "to exit type: (S)" ; Dec 20 : fixed bug in garbage collector which bombs under TSX ; ; -1984- ; Mar 5 : changed bottom address in link commands from 200 to ; 600. This was required to work properly under RT11FB ; .psect VL2 xx1 = version xx2 = options xx3 = eis xx4 = fis xx5 = clock xx6 = i11.04 xx7 = recor .globl bfodk,nil,undef ; ****** zone pile. (starts at 200 to leave room for RT11) hstak:: ; sommet de pile. (end of the stack (top)) .blkw 1998. bstak:: .blkw 2 ; debut de pile. (beginning of the stack) ; ****** buffers, zones de travail. bufin:: .blkw 256. ; buffer d'entree TT. .word 0 ; chien de garde. toujours a 0. bufou:: .blkb 132. ; 132. octets buffer sortie TT. .if ne,recor bfrdk:: .blkw 256. ; 256. mots buffer sortie DSK pour record. ebfrdk == . ; chien de garde. .endc ndl:: .word 0 ; nb de doublets libres. nnl:: .word 0 ; nb de nombres libres. igc:: .word 0 ; 1 dans GC, 0 sinon. pour err fatale GC. ngc:: .word 0 ; nombres de g.c. depuis debut de session. freenb:: .word 0 ; pointeur de nombres libres. savnb:: .word 0 ; sauve le nb a construire en cas de garb. sign:: .word 0 ; signe pour les conversions. tem0:: .word 0 ; temporaire. ; ----- limites de zones hlist:: .word 0 ; contient l'adresse du plus haut doublet. ; control block for file specifitions ; le dblk est initialise avec le fichier : VLISP.INI blki:: .rad50 /DK / ; device. blki1:: .rad50 /vli/ ; nom.1 blki2:: .rad50 /sp / ; nom.2 blki3:: .rad50 /ini/ ; extension. .page ; bloc de controle READW. ; %%%%%% a tasser. inarea:: .byte chani,10 nblki:: .word 0 ; no de bloc in. .word bufin .word 256. .word 0 ; 0 pour readw. ; dski est initialise pour VLISP.INI dski:: .word -1 ; indicateur entree dsk ; 0 = terminal. ; -1 = VLISP.INI ; 1 = autres entrees disque. ; bloc de controle WRITW. ; %%%%%% a tasser. ouarea:: .byte chano,11 nblko:: .word 0 ; no de bloc out. .word bfodk .word 256. .word 0 ; indique WRITW. dsko:: .word 0 ; indicateur sortie dsk si non 0. ; bloc de controle ENTER ; %%%%%% a tasser. enarea:: .byte chano,2 .word blki .word 0,0 .page ; bloc de controle RECORD .if ne,recor ; %%%%%% a tasser. rearea:: .byte chanre,11 nblkre:: .word 0 ; no de bloc record. .word bfrdk .word 256. .word 0 flgrcd:: .word 0 ; flag record. 1 ou 0 selon. rcdpt:: .word 0 ; pointeur buffer record : adresse byte. .endc area:: .blkw 10. ; la-zone. inbpt:: .word 0 ; pointeur buffer entree. ipti:: .word 0 ; indicateur de status read. oubpt:: .word 0 ; pointeur buffer sortie TT : index = [0:127]. oubpk:: .word 0 ; pointeur buffer sortie DSK : adresse de byte. gcspk:: .word 0 ; gc parlant si T, muet si NIL. .if ne,fis ; [PM] savnb2:: .word 0 ; pour 2de partie de flottant. .endc ; [PM] .page ringur:: .word 0 ; dernier caractere lu a revomir. bufat:: .word undef ; c-val std (undef) .word nil ; p-list std (nil) .word 0 ; f-val std (0) .byte 0,0 ; f-typ,,p-typ .word 0 ; a-link mbuf:: .byte 0 ; nb de caracteres du p-name. .blkb maxpn ; buffer de pnames et strings. .even catoc:: .word 0 ; adresse 1ere place atome au dessus de catol. catol:: .word 0 ; adresse dernier atome interned. hdato:: .word 0 ; tete de chaine-des-atomes. impli:: .word 0 ; indic implode=1, read=0 impld:: .word 0 ; liste a interner (implode) rdprd:: .word 0 ; nb de "(" non fermees pour pp read. prnxt:: .word 0 ; 1er element (0:n 1:y) lcou:: .word 0 ; nb de caracteres imprimables avant un rc. prcdp:: .word 0 ; profondeur courante d'impression (listes). prcln:: .word 0 ; longueur courante d'impression (listes). xpldi:: .word 0 ; indic explode=1, print=0 xpldl:: .word 0 ; dernier pointeur de l'explode. atlst == . ; dummy pour read. soubpt:: .word 0 ; pour sauver oubpt. savpil:: .word 0 ; pour sauver la pile. sava1:: .word 0 ; pour sauver a1. form:: .word 0 ; save form pour erreurs & macros. pbind:: .word 0 ; pointeurs des binds. cntlc:: .word 0 ; [PM] control-C terminal status word .if ne,clock ; [PM] time:: .word 0 ; high-order time. time2:: .word 0 ; low-order time. otime:: .word 0 otime2:: .word 0 hz50:: .word 0 ; [PM] 0=60hz, -1=50hz .endc ; [PM] .end ; ****** END OF VL2 ******