SiriusHardware
Veteran Member
Intel Hex files by their very nature allow for the possibility of two or more distinct blocks of code which are intended to reside in different areas of memory without having to bridge or fill the gaps in between with padding code.
In your source code you would use ORG statements to define the start of each distinct block of code, and then if you have the assembler produce the output as Intel Hex, the Intel Hex code will contain the addresses to which the loader should direct the code.
For example if you assemble this bit of nonsense code and generate the output as Intel Hex
ORG 0100h
DEFB 00h, 01h, 02h, 03h, 04h, 05h, 06h, 07h
ORG 0200h
DEFB 08h, 09h, 0Ah, 0Bh, 0Ch. 0Dh, 0Eh, 0Fh
The loader will (or should) load the first 8 bytes into 0100-0107 and the second 8 bytes into 0200-0207 without any padding code in between.
In your source code you would use ORG statements to define the start of each distinct block of code, and then if you have the assembler produce the output as Intel Hex, the Intel Hex code will contain the addresses to which the loader should direct the code.
For example if you assemble this bit of nonsense code and generate the output as Intel Hex
ORG 0100h
DEFB 00h, 01h, 02h, 03h, 04h, 05h, 06h, 07h
ORG 0200h
DEFB 08h, 09h, 0Ah, 0Bh, 0Ch. 0Dh, 0Eh, 0Fh
The loader will (or should) load the first 8 bytes into 0100-0107 and the second 8 bytes into 0200-0207 without any padding code in between.