Keil Logo

MAP

Syntax Description
MAP Displays the current memory map.
MAP start, end READ WRITE EXEC VNM Maps the specified memory range (start-end) accesses as specified.
MAP start, end CLEAR Clears a mapped memory range.

Target programs you debug with µVision3 access and use memory. µVision3 uses the symbol information in your target program to automatically setup the memory map for most applications. The MAP command lets you specify the memory areas your program uses that are not automatically detected by µVision3.

When you run your target program, µVision3 checks each memory access to determine if it is outside the memory map. If an invalid access is made, µVision3 reports an access violation error. This helps you locate and correct memory problems in your program.

Note

  • If your program uses memory-mapped I/O devices or dynamically accesses memory through pointers, you may need to make changes to the memory map.

You specify an address range with the MAP command along with the accesses allowed for that range. Read (READ), write (WRITE), and execution (EXEC) accesses (or any combination) may be specified. The memory map supports 1-byte granularity.

The VNM option identifies the specified memory range as von Neumann memory. When VMN is specified with an address range, µVision3 overlaps external data memory (XDATA) and code memory. Write accesses to external data memory also change code memory. Memory ranges specified with VNM may not 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.

The MAP command, when entered with no other parameters, displays the current memory map for your target program. This lets you check your memory map settings.

The CLEAR option lets you remove an address range previously specified with the MAP command.

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

CPU Address Range Access
8051 Family 0x000000-0x00FFFF (DATA) READ WRITE
  0x010000-0x01FFFF (XDATA) READ WRITE
  0xFF0000-0xFFFFFF (CODE) EXEC READ
251 Family 0x000000-0x00FFFF (DATA) READ WRITE
  0x010000-0x01FFFF (XDATA) READ WRITE
  0xFF0000-0xFFFFFF (CODE) EXEC READ
166 Family 0x000000-0x00FFFF EXEC READ WRITE

µVision3 supports up to 16MB of memory. This memory is divided into 256 segments of 64K each. The default 8051 and 251 memory spaces are assigned by µVision3 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.

Although µVision3 supports up to 16MB of target program memory, only the memory ranges required should be mapped. µVision3 requires two copies of each block allocated in the memory map. One copy holds the data used for reading, writing, and execution. Another copy holds the specific attributes such as access permissions and information for code coverage and performance analysis. For this reason, mapping huge amounts of memory may slow down the execution speed of µVision3 since disk swapping may be required.

The RESET MAP command clears all mapped segments and restores the default mapping shown above. Refer to RESET for more information.

You may also use the Memory Map dialog to review and change the memory mapping. This dialog opens via the main menu Debug – Memory Map....

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, µVision3 uses the contents of P2 and P0 to resolve the full 16-bit address. When fewer than 256 XDATA bytes are mapped, µVision3 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).

Related Knowledgebase Articles

  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.