Keil Logo

INTR2 Compiler Directive

Abbreviation

I2

Arguments

None.

Default

The C251 compiler assumes that an interrupt pushes 4 bytes onto the stack: a 24-bit return address and PSW1.

µVision

Options — C251 Compiler — Object — Save PSW1 in interrupt code.

Description

The INTR2 directive informs the C251 compiler that the 251 CPU saves the low order 16 bits of the program counter but does not automatically save PSW1 when entering an interrupt. When INTR2 is used, the C251 compiler generates code that manually saves and restores the PSW1 register in interrupt functions. You must use this directive if you want 8051 compatible behavior.

Example
C251 SAMPLE.C INTR2

#pragma i2
  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.