Appendix: | Specification of Object File Formats |
The KyteLabs 8-bit crossassemblers are designed to output three different kinds of object file formats: |
|
|
The output format is independent of the selected microprocessor or controller type and can be controlled by an assembler option parameter.
|
|
The Intel Hex Record Format
Field Name: Record |
SR Start |
RL Length |
ADDR Address |
RT Type |
DATA Information |
CS Checksum |
Field Size: |
1 |
2 |
4 |
2 |
0-255 |
2 |
Example: |
: |
07 |
00F0 |
00 |
8818490F680D1D |
7F |
|
SR |
Start Record Field (frame 0) |
|
The ASCII character colon (:) is used to signal the start of a record. |
RL |
Record Length Field (frames 1 and 2) |
|
The number of data bytes in the record (contents of DATA field) is represented by two ASCII hexadecimal digits. |
ADDR |
Load Address (Offset) Field (frames 3 to 6) |
|
Four ASCII hexadecimal digits specify the address (offset) to/from which data will be loaded/saved, where the leading two digits are standing for the most significant byte of the 16-bit address. In conjunction with separate address records, it is interpreted as an address offset. Where this field is not used (others than Data Records), it should be coded as four ASCII zero characters "0000". |
RT |
Record Type Field (frames 7 and 8) |
|
The ASCII hexadecimal digits in this field specify one of the record types shown in table Intel Hex Record Types |
DATA |
Data Field |
|
Each pair of frames in the data field represents a data byte, where each frame contains the ASCII representation of a 4-bit value. The interpretation of this field depends on the RT field. |
CS |
Checksum Field |
|
This field contains the ASCII representation of the two's complement of the record checksum, calculated by adding all data bytes of the record from and including the RL, ADDR, RT, and DATA fields (each pair of field frames converted to one binary byte), modulo 256. Therefore, the sum of all the ASCII pairs in a record after converting to binary, from the RL field to and including the CS field, is zero. |
|
Intel Hex Record Types
Record Type |
Description |
00 |
Data Record |
01 |
End-of-File Record |
02 |
Extended Segment Address Record |
03 |
Start (Segment) Address Record (entry point) |
04 |
Extended Linear Address Record |
05 |
Start Linear Address Record (entry point) |
|
The only record types used with the 8-bit crossassemblers are: |
Data Record (type 00) |
Example: | :0700F0008818490F680D1D7F |
End-of-File Record (type 01) |
Using an unique encoding where RL="00", ADDR="0000", RT="01", and DATA field is empty. |
Example: | :00000001FF
|
|
The Motorola S-Record Format
Field Name: Record |
SR Start |
RT Type |
RL Length |
ADDR Address |
DATA Information |
CS Checksum |
Field Size: |
1 |
1 |
2 |
4 |
0-252 |
2 |
Example: |
S |
1 |
0A |
00F0 |
8818490F680D1D |
7B |
|
SR |
Start Record Field (frame 0) |
|
The ASCII character 'S' is used to signal the start of a record. |
RT |
Record Type Field (frame 1) |
|
The ASCII character in this field specifies one of the record types shown in table Motorola S-Record Types |
RL |
Record Length Field (frames 2 and 3) |
|
The number of data bytes in the record is represented by two ASCII hexadecimal digits, counting from and including the ADDR field to and including the CS field. |
ADDR |
Load Address Field (frames 4 to 7) |
|
Four ASCII hexadecimal digits specify the address to/from which data will be loaded/saved, where the leading two digits are standing for the most significant byte of the 16-bit address. |
DATA |
Data Field |
|
Each pair of frames in the data field represents a data byte, where each frame contains the ASCII representation of a 4-bit value. |
CS |
Checksum Field |
|
This field contains the ASCII representation of the one's complement of the record checksum, calculated by adding all data bytes of the record from and including the RL, ADDR, and DATA fields (each pair of field frames converted to one binary byte), modulo 256. |
|
Motorola S-Record Types
Record Type |
Description |
1 |
Data Record (16-bit load address) |
2 |
Data Record (24-bit load address) |
3 |
Data Record (32-bit load address) |
7 |
End-of-Code Record (32-bit transfer address) |
8 |
End-of-Code Record (24-bit transfer address) |
9 |
End-of-Code Record (16-bit transfer address) |
X |
Symbol Record |
|
The only record types used with the 8-bit crossassemblers are: |
Data Record (type 1) |
Example: | S10A00F08818490F680D1D7D |
End-of-Code Record (type 9) |
Using only the SR and RT fields if no transfer address (entry point) is specified, otherwise an additional ADDR field is holding the transfer address. All other fields are remaining empty. |
Example: | S9 (no transfer address), S9A004 (transfer address = A004 hex) |
Symbol Record (type X) |
The
Symbol Record is not officially supported by Motorola, but is being used in conjunction with emulators and source-level debuggers to show correct symbol names and to specify the address or name space the symbol belongs to.
This record type is using a special syntax:
SX <symbol value> <symbol name> [*<name space specifier> @<address space specifier>].
|
Example: | SX 00F0 start *668 @0110. |