setsn.1 938 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <TITLE SNAME-SETTER>
  2. <DECLARE ("VALUE" <PRIMTYPE WORD> "OPTIONAL" <OR STRING <PRIMTYPE WORD>>)>
  3. <JUMPL AB* DOPUSH>
  4. <PUSHJ P* GETSNM>
  5. <JRST FINIS>
  6. DOPUSH <DPUSH TP* (AB)>
  7. <PUSHJ P* SETSNM>
  8. <JRST FINIS>
  9. ; "GET .SNAME IF NO ARGUMENT GIVEN"
  10. <INTERNAL-ENTRY GETSNM 0>
  11. <SUBM M* (P)>
  12. <*SUSET [<(*16*) B>]>
  13. <MOVE A* <TYPE-WORD WORD>>
  14. <JRST MPOPJ>
  15. ; "SET .SNAME, DOING STRTOX IF GIVEN STRING"
  16. <INTERNAL-ENTRY SETSNM 1>
  17. <SUBM M* (P)>
  18. <POP TP* B>
  19. <POP TP* A>
  20. <GETYP O* A>
  21. <CAIN O* <TYPE-CODE STRING>>
  22. <PUSHJ P* STRTOX>
  23. <*SUSET [<(*400016*) B>]>
  24. <JRST MPOPJ>
  25. ; "DO STRTOX"
  26. STRTOX <SUBM M* (P)>
  27. <HRRZ O* A>
  28. <CAILE O* 6> ; "Length of string L=? 6?"
  29. <MOVEI O* 6>
  30. <MOVE C* [<(*440600*) E>]>
  31. <MOVEI E* 0>
  32. SXLOOP <ILDB D* B> ; "Get character in D"
  33. <CAIL D* *140*> ; "Lower case?"
  34. <SUBI D* *40*>
  35. <SUBI D* *40*>
  36. <IDPB D* C> ; "Cons into E"
  37. <SOJN O* SXLOOP> ; "Done?"
  38. <MOVE B* E>
  39. <MOVE A* <TYPE-WORD WORD>>
  40. <JRST MPOPJ>