Relocating Loader (RLC) Format: Difference between revisions
(→Body) |
|||
Line 62: | Line 62: | ||
In hexadecimal, this would represent the offset 0x035E, or 862 in decimal. | In hexadecimal, this would represent the offset 0x035E, or 862 in decimal. | ||
In order to format as 8085 binary, this is added to the user-requested START address | In order to format as 8085 binary, this is added to the user-requested START | ||
and formatted in little-endian byte order (least significant byte first). | address for the image and formatted in little-endian byte order (least | ||
significant byte first). | |||
=== Trailer === | === Trailer === |
Revision as of 15:15, 20 December 2008
What is RLC
The Model 100 use an 8085 CPU. This CPU does not support position independent machine code, at least in any traditional sense.
Also, the Model 100 has no built-in support for transferring binary machine language files over the serial port.
Presumably for these reasons, the authors of programs residing in the M100SIG on Compuserve created the RLC format. RLC is a representation of an 8085 machine language program that is relocatable and 7-bit clean.
Format
Overview
RLC is an ASCII base-16 representation of an 8085 machine language program. Unlike traditional hexadecimal, however, it uses the ASCII characters
0123456789:;<=>?
It starts with a header, followed by the body, and ending with a checksum. Whitespace is permitted, and most RLC files seem to keep the data less than 128 bytes per line.
Header
The first line starts with (in ASCII format) the number of bytes in the RLC file, followed by the offset within the image to the entry point.
The numeric values are space separated. For example, here is the first line of an RLC file coding for a 7387 byte image, whose entry point is the first byte of the image.
7387 0
It is not clear whether the header needs to be on its own line. It is also unclear whether the first line needs to start with a space.
Body
The body of the RLC file is a sequence of fields and whitespace. Whitespace is generally needed just to separate lines.
The two types of fields are octets and relocation offsets.
Octet
An octet is a two-ASCII-character, base-16 representation of a byte. The high nibble appears first.
No separator between octets is required.
Relocation Offset
A relocation offset is represented by an '@' sign and followed by a big-endian, base-16 representation of an address to be relocated.
@035>
In hexadecimal, this would represent the offset 0x035E, or 862 in decimal.
In order to format as 8085 binary, this is added to the user-requested START address for the image and formatted in little-endian byte order (least significant byte first).