LtoUset.e 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #
  2. ;
  3. ; (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. ; See the copyright notice in the ACK home directory, in the file "Copyright".
  5. ;
  6. ;
  7. ; Module: Compute non-constant set displays
  8. ; Author: Ceriel J.H. Jacobs
  9. ; Version: $Id$
  10. ;
  11. mes 2,EM_WSIZE,EM_PSIZE
  12. ; LtoUset is called for set displays containing { expr1 .. expr2 }.
  13. ; It has six parameters, of which the caller must pop five:
  14. ; - The set in which bits must be set.
  15. ; - the lower bound of the set type.
  16. ; - The set size in bytes.
  17. ; - The upper bound of set elements, specified by the set-type.
  18. ; - "expr2", the upper bound
  19. ; - "expr1", the lower bound
  20. #define SETBASE 5*EM_WSIZE
  21. #define SETLOW 4*EM_WSIZE
  22. #define SETSIZE 3*EM_WSIZE
  23. #define USETSIZ 2*EM_WSIZE
  24. #define LWB EM_WSIZE
  25. #define UPB 0
  26. exp $LtoUset
  27. pro $LtoUset,0
  28. lal SETBASE ; address of initial set
  29. lol SETSIZE
  30. los EM_WSIZE ; load initial set
  31. lol LWB ; low bound
  32. lol SETLOW
  33. sbu EM_WSIZE
  34. stl LWB
  35. lol UPB ; high bound
  36. lol SETLOW
  37. sbu EM_WSIZE
  38. stl UPB
  39. 1
  40. lol LWB
  41. lol UPB
  42. cmu EM_WSIZE
  43. zgt *2 ; while low <= high
  44. lol LWB
  45. lol SETSIZE
  46. set ? ; create [low]
  47. lol SETSIZE
  48. ior ? ; merge with initial set
  49. lol LWB
  50. loc 1
  51. adu EM_WSIZE
  52. stl LWB
  53. bra *1 ; loop back
  54. 2
  55. lal SETBASE
  56. lol SETSIZE
  57. sts EM_WSIZE ; store result over initial set
  58. ret 0
  59. end 0