11.4.1 V.1.01 and Later Versions (Compatibility with V.1.00)

(1)

Changing Specifications of Intrinsic Functions

For intrinsic functions having parameters or return values that indicate addresses, their type is changed from the conventional unsigned long to void *. The changed functions are shown in Table 11.1.

Table 11.1

List of Intrinsic Functions Whose Type is Changed

No.

Item

Specification

Function

Changed Contents

Item

Details

1

User stack pointer (USP)

void set_usp(void *data)

USP setting

Parameter

unsigned long void *

2

void *get_usp(void)

USP reference

Return value

unsigned long void *

3

Interrupt stack pointer (ISP)

void set_isp(void *data)

ISP setting

Parameter

unsigned long void *

4

void *get_isp(void)

ISP reference

Return value

unsigned long void *

5

Interrupt table register (INTB)

void set_intb (void *data)

INTB setting

Parameter

unsigned long void *

6

void *get_intb(void)

INTB reference

Return value

unsigned long void *

7

Backup PC (BPC)

void set_bpc(void *data)

BPC setting

Parameter

unsigned long void *

8

void *get_bpc(void)

BPC reference

Return value

unsigned long void *

9

Fast interrupt vector register (FINTV)

void set_fintv(void *data)

FINTV setting

Parameter

unsigned long void *

10

void *get_fintv(void)

FINTV reference

Return value

unsigned long void *

Due to this change, a program using the above functions in V.1.00 may generate a warning or an error about invalid types. In this case, add or delete the cast to correct the types.

An example of a startup program normally used in V.1.00 is shown below. This example will output warning message W0520167 in V.1.01, but this warning can be avoided by deleting the cast to correct the type.

Example

[Usage example of set_intb function]

#include <machine.h>
#pragma entry Reset_Program
void PowerON_Reset_PC(void)
{
     ...
     set_intb((unsigned long)__sectop("C$VECT")); //Warning W0520167 is output
     ...
}

 

[Example of code changed to match V.1.01]

#include <machine.h>
#pragma entry Reset_Program
void PowerON_Reset_PC(void)
{
        ...
        set_intb(__sectop("C$VECT")); //Cast (unsigned long) is deleted
        ...
}

 

(2)

Adding Section L (section Option and Start Option)

V.1.01 is provided with section L which is used for storing literal areas, such as, string literal.

Since the number of sections has increased and section L is located at the end at linkage, the optimizing linkage editor may output address error F0563100 in some cases.

To avoid such an error, adopt either one of the following methods.

(a)

Add L to the section sequence specified with the Start option of the optimizing linkage editor at linkage.

Example

[Example of specification in V.1.00]

-start=B_1,R_1,B_2,R_2,B,R,SU,SI/01000,PResetPRG/0FFFF8000,C_1,C_2,C,C$*,D*,P,
PIntPRG,W*/0FFFF8100,FIXEDVECT/0FFFFFFD0

 

[Changed example (L is added after C)]

-start=B_1,R_1,B_2,R_2,B,R,SU,SI/01000,PResetPRG/0FFFF8000,C_1,C_2,C,L,C$*,D*,
P,PIntPRG,W*/0FFFF8100,FIXEDVECT/0FFFFFFD0

 

(b)

Select -section=L=C at compilation.

By specifying -section=L=C at compilation, the output destination of the literal area is changed to section C, and a section configuration compatible with V.1.00 can be achieved.
Note that this method may affect code efficiency compared to the above method of changing the Start option at linkage.