home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / HEDITOR.ZIP / SAMPLE.STR < prev   
Text File  |  1990-07-27  |  4KB  |  91 lines

  1. /****************************************************************************
  2.  
  3.     (C)Copyright 1986-1990;    Thuan-Tit Ewe,  CompuTech Software Systems,
  4.                                                    Penang 11400, Malaysia.
  5.  
  6.   Sample structure file for heditor. Some features of this file has
  7.   not been implemented yet. Only a limited number of types are supported.
  8.  
  9.   Future revision of heditor may support printing of integers in any base.
  10.  
  11. ****************************************************************************/
  12.  
  13. struct DISK_BOOT {
  14.   char jmp[3];
  15.   char OEM[8];
  16.   int   Bytes;
  17.   char  Sec_c;
  18.   int   words;
  19.   char  fats;
  20.   int   dirs;
  21.   unsigned int  secrs;
  22.   unsigned char bytes;
  23.   int   sec_fts;
  24.   int   sec_tck;
  25.   int   head;
  26.   int   hid_srs;
  27.   };
  28.  
  29. (print hex)
  30. struct OMD_RECORD {             /* OMF record */
  31.  ( use hex)     char Type;      /* type */
  32.                 unsigned int Length;
  33.                 char Record[ Length - 1];
  34.   (print hex)   char Check_Sum;
  35.                 };
  36.                 
  37. (print hex) struct COFF_RECORD { (print hex) char Type; char Name[9]; };
  38.                 
  39. struct FILE {   /* from microsoft */
  40.     char  _ptr;
  41.     int   _cnt;
  42.     char  _base;
  43.     char  _flag;
  44.     char  _file;
  45.     };
  46.     
  47. /* Coff file file header */
  48. struct filehdr {
  49.         unsigned short  f_magic;        /* magic number */
  50.         unsigned short  f_nscns;        /* number of sections */
  51.         long            f_timdat;       /* time & date stamp */
  52.         long            f_symptr;       /* file pointer to symtab */
  53.         long            f_nsyms;        /* number of symtab entries */
  54.         unsigned short  f_opthdr;       /* sizeof(optional hdr) */
  55.         unsigned short  f_flags;        /* flags */
  56.         };
  57.        
  58. struct EXEHEAD
  59. {
  60.  char          sig[2];         /* 4Dh,5Ah - signature                   */
  61.  unsigned int  length;         /* Length of load module % 512           */
  62.  unsigned int  size;           /* Size of program in pages, (512 bytes) */
  63.  unsigned int  no_reloc;       /* No of relocatible objecs              */
  64.  unsigned int  header_sz;      /* Size of header in  para               */
  65.  unsigned int  min;            /* Min memory                            */
  66.  unsigned int  max;            /* Max memory                            */
  67.  unsigned int  SS;             /* + start segment = SS                  */
  68.  unsigned int  SP;             /*                                       */
  69.  unsigned int  checksum;       /* Negative sum of all words in file     */
  70.  unsigned int  IP;             /*                                       */
  71.  unsigned int  CS;             /* + start segment = CS                  */
  72.  unsigned int  st_reloc;       /* 1 relocatible in bytes                */
  73.  unsigned int  overlay;        /* Overlay number                        */
  74. } ;
  75.  
  76. /* A maximum of 6 structure can be loaded only */
  77. /* Section headers in COFF files */
  78. struct scnhdr {
  79.         char            s_name[8];      /* section name */
  80.         long            s_paddr;        /* physical address, aliased s_nlib */
  81.         long            s_vaddr;        /* virtual address */
  82.         long            s_size;         /* section size */
  83.         long            s_scnptr;       /* file ptr to raw data for section */
  84.         long            s_relptr;       /* file ptr to relocation */
  85.         long            s_lnnoptr;      /* file ptr to line numbers */
  86.         unsigned short  s_nreloc;       /* number of relocation entries */
  87.         unsigned short  s_nlnno;        /* number of line number entries */
  88.         long            s_flags;        /* flags */
  89.         };
  90.  
  91.