home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / jËzyki_programowania / oberon / loader / oloaddata.def < prev    next >
Text File  |  1977-12-31  |  4KB  |  126 lines

  1. DEFINITION MODULE OLoadData;
  2. (*
  3.  This module allows the access to the data structures Module and
  4.  TypeDescriptor, which are used also in the Oberon System.
  5.  
  6.  The access is done through procedures. These procedures are
  7.  written in concordance to the aligning rules of the oberon
  8.  compiler.
  9.  
  10.  Thus this module has to be revised whenever the oberon compiler
  11.  is changed.
  12. *)
  13.  
  14. (*FROM SYSTEM IMPORT ADDRESS;*)
  15.  
  16. CONST
  17.  descSizeAligned=92; (* Descriptor size, long word aligned *)
  18.  
  19. CONST
  20.  nameLen=24;
  21.  
  22. TYPE
  23.  Absolute=LONGINT;
  24.  Offset=LONGINT;
  25.  OldCardinal=CARDINAL;
  26.  OldLongCard=LONGCARD;
  27.  CARDINAL=INTEGER;
  28.  LONGCARD=LONGINT;
  29.  
  30.  CodeBase=Absolute;
  31.  ConstBase=Absolute;
  32.  CommandBase=Absolute;
  33.  Count=CARDINAL;
  34.  DataBase=Absolute;
  35.  Entry=Offset;
  36.  EntryBase=Absolute;
  37.  Key=LONGCARD;
  38.  ImportBase=Absolute;
  39.  Index=CARDINAL;
  40.  Module=Absolute;
  41.  Name=ARRAY [0..nameLen-1] OF CHAR;
  42.  PointerBase=Absolute;
  43.  RefBase=Absolute;
  44.  Size=LONGCARD;
  45.  Tag=LONGCARD;
  46.  TypeDescriptor=Absolute;
  47.  
  48. VAR
  49.  module255:ARRAY [0..255] OF Absolute;
  50. (*
  51.  module255 has to be prefilled with the absolute addresses of
  52.  special funtions. The compiler encodes them as functions belonging
  53.  to the module with module number 255. Whenever fixup encounters
  54.  a reference to (mno=255, eno), it will translate this entry
  55.  using this array.
  56. *)
  57.  
  58. PROCEDURE commandG(mod:Module):CommandBase;
  59. PROCEDURE commandP(mod:Module; command:CommandBase);
  60. PROCEDURE commandsEntryG(mod:Module; index:Index):Entry;
  61. PROCEDURE commandsEntryP(mod:Module; index:Index; entry:Entry);
  62. PROCEDURE commandsNameG(mod:Module; index:Index; VAR name:Name);
  63. PROCEDURE commandsNameP(mod:Module; index:Index; name:Name);
  64. PROCEDURE codeG(mod:Module):CodeBase;
  65. PROCEDURE codeP(mod:Module; code:CodeBase);
  66. PROCEDURE codeSizeG(mod:Module):Size;
  67. PROCEDURE codeSizeP(mod:Module; size:Size);
  68. PROCEDURE constG(mod:Module):ConstBase;
  69. PROCEDURE constP(mod:Module; const:ConstBase);
  70. PROCEDURE constSizeG(mod:Module):Size;
  71. PROCEDURE constSizeP(mod:Module; size:Size);
  72. PROCEDURE dataG(mod:Module):DataBase;
  73. PROCEDURE dataP(mod:Module; data:DataBase);
  74. PROCEDURE dataSizeG(mod:Module):Size;
  75. PROCEDURE dataSizeP(mod:Module; size:Size);
  76. PROCEDURE entriesG(mod:Module; index:Index):Entry;
  77. PROCEDURE entryG(mod:Module):EntryBase;
  78. PROCEDURE entryP(mod:Module; entry:EntryBase);
  79. PROCEDURE importG(mod:Module):ImportBase;
  80. PROCEDURE importP(mod:Module; import:ImportBase);
  81. PROCEDURE importsG(mod:Module; index:Index):Module;
  82. PROCEDURE importsP(mod:Module; index:Index; module:Module);
  83. PROCEDURE keyG(mod:Module):Key;
  84. PROCEDURE keyP(mod:Module; key:Key);
  85. PROCEDURE nameG(mod:Module; VAR name:Name);
  86. PROCEDURE nameP(mod:Module; name:Name);
  87. PROCEDURE nextG(mod:Module):Module;
  88. PROCEDURE nextP(mod:Module; next:Module);
  89. PROCEDURE nofCommandsG(mod:Module):Count;
  90. PROCEDURE nofCommandsP(mod:Module; count:Count);
  91. PROCEDURE nofEntriesG(mod:Module):Count;
  92. PROCEDURE nofEntriesP(mod:Module; count:Count);
  93. PROCEDURE nofImportsG(mod:Module):Count;
  94. PROCEDURE nofImportsP(mod:Module; count:Count);
  95. PROCEDURE nofPointersG(mod:Module):Count;
  96. PROCEDURE nofPointersP(mod:Module; count:Count);
  97. PROCEDURE pointerG(mod:Module):PointerBase;
  98. PROCEDURE pointerP(mod:Module; pointer:PointerBase);
  99. PROCEDURE refG(mod:Module):RefBase;
  100. PROCEDURE refP(mod:Module; ref:RefBase);
  101. PROCEDURE refCntG(mod:Module):Count;
  102. PROCEDURE refCntP(mod:Module; refCnt:Count);
  103. PROCEDURE refSizeG(mod:Module):Size;
  104. PROCEDURE refSizeP(mod:Module; size:Size);
  105. PROCEDURE tagP(mod:Module; tag:Tag);
  106.  
  107. PROCEDURE tdExtensionLevelG(td:TypeDescriptor):Count;
  108. PROCEDURE tdModuleP(td:TypeDescriptor; mod:Module);
  109. PROCEDURE tdNumberOfMethodsG(td:TypeDescriptor):Count;
  110. PROCEDURE tdSizeG(td:TypeDescriptor):Size;
  111. PROCEDURE tdSizeP(td:TypeDescriptor; size:Size);
  112. PROCEDURE tdTagP(td:TypeDescriptor; tag:Tag);
  113.  
  114. PROCEDURE Address(mod:Module; mno,eno:SHORTCARD):Absolute;
  115. PROCEDURE AllocateMod(nofEntries:Count; nofCommands:Count; nofPtrs:Count; nofImports:Count; constSize:Size; dataSize:Size; codeSize:Size; refSize:Size):Module;
  116. PROCEDURE CompleteTypeDescs(mod:Module);
  117. PROCEDURE DeallocateMod(mod:Module);
  118. PROCEDURE EqualName(mod:Module; name:ARRAY OF CHAR):BOOLEAN;
  119. PROCEDURE Fixup(mod:Module; link:CARDINAL);
  120. PROCEDURE GetName(base:Absolute; offset:LONGINT; VAR name:Name);
  121. PROCEDURE PutName(base:Absolute; offset:LONGINT; name:Name);
  122. PROCEDURE MakeAbsolute(mod:Module; base:Absolute; entry:Entry);
  123. PROCEDURE SetupPointers(mod:Module);
  124.  
  125. END OLoadData.
  126.