Keil Logo

MAP

The MAP command allows specifying memory areas that are not detected automatically by µVision. If applications use memory-mapped I/O devices or access the memory dynamically through pointers, developers might need making changes to the memory map. µVision checks each memory access and throws a memory access violation message in the Command window when an invalid access is made.

Syntax Description
MAP Displays the current memory map.
MAP startAddrendAddr
READ WRITE EXEC
VNM
Maps the specified memory range, from startAddr to endAddr, and defines the access rights (read, write, and execution). The memory map supports 1-byte granularity.

The VNM option identifies the memory range as a von Neumann memory, and can be used with 80x51 microcontrollers. When VMN is specified with an address range, µVision overlaps the external data memory (XDATA) and code memory. Write access to external data memory also changes the code memory. A memory range specified as VNM cannot be a range from the code area and may not cross a 64K boundary. The address range specified must be from the external data area.

MAP startAddr, endAddr CLEAR Clears a mapped memory range that was defined previously with the MAP command.

When µVision loads, the following memory maps are defined.

CPU Address Range Access
8051 Family 0x000000-0x0000FF (DATA) READ WRITE
  0x010000-0x01FFFF (XDATA) READ WRITE
  0xFF0000-size of code (CODE) EXEC READ
251 Family 0x000000-0x00041F (DATA) READ WRITE
  0x008000-0x008010 (CODE BANK) EXEC READ
  0x010000-0x01FFFF (XDATA) READ WRITE
  0xFF0000-0xFFFFFF (CODE) EXEC READ
166 Family 0x000000-0x00FFFF EXEC READ WRITE

µVision supports up to 16MB of memory for 80x51 and 166 microcontrollers. This memory is divided into 256 segments of 64K each. The default 8051 and 251 memory spaces are assigned by µVision to the segments with the numbers listed in the following table.

Segment Value Memory Space
0x00 MCS-51 DATA segment, 0x00:0x0000—0x00:0x00FF.
MCS-251 EDATA segment, 0x00:0x0000-0x00:0xFFFF.
0x01 MCS-51 and MCS-251 XDATA segment 0x01:0x0000-0x01:0xFFFF.
0x80-0x9F MCS-51 and MCS-251 Code Bank 0 through Code Bank 31.
0x80 Code Bank 0, 0x81 Code Bank 1, etc.
0xFE MCS-51 and MCS-251 PDATA segment 0xFE:0x0000-0xFE:0x00FF.
0xFF MCS-51 and MCS-251 CODE segment 0xFF:0x0000-0xFF:0xFFFF.

For security reasons and for detecting illegal memory accesses, it is recommended to map only the required memory areas. In addition, mapping huge amounts of memory could slow down the execution speed of µVision.

Note

  • Mapping less than 256 bytes of XDATA for 8051-compatible devices may cause problems. The 8051 supports a fast method of accessing 256 bytes of XDATA using the MOVX @Ri instructions. When more than 256 XDATA bytes are mapped, µVision uses the contents of P2 and P0 to resolve the full 16-bit address. When fewer than 256 XDATA bytes are mapped, µVision uses only the contents of P0, and P2 is ignored. Therefore, XDATA memory must start at the beginning of a segment (by default is 0x01:0x0000 to 0x01:0x00FF).
  • For 80x51 microcontrollers, the startAddr and endAddr can contain a Memory Type Specifier.
  • The command RESET MAP clears all mapped segments and restores the default mapping.
  • The dialog Memory Map shows the memory mapping in a window.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.