                                MESSAGE     "ELF-header included to file offset ", $$

ELF_Start:                      DB          7Fh, "ELF"                          ; indentifier
                                DB          1                                   ; File Class: 1=32bit, 2=64bit objects
                                DB          1                                   ; Data Encoding: 1=ELFDATA2LSB, 2=ELFDATA2MSB
                                DB          1                                   ; ELF header version (must be 1)
                                DB          0, 0, 0, 0, 0, 0, 0, 0, 0
                                DH          2                                   ; ELF type: 0=NONE, 1=REL, 2=EXEC, 3=SHARED, 4=CORE
                                DH          8                                   ; Processor: 8=MIPS
                                DW          1                                   ; Version: 1=current
                                DW          code.main                           ; Entry point address
                                DW          Program_Headers-ELF_Start           ; Start of program headers (offset from file start)
                                DW          Section_Headers-ELF_Start           ; Start of section headers (offset from file start)
                                DW          20924001h                           ; Processor specific flags = 0x20924001 noreorder, mips
                                DH          52                                  ; ELF header size (0x34 = 52 bytes)
                                DH          20h                                 ; Program headers entry size
                                DH          1                                   ; Number of program headers
                                DH          0                                   ; Section headers entry size
                                DH          0                                   ; Number of section headers
                                DH          0                                   ; Section header stringtable index

Program_Headers:                DW          1                                   ; Segment type:
                                                                                ; 0=Inactive
                                                                                ; 1=Load the segment into memory, no. of bytes specified by 0x10 and 0x14
                                                                                ; 2=Dynamic linking
                                                                                ; 3=Interpreter. The array element must specify a path name
                                                                                ; 4=Note. The array element must specify the location and size of aux. info
                                                                                ; 5=reserved
                                                                                ; 6=The array element must specify location and size of the program header table.
                                                                                ; 0x70000000 - 0x7fffffff processor specific semantics
                                DW          code._fofs                          ; Offset from file start to program segment.
                                DW          code._ofs                           ; Virtual address of the segment
                                DW          code._ofs                           ; Physical address of the segment
                                DW          code._fsize                         ; Number of bytes in the file image of the segment
                                DW          ((code._size+15)>>4)<<4             ; Number of bytes in the memory image of the segment
                                DW          0h                                  ; Flags for segment
                                DW          0h                                  ; Alignment. The address of 0x08 and 0x0C must fit this alignment. 0=no alignment

Section_Headers:                DW          0                                   ; No. to the index of the Section header stringtable index
                                DW          0                                   ; Type:
                                                                                ; 0=Inactive
                                                                                ; 1=PROGBITS
                                                                                ; 2=SYMTAB symbol table
                                                                                ; 3=STRTAB string table
                                                                                ; 4=RELA relocation entries
                                                                                ; 5=HASH hash table
                                                                                ; 6=DYNAMIC dynamic linking information
                                                                                ; 7=NOTE
                                                                                ; 8=NOBITS
                                                                                ; 9=REL relocation entries
                                                                                ; 10=SHLIB
                                                                                ; 0x70000000=LOPROC processor specifc
                                                                                ; 0x7fffffff=HIPROC
                                                                                ; 0x80000000=LOUSER lower bound
                                                                                ; 0xffffffff=HIUSER upper bound
                                DW          0                                   ; Section Flags:  (1 bit, you may combine them like 3 = alloc & write permission)
                                                                                ; 1=Write section contains data the is be writeable during execution.
                                                                                ; 2=Alloc section occupies memory during execution
                                                                                ; 4=Exec section contains executable instructions
                                                                                ; 0xf0000000=Mask bits processor-specific
                                DW          0                                   ; Section start address
                                DW          0                                   ; Offset from start of file to section
                                DW          0                                   ; Size of section
                                DW          0                                   ; Section header table index link
                                DW          0                                   ; Info
                                DW          0                                   ; Alignment. The adress of 0x0C must fit this alignment. 0=no alignment.
                                DW          0                                   ; Fixed size entries.
                                DW          65526977h
