fisl.red 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. COMMENT MODULE FISL;
  2. COMMENT FASLOD uses a vector in high BPS for accessing incoming
  3. atom names. For Tenex and Tops-20 with high memory BPS
  4. available, 2K is permanently allocated. For Tops-10 with a
  5. constricted low memory BPS area, 1K is assigned at the end of
  6. BPS, and is de-allocated after each FISL for other use...
  7. Note that Tops-10 users with a large FAP file to read can
  8. alter FISLSIZE at any time to obtain a larger/smaller table;
  9. COMMENT FASLOD expects the FISLTABLE vector to be allocated at the end
  10. of BPS, somewhere beyond BPORG, as its origin is
  11. the uppermost bound within FASLOD for BPORG stores;
  12. COMMENT FASLOD has a potentially useful routine to expand the vector
  13. being used as FISLTABLE, but in current LISP this is not
  14. used. Since LAP stores upward in memory, and the expander code
  15. would have to dynamically relocate the vector and its
  16. SUBR routine downaward and adjust the property list and
  17. GCMKL accordingly, FISL is fastest as is (with fixed vector).
  18. However, if large files/programs are to be input, either
  19. a lower vector base or dynamic allocation would be necessary;
  20. SYMBOLIC PROCEDURE !%DEVP U;
  21. IDP U AND CAR REVERSE EXPLODE U EQ '!:
  22. OR PAIRP U AND PAIRP CDR U;
  23. SYMBOLIC PROCEDURE FILNAM FIL;
  24. IF ATOM FIL THEN FIL
  25. ELSE CAR IF NOT !%DEVP CAR FIL THEN FIL
  26. ELSE CDR IF NOT CAR FIL EQ 'DIR!: THEN FIL
  27. ELSE CDR FIL;
  28. GLOBAL '(FISLSIZE INC!* MLIST!*);
  29. FLUID '(BPEND BPORG FISLTABLE !*BAKGAG !*PREDEF !*PURIFY);
  30. SYMBOLIC PROCEDURE LOAD!-MODULE FIL;
  31. BEGIN SCALAR MODUL;
  32. IF NOT ATOM(MODUL := FILNAM FIL) THEN MODUL := CAR MODUL;
  33. IF MODUL MEMBER MLIST!*
  34. THEN <<TERPRI();
  35. PRIN2 LIST("***",MODUL,"already loaded");
  36. TERPRI(); RETURN NIL>>
  37. ELSE IF ATOM FIL THEN FIL := LIST(FIL . 'FAP);
  38. IF NOT FILEP FIL AND NOT !%DEVP CAR FIL
  39. THEN FIL := 'SYS!: . FIL;
  40. IF NOT FILEP FIL THEN ERROR(40,LIST(MODUL,"MODULE NOT FOUND"));
  41. IF GETD 'EXCORE THEN BEGIN SCALAR X,Y;
  42. IF NOT(X := GET(MODUL,'FAPSIZE)) THEN X := 1; %minimum value;
  43. Y := (BPEND-BPORG-FISLSIZE)/1000; %what's left;
  44. IF Y>X THEN RETURN;
  45. X := X+1;
  46. IF BPORG>131071. THEN EXCORE(X-Y)
  47. ELSE IF NULL INC!* THEN <<EXCORE X;
  48. WARNING LIST('EXCORE,X,"PERFORMED")>>
  49. ELSE ERROR(41,LIST('EXCORE,X,"AT TOP LEVEL REQUIRED"))
  50. END;
  51. MLIST!* := MODUL . MLIST!*;
  52. RETURN FISLF FIL
  53. END;
  54. SYMBOLIC FEXPR PROCEDURE LOAD LST;
  55. %LST is a list of fast-loading format module names;
  56. FOR EACH MODUL IN LST DO LOAD!-MODULE MODUL;
  57. SYMBOLIC PROCEDURE FISLF FILE;
  58. BEGIN SCALAR OCH;
  59. OCH:= RDS OPEN(FILE,'INBIN);
  60. IF GETD 'EXCORE THEN
  61. BEGIN SCALAR X;
  62. IF (X:=BPORG) > (BPEND-FISLSIZE)
  63. THEN ERROR(170,"NO FISLTABLE ROOM");
  64. BPORG:=BPEND-FISLSIZE-1;
  65. FISLTABLE:=MKVECT(2*FISLSIZE-5);
  66. BPORG:=X;
  67. END;
  68. ERRORSET('(FASLOD FISLTABLE !*PREDEF !*PURIFY),T,!*BAKGAG);
  69. CLOSE RDS OCH;
  70. IF GETD 'EXCORE THEN <<DLVECT FISLTABLE; FISLTABLE:=NIL>>;
  71. LDFERR();
  72. END;
  73. END;