non-kl-run.sl 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. %
  2. % NON-KL-RUN.SL - Extra runtime support for KI processors
  3. %
  4. % Author: Eric Benson
  5. % Symbolic Computation Group
  6. % Computer Science Dept.
  7. % University of Utah
  8. % Date: 11 May 1982
  9. % Copyright (c) 1982 University of Utah
  10. %
  11. % Basic problem is lack of ADJBP instruction
  12. (lap '((!*entry Byte expr 2)
  13. (idivi 2 5) % divide word offset by 5
  14. (add 2 1) % add word address to word offset
  15. (ldb 1 (indexed 3 BytePointerTable)) % fetch byte using remainder
  16. (!*EXIT 0)
  17. (!*entry PutByte expr 3)
  18. (move 4 3) % save byte in 4
  19. (idivi 2 5)
  20. (add 2 1)
  21. (dpb 4 (indexed 3 BytePointerTable))
  22. (!*EXIT 0)
  23. BytePointerTable
  24. (fullword (FieldPointer (indexed 2 0) 0 7))
  25. (fullword (FieldPointer (indexed 2 0) 7 7))
  26. (fullword (FieldPointer (indexed 2 0) 14 7))
  27. (fullword (FieldPointer (indexed 2 0) 21 7))
  28. (fullword (FieldPointer (indexed 2 0) 28 7))
  29. ))
  30. (lap '((!*entry BitTable expr 2)
  31. (idivi 2 18) % divide word offset by 18
  32. (add 2 1) % add word address to word offset
  33. (ldb 1 (indexed 3 BytePointerTable)) % fetch byte using remainder
  34. (!*EXIT 0)
  35. (!*entry PutBitTable expr 3)
  36. (move 4 3) % save byte in 4
  37. (idivi 2 18)
  38. (add 2 1)
  39. (dpb 4 (indexed 3 BytePointerTable))
  40. (!*EXIT 0)
  41. BytePointerTable
  42. (fullword (FieldPointer (indexed 2 0) 0 2))
  43. (fullword (FieldPointer (indexed 2 0) 2 2))
  44. (fullword (FieldPointer (indexed 2 0) 4 2))
  45. (fullword (FieldPointer (indexed 2 0) 6 2))
  46. (fullword (FieldPointer (indexed 2 0) 8 2))
  47. (fullword (FieldPointer (indexed 2 0) 10 2))
  48. (fullword (FieldPointer (indexed 2 0) 12 2))
  49. (fullword (FieldPointer (indexed 2 0) 14 2))
  50. (fullword (FieldPointer (indexed 2 0) 16 2))
  51. (fullword (FieldPointer (indexed 2 0) 18 2))
  52. (fullword (FieldPointer (indexed 2 0) 20 2))
  53. (fullword (FieldPointer (indexed 2 0) 22 2))
  54. (fullword (FieldPointer (indexed 2 0) 24 2))
  55. (fullword (FieldPointer (indexed 2 0) 26 2))
  56. (fullword (FieldPointer (indexed 2 0) 28 2))
  57. (fullword (FieldPointer (indexed 2 0) 30 2))
  58. (fullword (FieldPointer (indexed 2 0) 32 2))
  59. (fullword (FieldPointer (indexed 2 0) 34 2))
  60. ))
  61. (lap '((!*entry HalfWord expr 2)
  62. (rot 2 -1) % make halfword offset into word offset
  63. (add 1 2) % add word base to word offset
  64. (jumpl 1 (lit (hrrz 1 (indexed 1 0)) % test sign bit (from rot)
  65. (!*EXIT 0)))
  66. (hlrz 1 (indexed 1 0))
  67. (!*EXIT 0)
  68. ))
  69. (lap '((!*entry PutHalfWord expr 3)
  70. (rot 2 -1)
  71. (add 1 2)
  72. (jumpl 1 (lit (hrrm 3 (indexed 1 0))
  73. (!*EXIT 0)))
  74. (hrlm 3 (indexed 1 0))
  75. (!*EXIT 0)
  76. ))