
ML66517 Family User’s Manual
Chapter 2
CPU Architecture
2 – 3
If the LROM bit is set to “1”, the memory space expansion is actually enabled after execution of the instruction
that follows the LROM bit write instruction.
Programming examples to expand the program memory space are listed below.
(Medium memory space is only for the ML66517/ML66Q517.)
SMALL memory space (64KB program memory space, 64KB data memory space)
MOVB
MEMSACP, #50H
MOVB
MEMSACP, #0A0H
MOVB
MEMSCON, #00H (initial value)
MEDIUM memory space (128KB program memory space, 64KB data memory space)
MOVB
MEMSACP, #50H
MOVB
MEMSACP, #0A0H
MOVB
MEMSCON, #02H
MEMSCON can be written only once after reset (due to a
RES input, BRK instruction execution, watchdog
timer overflow, or opcode trap). Therefore, to change the memory space model once set to the other, reset and
write again to the MEMSCON.
2.2.2 Program Memory Space
The Program Memory Space is also called “ROM space”. A maximum of 128KB (131,072 bytes) of program
memory can be accessed in 64KB (65,536 bytes) unit segments of segment 0 and 1 for the
ML66517/ML66Q517. However, if more than 64KB (segment 1) is to be accessed, the LROM bit of the
MEMSCON (memory size control register) SFR must be set to “1”.
The code segment register (CSR) specifies the segment to be used, and the program counter (PC) specifies the
address in the segment. However, the segment to be used in the execution of ROM table reference instructions
(such as LC A, obj) and the ROM window function is specified by the table segment register (TSR).
The 64KB (65,536 bytes) area in segment 0 constitutes the internal ROM area and the 64 KB area in segment 1
forms the external ROM area.
The following areas are assigned to segment 0:
Vector table area (84 bytes)
VCAL table area (32 bytes)
In addition, the following area is assigned to each segment.
ACAL area (2,048 bytes)
Figure 2-3 shows a memory map of the program memory space.