home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / language / bcpl / BCPL / alib / bcplmacsa < prev    next >
Encoding:
Text File  |  1988-03-09  |  1.6 KB  |  130 lines

  1. pc        RN    15
  2. r14        RN    14
  3. rb        RN    8
  4. rl        RN    12
  5. rts        RN    11
  6. rp        RN    10
  7. rg        RN    9
  8. rgb        RN    7
  9. w1        RN    4
  10. w2        RN    5
  11. nil        RN    13
  12. nilbase     RN    6
  13. r0        RN    0
  14. a1        RN    1
  15. a2        RN    2
  16. a3        RN    3
  17. a4        RN    4
  18.  
  19. PSRBits     *    &fc000000
  20. OverflowBit    *    &10000000
  21.  
  22. ; 3rd argument (what to do) for SetEventHandler
  23. ev_ignore    *    0
  24. ev_set_flag    *    1
  25. ev_call_proc    *    2
  26. ev_buffer    *    3
  27.  
  28.     GBLA    xxglobs
  29.     GBLA    xxtopglobal
  30.     GBLA    tempa
  31.     GBLS    temps
  32.     GBLS    VBar
  33.     GBLS    xxModuleName
  34.     GBLL    aof
  35.  
  36. xxglobs SETA    0
  37. VBar    SETS    "|"
  38. aof    SETL    {TRUE}
  39.  
  40. UserGlobals * 150
  41.  
  42. xxtopglobal SETA  UserGlobals
  43.  
  44.     MACRO
  45.     Module $name,$date
  46.     AREA    |BCPL$$Code|, CODE, READONLY
  47. Start
  48.     =    "BCPL"
  49.     &    globinits-Start
  50.     =    ("$name":CC:"        "):LEFT:8
  51.  [ "$date"=""
  52.     =    "<unset> <unset>",0,0,0,0,0
  53.   |
  54.     =    "$date",0,0
  55.  ]
  56.     &    0
  57. xxModuleName SETS "$name"
  58.     MEND
  59.  
  60.     MACRO
  61. $name    GlobNo $no
  62.     KEEP G_$name
  63. G_$name *    ($no)*4
  64.  [ $no>xxtopglobal
  65. xxtopglobal SETA $no
  66.  ]
  67.     MEND
  68.  
  69.     MACRO
  70.     GlobDef $no,$name
  71.     &    -1
  72.     =    7,("$name":CC:"       "):LEFT:7
  73.     KEEP G_$name
  74. G_$name *    ($no)*4
  75.  [ $no>xxtopglobal
  76. xxtopglobal SETA $no
  77.  ]
  78. temps    SETS    "xxgname":CC:"$xxglobs"
  79.     GBLS    $temps
  80. $temps    SETS    "$name"
  81. xxglobs SETA    xxglobs+1
  82. $name
  83. temps    SETS    VBar:CC:xxModuleName:CC:".$name":CC:VBar
  84.     KEEP    $temps
  85. $temps
  86.     MEND
  87.  
  88.     MACRO
  89.     GlobInits
  90. globinits
  91. tempa    SETA    0
  92.      WHILE tempa<xxglobs
  93. temps    SETS    "xxgname":CC:"$tempa"
  94. temps    SETS    $temps
  95.     GlobInit $temps
  96. tempa    SETA    tempa+1
  97.      WEND
  98.     MEND
  99.  
  100.     MACRO
  101. $lab    Address $value
  102.  [ "$lab"<>""
  103. $lab
  104.  ]
  105.     &    $value
  106.     MEND
  107.  
  108.     MACRO
  109.     GlobInit $name
  110.     &    G_$name/4
  111.     &    $name
  112.     MEND
  113.  
  114.     MACRO
  115.     EndModule
  116. globinits
  117. tempa    SETA    0
  118.      WHILE tempa<xxglobs
  119. temps    SETS    "xxgname":CC:"$tempa"
  120. temps    SETS    $temps
  121.     GlobInit $temps
  122. tempa    SETA    tempa+1
  123.      WEND
  124.     &    &$xxtopglobal
  125.     &    0
  126.  
  127.     MEND
  128.  
  129.     END
  130.