alien.png TASM Docs -- OBJECT FILE FORMATS

[Previous] [Main] [Next]


Intel Hex Object Format
This is the default object file format. This format is line oriented and uses only printable ASCII characters except for the carriage return/line feed at the end of each line. The format is symbolically represented as:

:NN AAAA RR HH CC CRLF

Where:

:

Record Start Character (colon)  

NN
Byte Count (2 hex digits)  

AAAA
Address of first byte (4 hex digits)  

RR
Record Type (00 except for last record which is 01)  

HH
Data Bytes (a pair of hex digits for each byte of data in the record)  

CC
Check Sum (2 hex digits)  

CRLF
Line Terminator (CR/LF for DOS, LF for LINUX)  

The last line of the file will be a record conforming to the above format with a byte count of zero.

The checksum is defined as:
sum = byte_count+address_hi+address_lo+record_type+(sum of all data bytes) 
checksum = ((-sum) & ffh)

Here is a sample listing file followed by the resulting object file:
0001   0000             
0002   1000                .org   $1000
0003   1000 010203040506   .byte  1, 2, 3, 4, 5, 6, 7, 8
0003   1006 0708
0004   1008 090A0B0C0D0E   .byte  9,10,11,12,13,14,15,16
0004   100E 0F10
0005   1010 111213141516   .byte 17,18,19,20,21,22,23,24,25,26
0005   1016 1718191A
0006   101A                .end
    :181000000102030405060708090A0B0C0D0E0F101112131415161718AC
    :02101800191AA3
    :00000001FF

Intel Hex Word Address Object Format
This format is identical to the Intel Hex Object Format except that the address for each line of object code is divided by two thus converting it to a word address (16 bit word). All other fields are identical.
Here is an example:

:180800000102030405060708090A0B0C0D0E0F101112131415161718AC
:02080C00191AA3
:00000001FF

MOS Technology Hex Object Format
This format is line oriented and uses only printable ASCII characters except for the carriage return/line feed at the end of each line. Each line in the file is of the following format:
:NN AAAA HH CC CRLF

Where:

;

Record Start Character (semicolon)     

NN
Byte Count (2 hex digits)     

AAAA
Address of first byte (4 hex digits)     

HH
Data Bytes (a pair of hex digits for each byte of data in the record)     

CCCC
Check Sum (4 hex digits)     

CRLF
Line Terminator (CR/LF for DOS, LF for LINUX)     

The last line of the file will be a record conforming to the above format with a byte count of zero.
The checksum is defined as:
sum =byte_count+address_hi+address_lo+record_type+(sum of all data bytes)
checksum = (sum & ffffh)


Here is a sample object file:
;1810000102030405060708090A0B0C0D0E0F1011121314151617180154
;021018191A005D
;00

Motorola Hex Object Format
This format is line oriented and uses only printable ASCII characters except for the carriage return/line feed at the end of each line. The format is symbolically represented as:
S1 NN AAAA HH CCCC CRLF

Where:

S1
Record Start tag      

NN
Byte Count (2 hex digits) (data byte count + 3)     

AAAA
Address of first byte (4 hex digits)     

HH
Data Bytes (a pair of hex digits for each byte of data in the record)     

CC
Check Sum (2 hex digits)     

CRLF
Line Terminator (CR/LF for DOS, LF for LINUX)     

The checksum is defined as:
sum = byte_count+address_hi+address_lo+(sum of all data bytes) 
checksum = ((~sum) & ffh)

Here is a sample file:
S11B10000102030405060708090A0B0C0D0E0F101112131415161718A8
S1051018191A9F
S9030000FC

The last line of the file will be a record with a byte count of zero and a tag of S9. The address field will be 0000 unless and address was provided with the END directive in which case it will appear in the address field.

Binary Object Format.
This file format is essentially a memory image of the object code without address, checksum or format description information.
Note that when this object format is selected (-b option), the -c option is forced. This is done so that no ambiguity results from the lack of address information in the file. Without the -c option, discontinuous blocks of object code would appear contiguous.




TASM. Copyright (C) 1998 by Squak Valley Software.
All rights reserved.