ARM Technical Support Knowledge Articles

NOFRAME DIRECTIVE

Applies to: C166 C Compiler

Answer


Information in this article applies to:


QUESTION

Is there a way to get the C166 Compiler to create interrupt routines without the interrupt entry and exit code?

ANSWER

Yes. The NOFRAME directive, abbreviated NOF, suppresses the prolog and epilog for Interrupt Service Routines (ISRs). This directive is active only for one function and must be specified with #pragma.

The prolog and epilog contain code that saves and restores registers used in the ISR.

The NOFRAME directive is useful when you write interrupt functions that never return like resetting the CPU.

The following example illustrates the difference between a standard interrupt frame and one created with the NOFRAME directive.

  1          int i1, i2, i3;
  2
  3          void intr_func1 (void)  interrupt 0x21  {
  4   1        i1 = i2 * i3;
  5   1      }
  6
  7          #pragma NOFRAME
  8          void intr_func2 (void)  interrupt 0x22  {
  9   1        i1 = i2 * i3;
 10   1      }

ASSEMBLY LISTING OF GENERATED OBJECT CODE

; FUNCTION intr_func1 (BEGIN  RMASK = @0x2030)
                                      ; SOURCE LINE # 3
     0000 C6871000      SCXT    MDC,#010H
     0004 EC06          PUSH    MDH
     0006 EC07          PUSH    MDL
     0008 ECF4          PUSH    R4
     000A ECF5          PUSH    R5
                                      ; SOURCE LINE # 4
     000C F2F50000 R    MOV     R5,i3
     0010 F2F40200 R    MOV     R4,i2
     0014 0B45          MUL     R4,R5
     0016 F2F40EFE      MOV     R4,MDL
     001A F6070400 R    MOV     i1,MDL
                                      ; SOURCE LINE # 5
     001E FCF5          POP     R5
     0020 FCF4          POP     R4
     0022 FC07          POP     MDL
     0024 FC06          POP     MDH
     0026 FC87          POP     MDC
     0028 FB88          RETI
; FUNCTION intr_func1 (END    RMASK = @0x2030)

; FUNCTION intr_func2 (BEGIN  RMASK = @0x2030)
                                      ; SOURCE LINE # 8
                                      ; SOURCE LINE # 9
     002A F2F50000 R    MOV     R5,i3
     002E F2F40200 R    MOV     R4,i2
     0032 0B45          MUL     R4,R5
     0034 F2F40EFE      MOV     R4,MDL
     0038 F6070400 R    MOV     i1,MDL
                                      ; SOURCE LINE # 10
     003C FB88          RETI
; FUNCTION intr_func2 (END    RMASK = @0x2030)

Article last edited on: 2000-09-10 00:00:00

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential