Example 16. MEMORY Directive With Overlay Pages

MEMORY { PAGE 0 : RAM :origin = 0x0800, length = 0x0240 : PROG :origin = 0x2C00, length = 0xD200 PAGE 1 : OVR_MEM :origin = 0x0A00, length = 0x2200 : DATA :origin = 0x2C00, length = 0xD400 PAGE 2 : OVR_MEM :origin = 0x0A00, length = 0x2200 }

Example 16 defines three separate address spaces.

Both OVR_MEM ranges cover the same address range. This is possible because each range is on a different page and therefore represents a different memory space.