PDATA stack reentrant calling convention

Technical Note 63666

Architectures:

8051

Component:

linker

Updated:

5/31/2018 9:14 AM

Introduction

This Technical Note applies to IAR Embedded Workbench for 8051 version 7.60.

General

Here are some hints to help you configure the PDATA stack reentrant calling convention. You need to modify the .xcl linker configuration file if you want to use this calling convention.

First of all make sure that you place the PDATA stack before other XDATA memory objects. The .xcl file is read and processed top-down by the linker.

Examples:

-D_PDATA0_START=0x0001
-D_PDATA0_END=0x00FF
-D?PBANK_NUMBER=0x00

This will use "page 0" with the address range 0x0001-0x00FF in the XDATA memory. You need to avoid address zero.

-D_PDATA0_START=0x0100
-D_PDATA0_END=0x01FF
-D?PBANK_NUMBER=0x01

This will use "page 1" with the address range 0x0100-0x01FF in the XDATA memory.

-D_PDATA0_START=0x0200
-D_PDATA0_END=0x02FF
-D?PBANK_NUMBER=0x02

This will use "page 2" with the address range 0x0200-0x02FF in the XDATA memory.

Another thing worth doublechecking is the menu:
Project > Options > General Options > Data Pointer > Page register address
where the top byte is stored for the PDATA stack page.
You do not want other data to overwrite this location.

 

All product names are trademarks or registered trademarks of their respective owners.

We do no longer support Internet Explorer. To get the best experience of iar.com, we recommend upgrading to a modern browser such as Chrome or Edge.