home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
-
- (C)Copyright 1986-1990; Thuan-Tit Ewe, CompuTech Software Systems,
- Penang 11400, Malaysia.
-
- Sample structure file for heditor. Some features of this file has
- not been implemented yet. Only a limited number of types are supported.
-
- Future revision of heditor may support printing of integers in any base.
-
- ****************************************************************************/
-
- struct DISK_BOOT {
- char jmp[3];
- char OEM[8];
- int Bytes;
- char Sec_c;
- int words;
- char fats;
- int dirs;
- unsigned int secrs;
- unsigned char bytes;
- int sec_fts;
- int sec_tck;
- int head;
- int hid_srs;
- };
-
- (print hex)
- struct OMD_RECORD { /* OMF record */
- ( use hex) char Type; /* type */
- unsigned int Length;
- char Record[ Length - 1];
- (print hex) char Check_Sum;
- };
-
- (print hex) struct COFF_RECORD { (print hex) char Type; char Name[9]; };
-
- struct FILE { /* from microsoft */
- char _ptr;
- int _cnt;
- char _base;
- char _flag;
- char _file;
- };
-
- /* Coff file file header */
- struct filehdr {
- unsigned short f_magic; /* magic number */
- unsigned short f_nscns; /* number of sections */
- long f_timdat; /* time & date stamp */
- long f_symptr; /* file pointer to symtab */
- long f_nsyms; /* number of symtab entries */
- unsigned short f_opthdr; /* sizeof(optional hdr) */
- unsigned short f_flags; /* flags */
- };
-
- struct EXEHEAD
- {
- char sig[2]; /* 4Dh,5Ah - signature */
- unsigned int length; /* Length of load module % 512 */
- unsigned int size; /* Size of program in pages, (512 bytes) */
- unsigned int no_reloc; /* No of relocatible objecs */
- unsigned int header_sz; /* Size of header in para */
- unsigned int min; /* Min memory */
- unsigned int max; /* Max memory */
- unsigned int SS; /* + start segment = SS */
- unsigned int SP; /* */
- unsigned int checksum; /* Negative sum of all words in file */
- unsigned int IP; /* */
- unsigned int CS; /* + start segment = CS */
- unsigned int st_reloc; /* 1 relocatible in bytes */
- unsigned int overlay; /* Overlay number */
- } ;
-
- /* A maximum of 6 structure can be loaded only */
- /* Section headers in COFF files */
- struct scnhdr {
- char s_name[8]; /* section name */
- long s_paddr; /* physical address, aliased s_nlib */
- long s_vaddr; /* virtual address */
- long s_size; /* section size */
- long s_scnptr; /* file ptr to raw data for section */
- long s_relptr; /* file ptr to relocation */
- long s_lnnoptr; /* file ptr to line numbers */
- unsigned short s_nreloc; /* number of relocation entries */
- unsigned short s_nlnno; /* number of line number entries */
- long s_flags; /* flags */
- };
-
-