Abbreviation |
None. |
Arguments |
None. |
Default |
AREGS |
Description |
The AREGS control
causes the compiler to use absolute register addressing
for registers R0 through R7. Absolute addressing improves
the efficiency of the generated code. For example, PUSH and
POP instructions function only with direct or
absolute addresses. Using the AREGS directive,
functions can directly push and pop registers. |
NOTE
Though it may defined several times in a program, the AREGS option
is valid only when defined outside of a function declaration.
.
.
.
stmt level source
1 extern char func ();
2 char k;
3
4 #pragma NOAREGS
5 noaregfunc () {
6 1 k = func () + func ();
7 1 }
8
9 #pragma AREGS
10 aregfunc () {
11 1 k = func () + func ();
12 1 }
.
.
.
; FUNCTION noaregfunc (BEGIN)
; SOURCE LINE # 6
0000 120000 E LCALL func
0003 EF MOV A,R7
0004 C0E0 PUSH ACC
0006 120000 E LCALL func
0009 D0E0 POP ACC
000B 2F ADD A,R7
000C F500 R MOV k,A
; SOURCE LINE # 7
000E 22 RET
; FUNCTION noaregfunc (END)
; FUNCTION aregfunc (BEGIN)
; SOURCE LINE # 11
0000 120000 E LCALL func
0003 C007 PUSH AR7
0005 120000 E LCALL func
0008 D0E0 POP ACC
000A 2F ADD A,R7
000B F500 R MOV k,A
; SOURCE LINE # 12
000D 22 RET
; FUNCTION aregfunc (END)
.
.
.
MOV A,R7
PUSH ACC