gto.e 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #
  2. ; $Id$
  3. ; (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. ;
  5. ; This product is part of the Amsterdam Compiler Kit.
  6. ;
  7. ; Permission to use, sell, duplicate or disclose this software must be
  8. ; obtained in writing. Requests for such permissions may be sent to
  9. ;
  10. ; Dr. Andrew S. Tanenbaum
  11. ; Wiskundig Seminarium
  12. ; Vrije Universiteit
  13. ; Postbox 7161
  14. ; 1007 MC Amsterdam
  15. ; The Netherlands
  16. ;
  17. /* Author: J.W. Stevenson */
  18. mes 2,EM_WSIZE,EM_PSIZE
  19. #define TARLB 0
  20. #define DESCR EM_PSIZE
  21. #define NEWPC 0
  22. #define SAVSP EM_PSIZE
  23. #define D_PC 0
  24. #define D_SP EM_PSIZE
  25. #define D_LB EM_PSIZE+EM_PSIZE
  26. #define LOCLB -EM_PSIZE
  27. ; _gto is called with two arguments:
  28. ; - pointer to the label descriptor (DESCR)
  29. ; - local base (LB) of target procedure (TARLB)
  30. ; the label descriptor contains two items:
  31. ; - label address i.e. new PC (NEWPC)
  32. ; - offset in target procedure frame (SAVSP)
  33. ; using this offset and the LB of the target procedure, the address of
  34. ; of local variable of the target procedure is constructed.
  35. ; the target procedure must have stored the correct target SP there.
  36. descr
  37. bss 3*EM_PSIZE,0,0
  38. exp $_gto
  39. pro $_gto,EM_PSIZE
  40. lal DESCR
  41. loi EM_PSIZE
  42. adp NEWPC
  43. loi EM_PSIZE
  44. lae descr+D_PC
  45. sti EM_PSIZE
  46. lal TARLB
  47. loi EM_PSIZE
  48. zer EM_PSIZE
  49. cmp
  50. zeq *1
  51. lal TARLB
  52. loi EM_PSIZE
  53. bra *2
  54. 1
  55. lae _m_lb
  56. loi EM_PSIZE
  57. 2
  58. lal LOCLB
  59. sti EM_PSIZE
  60. lal LOCLB
  61. loi EM_PSIZE
  62. lal DESCR
  63. loi EM_PSIZE
  64. adp SAVSP
  65. loi EM_WSIZE ; or EM_PSIZE ?
  66. ads EM_WSIZE ; or EM_PSIZE ?
  67. loi EM_PSIZE
  68. lae descr+D_SP
  69. sti EM_PSIZE
  70. lal LOCLB
  71. loi EM_PSIZE
  72. lae descr+D_LB
  73. sti EM_PSIZE
  74. gto descr
  75. end ?