home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / language / bcpl / BCPL / alib / BCPLMacs < prev    next >
Encoding:
Text File  |  1988-01-19  |  1.7 KB  |  136 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    xxrelocs
  29.     GBLA    xxglobs
  30.     GBLA    xxtopglobal
  31.     GBLA    tempa
  32.     GBLS    temps
  33.     GBLL    aof
  34.  
  35. xxrelocs SETA    0
  36. xxglobs SETA    0
  37. aof    SETL    {FALSE}
  38.  
  39. UserGlobals * 150
  40.  
  41. xxtopglobal SETA  UserGlobals
  42.  
  43.     MACRO
  44.     Module $name,$date
  45. Start
  46.     =    "BCPL"
  47.     &    globinits-Start
  48.     =    ("$name":CC:"        "):LEFT:8
  49.  [ "$date"=""
  50.     =    "<unset> <unset>",0,0,0,0,0
  51.   |
  52.     =    "$date",0,0
  53.  ]
  54.     &    0
  55.     MEND
  56.  
  57.     MACRO
  58. $name    GlobNo $no
  59. G_$name *    ($no)*4
  60.  [ $no>xxtopglobal
  61. xxtopglobal SETA $no
  62.  ]
  63.     MEND
  64.  
  65.     MACRO
  66.     GlobDef $no,$name
  67.     &    -1
  68.     =    7,("$name":CC:"       "):LEFT:7
  69. G_$name *    ($no)*4
  70.  [ $no>xxtopglobal
  71. xxtopglobal SETA $no
  72.  ]
  73. temps    SETS    "xxgname":CC:"$xxglobs"
  74.     GBLS    $temps
  75. $temps    SETS    "$name"
  76. xxglobs SETA    xxglobs+1
  77. $name
  78.     MEND
  79.  
  80.     MACRO
  81.     GlobInits
  82. globinits
  83. tempa    SETA    0
  84.      WHILE tempa<xxglobs
  85. temps    SETS    "xxgname":CC:"$tempa"
  86. temps    SETS    $temps
  87.     GlobInit $temps
  88. tempa    SETA    tempa+1
  89.      WEND
  90.     MEND
  91.  
  92.     MACRO
  93. $lab    Address $value
  94.  [ "$lab"<>""
  95. $lab
  96.  ]
  97. temps    SETS    "rx":CC:"$xxrelocs"
  98. $temps
  99.     &    $value-Start
  100. xxrelocs SETA    xxrelocs+1
  101.     MEND
  102.  
  103.     MACRO
  104.     GlobInit $name
  105.     &    G_$name/4
  106. temps    SETS    "rx":CC:"$xxrelocs"
  107. $temps
  108.     &    $name-Start
  109. xxrelocs SETA    xxrelocs+1
  110.     MEND
  111.  
  112.     MACRO
  113.     EndModule
  114. globinits
  115. tempa    SETA    0
  116.      WHILE tempa<xxglobs
  117. temps    SETS    "xxgname":CC:"$tempa"
  118. temps    SETS    $temps
  119.     GlobInit $temps
  120. tempa    SETA    tempa+1
  121.      WEND
  122.     &    &$xxtopglobal
  123.     &    0
  124.  
  125.     &    &12345678
  126. tempa    SETA    0
  127.      WHILE tempa<>xxrelocs
  128. temps    SETS    "rx":CC:"$tempa"
  129. tempa    SETA    tempa+1
  130.     &    $temps-Start
  131.      WEND
  132.     &    &87654321
  133.     MEND
  134.  
  135.     END
  136.