1 //  Declarations for the code generator.
  2 //  Last modified on 04/02/74 at 16:01:37 by R F Mabee.
  3 //  Code generator substantially modified during 6180 bootstrap, and installed with Version 3.4, R F Mabee.
  4 //  First installed as Version 2.7, R F Mabee.
  5 
  6 get "bcpl_compiler_head"
  7 get "bcpl_symbols"
  8 get "bcpl_cg_codes"
  9 
 10 external
 11      $(   FinishText = "bcpl_cg0$FinishText"
 12 
 13           ApplyMonadicOperator = "bcpl_cg1$ApplyMonadicOperator"
 14           ApplyDiadicOperator = "bcpl_cg1$ApplyDiadicOperator"
 15           ApplyOffsetOperator = "bcpl_cg1$ApplyOffsetOperator"
 16           MonadicJumpcond = "bcpl_cg1$MonadicJumpcond"
 17           DiadicJumpcond = "bcpl_cg1$DiadicJumpcond"
 18 
 19           IsNumber = "bcpl_cg2$IsNumber"
 20           EvalNumber = "bcpl_cg2$EvalNumber"
 21           IsZero = "bcpl_cg2$IsZero"
 22           IsAddress = "bcpl_cg2$IsAddress"
 23           IsStored = "bcpl_cg2$IsStored"
 24           LookupTemp = "bcpl_cg2$LookupTemp"
 25           MakeCgTemp = "bcpl_cg2$MakeCgTemp"
 26           ClaimRegister = "bcpl_cg2$ClaimRegister"
 27           DisclaimRegister = "bcpl_cg2$DisclaimRegister"
 28           InRegister = "bcpl_cg2$InRegister"
 29           FindInRegister = "bcpl_cg2$FindInRegister"
 30           CombineAddress = "bcpl_cg2$CombineAddress"
 31           Compjump = "bcpl_cg2$Compjump"
 32           Complab = "bcpl_cg2$Complab"
 33           DefineLab = "bcpl_cg2$DefineLab"
 34           LookupLabel = "bcpl_cg2$LookupLabel"
 35           ClearRegisters = "bcpl_cg2$ClearRegisters"
 36           ClearMemory = "bcpl_cg2$ClearMemory"
 37           AddLiteral = "bcpl_cg2$AddLiteral"
 38           OutLiterals = "bcpl_cg2$OutLiterals"
 39           Outstring = "bcpl_cg2$Outstring"
 40 
 41           LoadRegister = "bcpl_cg3$LoadRegister"
 42           LoadPointer = "bcpl_cg3$LoadPointer"
 43           LoadIndex = "bcpl_cg3$LoadIndex"
 44           LoadAppropriateRegister = "bcpl_cg3$LoadAppropriateRegister"
 45           LoadNumber = "bcpl_cg3$LoadNumber"
 46           SetupAddr = "bcpl_cg3$SetupAddr"
 47           CompareToZero = "bcpl_cg3$CompareToZero"
 48           Makeaddressable = "bcpl_cg3$Makeaddressable"
 49           SwapAandQ = "bcpl_cg3$SwapAandQ"
 50           Preserve = "bcpl_cg3$Preserve"
 51           Store = "bcpl_cg3$Store"
 52           StoreRegister = "bcpl_cg3$StoreRegister"
 53           GetRegister = "bcpl_cg3$GetRegister"
 54           Satisfactory = "bcpl_cg3$Satisfactory"
 55           Literal = "bcpl_cg3$Literal"
 56 
 57           NewSSP = "bcpl_cg4$NewSSP"
 58           Compentry = "bcpl_cg4$Compentry"
 59           Compreturn = "bcpl_cg4$Compreturn"
 60           CreateArglist = "bcpl_cg4$CreateArglist"
 61           StoreArg = "bcpl_cg4$StoreArg"
 62           Compfnap = "bcpl_cg4$Compfnap"
 63           CreateSystemArglist = "bcpl_cg4$CreateSystemArglist"
 64           StoreSystemArg = "bcpl_cg4$StoreSystemArg"
 65           CompSystemCall = "bcpl_cg4$CompSystemCall"
 66           ResultBlockBegin = "bcpl_cg4$ResultBlockBegin"
 67           ResultSet = "bcpl_cg4$ResultSet"
 68           ResultGet = "bcpl_cg4$ResultGet"
 69           Compfinish = "bcpl_cg4$Compfinish"
 70           Compgoto = "bcpl_cg4$Compgoto"
 71           Compstring = "bcpl_cg4$Compstring"
 72           Comptable = "bcpl_cg4$Comptable"
 73           Compexternal = "bcpl_cg4$Compexternal"
 74 
 75           OutData = "bcpl_cg5$OutData"
 76           Outop = "bcpl_cg5$Outop"
 77           Outop2 = "bcpl_cg5$Outop2"
 78           Outop3 = "bcpl_cg5$Outop3"
 79           Outop4 = "bcpl_cg5$Outop4"
 80           OutW = "bcpl_cg5$OutW"
 81           OutW2 = "bcpl_cg5$OutW2"
 82           PutCode = "bcpl_cg5$PutCode"
 83           PutAbsBits = "bcpl_cg5$PutAbsBits"
 84           SetLineNumber = "bcpl_cg5$SetLineNumber"
 85           SectionHeader = "bcpl_cg5$SectionHeader"
 86           FormOpcode = "bcpl_cg5$FormOpcode"
 87           FormTag = "bcpl_cg5$FormTag"
 88           CheckAddr = "bcpl_cg5$CheckAddr"
 89 
 90           Compswitch = "bcpl_cg6$Compswitch"
 91 
 92           WriteGetlp = "bcpl_cg7$WriteGetlp"
 93           WriteEntry = "bcpl_cg7$WriteEntry"
 94           WriteDefs = "bcpl_cg7$WriteDefs"
 95           WriteLinkage = "bcpl_cg7$WriteLinkage"
 96 
 97           WriteSymbol = "bcpl_cg8$WriteSymbol"
 98           WriteRelBits = "bcpl_cg8$WriteRelBits"
 99           WriteObjectMap = "bcpl_cg8$WriteObjectMap"
100 
101           WriteData = "bcpl_cg9$WriteData"
102           WriteInstruction = "bcpl_cg9$WriteInstruction"
103           ListCodeItem = "bcpl_cg9$ListCodeItem"
104      $)
105 global              //  300 - 399 are reserved for the code generator.
106      $(   AbsRelBits          : 300
107           Address             : 301
108           ArgCount            : 302
109           ArgLen              : 303
110           CgTempList          : 304
111           CodeFirst           : 305
112           CodeP               : 306
113           CodeV               : 307
114           Comment             : 308
115 
116           DeferredJumpLabel   : 310
117           DefsLength          : 311
118           DefsRelbits         : 312
119           EntryLabel          : 313
120           GetLpLabel          : 314
121           IndicatorsSetBy     : 315
122           Jumpsw              : 316
123           LabMaxArg           : 317
124           LabMaxSSP           : 318
125 
126           LabTable            : 320
127           LC                  : 321
128           LineMapFirst        : 322
129           LineMapLength       : 323
130           LineMapList         : 324
131           LinkageLength       : 325
132           LinkageRelbits      : 326
133           LinkList            : 327
134           Lrand               : 328
135 
136           MainEntriesList     : 330
137           MaxArgOffset        : 331
138           MaxSSP              : 332
139           NewLiteralsList     : 333
140           OldLabel            : 334
141           OldLiteralsList     : 335
142           Param               : 336
143           Rrand               : 337
144           RegisterTemps       : 338
145 
146           RegisterUsage       : 340
147           RelbitsFirst        : 341
148           RelbitsLength       : 342
149           RelbitsList         : 343
150           RelbitsOffset       : 344
151           Reloc               : 345
152           ResultInfo          : 346
153           ResultInfoList      : 347
154           SaveSpaceSize       : 348
155 
156           SymbolLength        : 350
157           SymbolRelbits       : 351
158           StackRefTag         : 352
159           SymtabFirst         : 353
160           SymtabP             : 354
161           SymtabV             : 355
162           Tag                 : 356
163           TextLength          : 357
164           TextRelbits         : 358
165 
166           UsageCounter        : 360
167      $)
168 manifest
169      $(   CgTempSize = 9
170           CodeSize = 1000
171           LabTableSize = 100
172           SymtabSize = 200
173      $)
174 manifest            //  Flags for listing.
175      $(   CodeSwitch          = 1
176           InstructionSwitch   = 2
177           DataSwitch          = 3
178           LabelSwitch         = 4
179           LineCountSwitch     = 5
180           SectionSwitch       = 6
181           HeaderSwitch        = 7
182      $)
183 manifest            //  Relocation codes.
184      $(   RelText             = $820
185           RelLink18           = $822
186           RelNegLink18        = $823
187           RelLink15           = $824
188           RelDef              = $825
189           RelSymbol           = $826
190           RelNegSymbol        = $827
191           RelStat18           = $830
192           RelStat15           = $831
193           RelExtendedAbs      = $836              //  Ten bit count follows this code.
194      $)
195 manifest
196      $(   TagXrMask = $817
197           TagPrMask = $8700000000100
198 
199           Mod16 = $8777777777760
200      $)
201 
202 manifest                      //  Modifiers and tags used in the code generator.
203      $(   Ap = $8000000000100
204           Ab = $8100000000100
205           Bp = $8200000000100
206           Bb = $8300000000100
207           Lp = $8400000000100
208           Lb = $8500000000100
209           Sp = $8600000000100
210           Sb = $8700000000100
211 
212           Al = $805
213           Au = $801
214           Dl = $807
215           Du = $803
216           Ql = $806
217           Qu = $802
218 
219           X0 = $810
220           X1 = $811
221           X2 = $812
222           X3 = $813
223           X4 = $814
224           X5 = $815
225           X6 = $816
226           X7 = $817
227 
228           Ft2 = $846
229           Ic = $804
230           Star = $820
231           StarThenReg = $860
232      $)
233 manifest                      //  Internal codes for all machine registers used.
234      $(   Ar        = 1
235           Qr        = 2
236 
237           Xr0       = 3
238           Xr1       = 4
239           Xr2       = 5
240           Xr3       = 6
241           Xr4       = 7
242           Xr5       = 8
243           Xr6       = 9
244           Xr7       = 10
245 
246           Apr       = 11
247           Abr       = 12
248           Bpr       = 13
249           Bbr       = 14
250           Lpr       = 15
251           Lbr       = 16
252           Spr       = 17
253           Sbr       = 18
254 
255           EAQr      = 19
256 
257           NumberOfRegisters = 20
258 
259           AorQr     = 22
260           AnyPr     = 23
261           AnyXr     = 24
262      $)