|
| SAVEMAC Compiler Directive| Abbreviation | | SM | | Arguments | | None. | | Default | | The C166 Compiler does not save MAC registers for interrupt functions. | | µVision | | Options — C166 — Misc Controls. | | Description | | The SAVEMAC directive directs the C166 Compiler to save all MAC co-processor registers during interrupt functions. | | See Also | | MAC, NOSAVEMAC | | Example | |
C166 SAMPLE.C SAVEMAC
The following example:
stmt lvl source
1 void irq_func1 (void) interrupt 1 {
2 1 ;
3 1 }
demonstrates code generated using the SAVEMAC directive: Code Generated With SAVEMAC |
|---|
; FUNCTION irq_func1
1: void irq_func1 (void) interrupt 1 {
0002 EC2E PUSH MAL
0004 EC2F PUSH MAH
0006 C6ED0000 SCXT MRW,#00H
000A EC84 PUSH IDX0
000C EC85 PUSH IDX1
000E EC02 PUSH QR0
0010 EC03 PUSH QR1
0012 EC00 PUSH QX0
0014 EC01 PUSH QX1
0016 ECEE PUSH MCW
2: ;
0018 FCEE POP MCW
001A FC01 POP QX1
001C FC00 POP QX0
001E FC03 POP QR1
0020 FC02 POP QR0
0022 FC85 POP IDX1
0024 FC84 POP IDX0
0026 FCED POP MRW
0028 FC2F POP MAH
002A FC2E POP MAL
002C FCEF POP MSW
002E FB88 RETI
3: }
| | CODE SIZE: 48 Bytes |
| Code Generated With NOSAVEMAC |
|---|
; FUNCTION irq_func1
1: void irq_func1 (void) interrupt 1 {
2: ;
0000 FB88 RETI
3: }
| | CODE SIZE: 2 Bytes |
|
Note - When both the NOSAVEMAC directive and the MAC directives are used, the compiler saves a reduced context of MAC co-processor registers ( IDX0, MRW, MAH, MAL, MSW).
- When the MAC directive is not used and the NOSAVEMAC directive is used, no MAC co-processor registers are saved in interrupts.
|
|
|