Sometimes two variables are meant to use the same RAM: parts of a program that are never in use at
the same time can be purposely allocated to the same locations, to make the most of a chip’s RAM.
Override, written straight after At location, tells the compiler that the overlap is intended,
so the warning is not shown for that variable:
// A 512-byte buffer that is only used while USB is running ...
Dim USBBuffer As Alloc * 512 At 0x400 Override
// ... and a file list that is only used while USB is not running, in the same RAM
Dim FileNames(768) As Byte At 0x400 Override
Dim FileKinds(64) As Byte At 0x400 + 769 OverrideOverrideapplies to the oneDimit is written on. EveryDimin an intended overlap must sayOverrideitself - the first one too: the compiler, not the order in the source, decides which variable is given the location first, and the warning is shown for the others. ADimthat overlaps withoutOverridestill gives the warning, so an accidental overlap is not hidden.Overridemust followAt location. Written withoutAt, it is an error:OVERRIDE can only follow AT <location> in a DIM.- With an initial value,
Overridecomes before it:Dim Counter As Byte At 0x400 Override = 0. - The location can be a calculation of constants, such as
At USB_RAM_START + 769. Writing every overlapping location relative to one constant keeps the layout correct when that constant changes. - The compiler cannot know when each part is in use: making sure the overlapping variables are never needed at the same time is up to the program.

