$ROMSTART enhanced 2083

Top  Previous  Next

Action

Instruct the compiler to generate a hex/bin file that starts at the specified address.

 

 

Syntax

$ROMSTART = address

 

 

Remarks

Address

The address where the code must start. By default the first address is 0.

 

 

noticeThe $ROMSTART directive is an inheritance from BASCOM-8051. In the AVR it does not have any meaning.

In the 8051 you can use and relocate external memory. This is not possible in the AVR and hence there is no practical usage.

For a bootloader you can use the $LOADER directive.

 

In version 2083 where XTINY is supported the $ROMSTART has a new purpose. Since the boot loading mechanism in the XTINY differs from the other AVR processors, the $ROMSTART can be used to relocate the address.

The memory map starts with the BOOT area, followed by the application area. This means that a boot loader starts at &H0000 and a normal application will start after that.

So in order to use a bootloader, your normal code need to be compiled with the $ROMSTART directive. When the boot loader uses 1024 bytes, it means that the normal application starts at the WORD address which is halve of the byte address and in this case would be &H200 (1024 dec=400 hex).

 

In version 2084 the simulator will also code that uses $ROMSTART.

 

 

See also

$LOADER

 

 

ASM

NONE

 

 

Example

$ROMSTART = &H200 'xtiny boot loader