home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / assembler / as / src / h / AofFile next >
Encoding:
Text File  |  1992-07-20  |  2.8 KB  |  84 lines

  1.  
  2. /*
  3.  * AofFile.h
  4.  * Copyright © 1992 Niklas Röjemo
  5.  * 
  6.  * Types that exist in an AOF file.
  7.  */
  8.  
  9. #ifndef AofFile_h
  10. #define AofFile_h              
  11.  
  12. typedef struct {
  13.   int      Name;           /* Offset into string table */
  14.   int      Type;     
  15.   int      Size;           /* Size of area, must be divisible by four */
  16.   int      noRelocations; /* Size of relocation table */
  17.   int      Unused;         /* Unused, must be zero */
  18. }AofEntry;
  19.  
  20. #define AofHeaderID 0xc5e2d080
  21.  
  22. typedef struct {
  23.   int        Type;           /* 0xc5e2d080 if relocatable object format       */
  24.   int        Version;        /* 1.xx -> 150  2.xx -> 200                      */
  25.   int        noAreas;       /* size of Area[]                                */
  26.   int        noSymbols;     /* size of Symbol Table if such exist            */
  27.   int        EntryArea;      /* Where to start execution, 0 no entry          */
  28.   int        EntryOffset;    /* otherwise start at Area[EntryArea]+AreaOffset */
  29.   AofEntry   entry[1];                                                         
  30. } AofHeader;                   
  31.  
  32. #define aofHeaderSize(max) \
  33.         (sizeof (AofHeader) + \
  34.         (max - 1) * sizeof(AofEntry))    
  35.  
  36. #define HOW1_INIT     0x00000000
  37. #define HOW1_BYTE     0x00000000
  38. #define HOW1_HALF     0x00010000
  39. #define HOW1_WORD     0x00020000
  40. #define HOW1_SIZE     0x00030000
  41.  
  42. #define HOW1_RELATIVE 0x00040000
  43. #define HOW1_SYMBOL   0x00080000  /* Only used if not HOW1_RELATIVE */
  44. #define HOW1_SIDMASK  0x0000ffff  /* Only used if HOW1_SYMBOL */
  45.  
  46. #define HOW_TYPE2     0x80000000                                
  47. #define HOW2_INIT     0x80000000
  48. #define HOW2_BYTE     0x00000000
  49. #define HOW2_HALF     0x01000000
  50. #define HOW2_WORD     0x02000000
  51. #define HOW2_SIZE     0x03000000
  52.  
  53. #define HOW2_RELATIVE 0x04000000
  54. #define HOW2_SYMBOL   0x08000000  /* Only used if not HOW2_RELATIVE */
  55. #define HOW2_SIDMASK  0x00ffffff  /* Symbol offset if HOW2_SYMBOL, otherwise area number */
  56.  
  57. typedef struct {                                       
  58.   int Offset; /* Offset in area of the field to be relocated */
  59.   int How;    /* How relocation is done */
  60. } AofReloc;
  61.  
  62. #define TYPE_LOCAL     0x01  /* Defined with local scope */
  63. #define TYPE_REFERENCE 0x02
  64. #define TYPE_GLOBAL    0x03  /* Defined with global scope */
  65. #define TYPE_KIND      0x03
  66. #define TYPE_DEFINE    0x01
  67. #define TYPE_EXPORT    0x02
  68.  
  69. #define TYPE_ABSOLUTE  0x04  /* This is a constant, (not valid if TYPE_REFERENCE) */
  70. #define TYPE_NOCASE    0x08  /* Only if TYPE_REFERENCE, case insesitive */
  71. #define TYPE_WEAK      0x10  /* Only if TYPE_REFERENCE, must not be resolved */
  72. #define TYPE_STRONG    0x20  /* Complicated ??? */
  73. #define TYPE_COMMON    0x40
  74.  
  75. typedef struct {
  76.   int   Name;  /* Offset in string Table */
  77.   int   Type;
  78.   int   Value; /* Value if constant, Size if common, otherwise Offset */
  79.   int   AreaName;
  80. } AofSymbol;
  81.  
  82.  
  83. #endif
  84.