system-extras.red 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. %
  2. % 20-EXTRAS.RED - System-specific functions for Dec-20 PSL
  3. %
  4. % Author: Eric Benson
  5. % Symbolic Computation Group
  6. % Computer Science Dept.
  7. % University of Utah
  8. % Date: 4 March 1982
  9. % Copyright (c) 1982 University of Utah
  10. %
  11. % <PSL.KERNEL-20>SYSTEM-EXTRAS.RED.3, 5-Jan-83 16:46:34, Edit by PERDUE
  12. % Added ExitLISP, for the DEC-20 a synonym of QUIT
  13. fluid '(system_list!*);
  14. if_system(Tenex,
  15. if_system(KL10,
  16. system_list!* := '(Dec20 PDP10 Tenex KL10),
  17. system_list!* := '(Dec20 PDP10 Tenex)),
  18. system_list!* := '(Dec20 PDP10 Tops20 KL10));
  19. lap '((!*entry Quit expr 0)
  20. (haltf)
  21. (!*MOVE '"Continued" (reg 1))
  22. (!*EXIT 0)
  23. );
  24. CopyD('ExitLISP, 'Quit);
  25. lap '((!*entry Date expr 0)
  26. (!*MOVE (WConst 8) (reg 1)) % allocate a 9 character string
  27. (!*CALL GtStr)
  28. (!*MOVE (reg 1) (reg 4)) % save it in 4
  29. (!*WPLUS2 (reg 1) (WConst 1))
  30. (hrli 1 8#440700) % create a byte pointer to it
  31. (!*MOVE (WConst -1) (reg 2)) % current date
  32. (hrlzi (reg 3) 2#0000000001) % ot%ntm, don't output time
  33. (odtim)
  34. (!*MOVE (reg 4) (reg 1))
  35. (!*MKITEM (reg 1) (WConst STR)) % tag it as a string
  36. (!*EXIT 0)
  37. );
  38. if_system(KL10, NIL,
  39. lap '((!*Entry StackOverflow expr 0)
  40. (sub (reg ST) (lit (halfword 1000 1000))) % back up stack
  41. (!*MOVE '"Stack overflow" (reg 1))
  42. (!*JCALL StdError)
  43. ));
  44. on SysLisp;
  45. syslsp procedure ReturnAddressP X;
  46. begin scalar Y, Z;
  47. Z := SymFnc;
  48. return Field(X, 0, 18) = 2#011001000000000000 % PC flags
  49. and Field(@(X - 1), 0, 18) = 8#260740 % pushj 17,
  50. and (Y := Field(@(X - 1), 18, 18) - Z) > 0 and Y < MaxSymbols
  51. and MkID Y;
  52. end;
  53. off SysLisp;
  54. END;