home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / prog_oth / ninfo662.lha / hunk.h < prev    next >
C/C++ Source or Header  |  1992-05-20  |  4KB  |  106 lines

  1. /* Object/Executable Information Utility V0.90 05/22/1989
  2.  * Hunk type codes Lattice 5.02 Compiler
  3.  * The information for these definitions came from The AmigaDos
  4.  * Technical Reference Manual and the Lattice Technical Support
  5.  * People, My thanks to them!
  6.  */
  7. #include <exec/types.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include <proto/dos.h>
  11. #include <ctype.h>
  12. #include <stdio.h>
  13. #define Hunk_Unit     0x3E7  /*Start of program unit */
  14. #define Hunk_Name     0x3E8  /*Name of a hunk */
  15. #define Hunk_Code     0x3E9  /*Code segment */
  16. #define Hunk_Data     0x3EA  /*Initialized Data segment */
  17. #define Hunk_Bss      0x3EB  /*Unitialized Data segment */
  18. #define Hunk_Reloc32  0x3EC  /*32-bit relocation list */
  19. #define Hunk_Reloc16  0x3ED  /*16-bit PC-relative relocation info */
  20. #define Hunk_Reloc8   0x3EE  /* 8-bit PC-relative relocation info */
  21. #define Hunk_Ext      0x3EF  /*External symbol */
  22. #define Hunk_Symbol   0x3F0  /*Symbol table */
  23. #define Hunk_Debug    0x3F1  /*Debug data */
  24. #define Hunk_End      0x3F2  /*End of this hunk */
  25. #define Hunk_Header   0x3F3  /*hunk summary for loader */
  26. #define Hunk_Overlay  0x3F5  /*overlay table */
  27. #define Hunk_Break    0x3F6  /*end of overlay node */
  28. #define Hunk_Dreloc32 0x3F7  /*32-bit relocation list */
  29. #define Hunk_Dreloc16 0x3F8  /*16-bit PC-relative relocation info */
  30. #define Hunk_Dreloc8  0x3F9  /* 8-bit PC-relative relocation info */
  31. #define Hunk_Library  0x3FA  /*Lattice library format */
  32. #define Hunk_Index    0x3FB  /*Lattice library index */
  33. /*
  34.  * External symbol info
  35.  * Each Hunk_Ext record is a null-terminated list of symbol data units.
  36.  * each symbol data unit consists of a type byte, symbol length
  37.  * in longwords, symbol name (null-padded if necessary).  The data following
  38.  * will vary with the symbol type.
  39.  * Ext_symbol   has null-terminated list of symbol data units.
  40.  * Ext_def/abS/res have 1 longword of data.
  41.  * Ext_ref32/16/8  have a longword count and that many longwords of data.
  42.  * Ext_dref32/16/8 have a longword count and that many longwords of data.
  43.  * Ext_common has a longword size of common block, data count and the count
  44.  *            number of words of data.
  45.  */
  46.  
  47. #define Ext_symbol       0      /* symbol table */
  48. #define Ext_def          1      /* relocatable definition */
  49. #define Ext_abs          2      /* absolute definition */
  50. #define Ext_res          3      /* resident library definition */
  51. #define Ext_ref32      0x81     /* 32-bit reference to symbol */
  52. #define Ext_common     0x82     /* 32-bit reference to COMMON */
  53. #define Ext_ref16      0x83     /* 16-bit reference to symbol */
  54. #define Ext_ref8       0x84     /*  8-bit reference to symbol */
  55. #define Ext_dref32     0x85     /* 32-bit base relative reference */
  56. #define Ext_dref16     0x86     /* 16-bit base relative reference */
  57. #define Ext_dref8      0x87     /*  8-bit base relative reference  */
  58.  
  59. /* decode.c */
  60. void startline ( void );
  61. void padd ( void );
  62. void opchar ( char c );
  63. void opstring ( char *s );
  64. short opcode ( char *s );
  65. void opint ( unsigned int v );
  66. void ophex ( unsigned int v , short n );
  67. void opbyte ( unsigned int v );
  68. void lefthex ( unsigned short , short );
  69. void invalid ( void );
  70. void sourcekind ( short k );
  71. unsigned char grabchar ( short n );
  72. short grabword ( short n );
  73. void outadd ( char *address );
  74. void operand ( unsigned mode , unsigned reg );
  75. void shiftinstruction ( void );
  76. void conditioncode ( unsigned short cc );
  77. void handlezero ( void );
  78. void breakfurther ( char *base );
  79. void moveinstruction ( unsigned short kind );
  80. void startrange ( short bit );
  81. void endrange ( short first , short bit );
  82. void registerlist ( short kkkk , short mask );
  83. void specialbits ( void );
  84. void handlefour ( void );
  85. void op_5 ( void );
  86. void op_14 ( void );
  87. void decode ( void );
  88. char *dumpcode ( int offset , char *loc , int n );
  89.  
  90. /* do_sym.c */
  91. unsigned char OneChar ( BPTR file );
  92. int GrabThree ( BPTR file );
  93. int GrabLong ( BPTR file );
  94. void DoSymbolData ( BPTR file );
  95.  
  96. /* do_arguments.c */
  97. void Do_Arguments ( int , char **, long *);
  98.  
  99. /* ninfo.c */
  100. void main ( int argc , char *argv []);
  101. void Dump_Text ( char *tptr , int count );
  102. int Dump_Raw ( BPTR file , int Type , int Words );
  103. int Do_Name ( BPTR file , int Words );
  104. int Dump_Code ( BPTR file , int Words );
  105. int Dump_Virus ( BPTR file );
  106.