home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / language / forst / globals.s < prev    next >
Encoding:
Text File  |  1993-10-23  |  3.2 KB  |  136 lines

  1. ; GLOBALS.S: ForST macros, version 1.13
  2. ; Copyright <C> John Redmond 1989,1990
  3. ; Public domain for non-commercial use.
  4. ;
  5.         section    text
  6. ;
  7.     opt    A+    ;PC-rel
  8. ;
  9. ; Bit flags for stack expectations and results of macros:
  10. ;
  11. ;
  12. none_none = 0        ;0 args expected, 0 results returned
  13. none_one = $20
  14. one_none = $80
  15. one_one = $a0
  16. one_two = $b0
  17. ;
  18. two_none = $c0        ; 2 args expected, 0 results returned
  19. two_one = $e0
  20. two_two = $f0
  21. ;
  22. two_result = $e8    ; 2 args expected, boolean result returned
  23. one_result = $a8
  24.  
  25. exp_d0 = (one_none<<24)!$2d00
  26. ret1_any = (none_one<<24)!$ffff
  27. ;
  28. push:   macro   $\1
  29.         move.l  \1,-(a6)
  30.         endm
  31. pop:    macro   $\1
  32.         move.l  (a6)+,\1
  33.         endm
  34. rpush:  macro   $\1
  35.         move.l  \1,-(a7)
  36.         endm
  37. rpop:   macro   $\1
  38.         move.l  (a7)+,\1
  39.         endm
  40. offs:   macro  \1
  41.         dc.l    \1-index
  42.         endm
  43. len:    macro    \1
  44.     dc.w    (\1-*-2)/2
  45.     endm
  46. ;
  47. ptrs:   macro   \1
  48.         dc.l    0
  49.         dc.l    \1-index,\1-index
  50.         dc.w    \2
  51.         endm
  52. lptrs:    macro   \1            ;word with length for copying
  53.         dc.w    \2            ;length
  54.         dc.w    0
  55.         dc.l    \1-index,\1-index
  56.         dc.w    \3
  57.         endm
  58. mptrs:  macro               ;macro words
  59.         dc.b    \4,\3                   ;macro length
  60.        ifc    '\2','noedge'
  61.         dc.w    -1
  62.        elseif
  63.         move.l  \2,-(a6)                ;macro flag
  64.        endc
  65.         dc.l    \1-index,\1-index
  66.         dc.w    \5
  67.         endm
  68. ;
  69. vptrs:  macro   \1                      ;variables
  70.         dc.l    0
  71.         dc.l    _var-index,\1-index
  72.         dc.w    \2
  73.         endm
  74. ;
  75. cptrs:  macro   \1                      ;constants
  76.         dc.l    0
  77.         dc.l    _const-index,\1
  78.         dc.w    \2
  79.         endm
  80. ;
  81. dptrs:  macro   \1                      ;deferred words
  82.         dc.l    0
  83.         dc.l    _def-index,\1-index
  84.         dc.w    \2
  85.         endm
  86. ;
  87. vectptrs: macro   \1                    ;vectored words
  88.         dc.l    0
  89.         dc.l    _vect-index,\1-index
  90.         dc.w    \2
  91.         endm
  92. ;
  93. vect:  macro   \1,$\2,%\3,%\4        ;compile-time vectoring
  94.         dc.b    \4,\3                   ;macro length
  95.        ifc    '\2','noedge'
  96.         dc.w    -1
  97.        elseif
  98.         move.l  \2,-(a6)                ;macro flag
  99.        endc
  100.         dc.l    _vect-index,\1-index
  101.         dc.w    \5
  102.         endm
  103. ;
  104. decide:    macro   \1,$\2,%\3,%\4,\5,\6    ;compile-time vectoring
  105.         dc.b    \4,\3                   ;macro length
  106.        ifc    '\2','noedge'
  107.         dc.w    -1
  108.        elseif
  109.         move.l  \2,-(a6)                ;macro flag
  110.        endc
  111.         dc.l    \6-index,\1-index
  112.         dc.w    \5
  113.         endm
  114. ;
  115. fetch:  macro   \1,\2,\3,\4,\5        ;compile-time vectoring
  116.     decide    \1,\2,\3,\4,\5,_fetchopt
  117.     endm
  118. ;
  119. store:  macro   \1,\2,\3,\4,\5        ;compile-time vectoring
  120.     decide    \1,\2,\3,\4,\5,_storeopt
  121.         endm
  122. ;
  123. invert:  macro  \1,\2,\3,\4,\5        ;compile-time vectoring
  124.     decide    \1,\2,\3,\4,\5,_notopt
  125.         endm
  126. ;
  127. ; system constants to be set before assembly
  128. ;
  129. wspace = $10000        ;space for code and buffers
  130. rspace = $2000        ;space for return stack
  131. hspace = $8000        ;space for headers
  132. kbuffsiz = 80        ;keyboard input buffer
  133. bsize = 24        ;size of file structure
  134. nobuffs = 8        ;# system iobuffers
  135. maxsize = $3ff        ;max # words in a macro
  136.