* location dpl. Therefore we choose return type void here: */
#if defined DSDCC_MODEL_HUGE
void
-_gptrget (char *gptr) _naked
+_gptrget (char *gptr) __naked
{
/* This is the banked version with pointers up to 23 bits.
B cannot be trashed */
gptr; /* hush the compiler */
- _asm
+ __asm
;
; depending on the pointer type acc. to SDCCsymt.h
;
; Pointer to data space
;
mov a,@r0 ; 1
+ dataptrrestore$:
mov r0,dph ; restore r0 ; 2
mov dph,#0 ; restore dph ; 2
ret ; 1
;
pdataptr$:
movx a,@r0 ; 1
- mov r0,dph ; restore r0 ; 2
- mov dph,#0 ; restore dph ; 2
- ret ; 1
+ sjmp dataptrrestore$ ; 2
;
; pointer to code area
;
movx a,@dptr ; 1
ret ; 1
;===
- ;47 bytes
- _endasm ;
+ ;44 bytes
+ __endasm;
}
#elif defined DSDCC_MODEL_MEDIUM
void
-_gptrget (char *gptr) _naked
+_gptrget (char *gptr) __naked
{
/* This is the non-banked version with pointers up to 15 bits.
Assumes B is free to be used */
gptr; /* hush the compiler */
- _asm
+ __asm
;
; depending on the pointer type acc. to SDCCsymt.h
;
ret ; 1
;===
;35 bytes
- _endasm ;
+ __endasm;
}
#elif 1
void
-_gptrget (char *gptr) _naked
+_gptrget (char *gptr) __naked
{
/* This is the new version with pointers up to 16 bits.
B cannot be trashed */
gptr; /* hush the compiler */
- _asm
+ __asm
;
; depending on the pointer type acc. to SDCCsymt.h
;
; Pointer to data space
;
mov a,@r0 ; 1
+ dataptrrestore$:
mov r0,dph ; restore r0 ; 2
mov dph,#0 ; restore dph ; 2
ret ; 1
;
pdataptr$:
movx a,@r0 ; 1
- mov r0,dph ; restore r0 ; 2
- mov dph,#0 ; restore dph ; 2
- ret ; 1
+ sjmp dataptrrestore$ ; 2
;
; pointer to code area, max 16 bits
;
movx a,@dptr ; 1
ret ; 1
;===
- ;30 bytes
- _endasm ;
+ ;27 bytes
+ __endasm;
}
#else
void
-_gptrget (char *gptr) _naked
+_gptrget (char *gptr) __naked
{
/* This is the old version with pointers up to 16 bits. */
gptr; /* hush the compiler */
- _asm
+ __asm
;
; depending on the pointer type acc. to SDCCsymt.h
;
ret ; 1
;===
;40 bytes
- _endasm ;
+ __endasm;
}
#endif
/* This is the new version */
gptr; /* hush the compiler */
- _asm
+ __asm
;
; depending on the pointer type acc. to SDCCsymt.h
;
mov r0,dph ; restore r0
mov dph,#0 ; restore dph
00006$:
- _endasm ;
+ __endasm;
}
{
gptr; /* hush the compiler */
- _asm
+ __asm
;
; depending on the pointer type acc. to SDCCsymt.h
;
00005$:
pop ar0
00006$:
- _endasm ;
+ __endasm;
}
#endif