* pic16_groupRegistersInSection): handle symbols declared to be in
access bank differently,
* src/pic16/gen.c (struct _G): added field resDirect,
* (aopForSym): if symbol on stack and iCode is '=' and result exists,
send values read from stack directly to result and don't allocate
temporary values,
* (pic16_sameRegs): fixed bug that allowed MOVFF to move between
same registers,
* (pic16_sameRegsOfs): NEW,
* (freeAsmop): if _G.resDirect is set then do not mark registers as
free because they were not allocated from temporary pool,
* pic16_popRegFromString): workaround to fix a problem with
allocating variables twice or never,
* (genGenPointerGet): using PRODL instead of FSR0H,
* (genGenPointerSet): using POSTDEC1 (that is a stack location)
instead of FSR0H,
* (genAssign): take advantage of the _G.resDirect flag,
* (genCast): around line 11844, use mov2f instead of directly
MOVFF'ing between operands to account for literal values,
* src/pic16/genutils.c: some new debug functions for gpsim have been
added,
* src/pic16/glue.c (pic16_printIvalType): fixed bug that initialized
float with integer part only,
* src/pic16/main.c (_process_pragma): handle pragma udata access to
place variables in access bank
* device/lib/pic16/libsdcc/gptr/gptr*.c: using BRA instead of GOTO,
updated sources to reflect recent changes in gen.c
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3527
4a8a32a2-be11-0410-ad9d-
d568d2c75423
gptrput2 \
gptrput3 \
gptrput4
-
+
include ../Makefile.rules
+#OFILES += gptrcommon.o
+
+
all: build-library
+#gptrcommon.o: gptrcommon.S
+# $(AS) -c $< -o $@
+
build-library: $(OFILES)
# @$(CP) -v $(OFILES) ../../bin
*/
/* the return value is expected to be in WREG, therefore we choose return
- * type void here. Generic pointer is expected to be in WREG:FSR0H:FSR0L,
+ * type void here. Generic pointer is expected to be in WREG:PRODL:FSR0L,
* so function arguments are void, too */
extern POSTINC0;
+extern POSTINC1;
+extern PREINC1;
extern INDF0;
extern FSR0L;
extern FSR0H;
extern TABLAT;
extern PRODL;
+
void _gptrget1(void) _naked
{
_asm
* 11 -> unimplemented
*/
btfss _WREG, 7
- goto _lab_01_
+ bra _lab_01_
- /* data pointer */
- /* data are already in FSR0 */
+ ; data pointer
+ ; data are already in FSR0
+ movff _PRODL, _FSR0H
- /* debug info */
movf _POSTINC0, w
return
_lab_01_:
- /* code or eeprom */
+ ; code or eeprom
btfsc _WREG, 6
- goto _lab_02_
+ bra _lab_02_
; code pointer
+ movff _FSR0L, _TBLPTRL
+ movff _PRODL, _TBLPTRH
movwf _TBLPTRU
- movff _FSR0L, _TBLPTRL
- movff _FSR0H, _TBLPTRH
- TBLRD*
+ tblrd*+
- /* result in TBLAT */
+ ; result in WREG
movf _TABLAT, w
return
_lab_02_:
- /* EEPROM pointer */
+ ; EEPROM pointer
- /* unimplemented yet */
+ ; unimplemented yet
_end_:
*/
/* the return value is expected to be in WREG:PRODL, therefore we choose return
- * type void here. Generic pointer is expected to be in WREG:FSR0H:FSR0L,
+ * type void here. Generic pointer is expected to be in WREG:PRODL:FSR0L,
* so function arguments are void, too */
extern POSTINC0;
* 11 -> unimplemented
*/
btfss _WREG, 7
- goto _lab_01_
+ bra _lab_01_
/* data pointer */
/* data are already in FSR0 */
+ movff _PRODL, _FSR0H
+
movf _POSTINC0, w
movff _POSTINC0, _PRODL
_lab_01_:
/* code or eeprom */
btfsc _WREG, 6
- goto _lab_02_
+ bra _lab_02_
; code pointer
- movwf _TBLPTRU
movff _FSR0L, _TBLPTRL
- movff _FSR0H, _TBLPTRH
+ movff _PRODL, _TBLPTRH
+ movwf _TBLPTRU
/* fetch first byte */
TBLRD*+
*/
/* the return value is expected to be in WREG:PRODL:PRODH, therefore we choose return
- * type void here. Generic pointer is expected to be in WREG:FSR0H:FSR0L,
+ * type void here. Generic pointer is expected to be in WREG:PRODL:FSR0L,
* so function arguments are void, too */
extern POSTINC0;
* 11 -> unimplemented
*/
btfss _WREG, 7
- goto _lab_01_
+ bra _lab_01_
/* data pointer */
/* data are already in FSR0 */
+ movff _PRODL, _FSR0H
+
movf _POSTINC0, w
movff _POSTINC0, _PRODL
movff _POSTINC0, _PRODH
_lab_01_:
/* code or eeprom */
btfsc _WREG, 6
- goto _lab_02_
+ bra _lab_02_
; code pointer
- movwf _TBLPTRU
movff _FSR0L, _TBLPTRL
- movff _FSR0H, _TBLPTRH
+ movff _PRODL, _TBLPTRH
+ movwf _TBLPTRU
/* fetch first byte */
TBLRD*+
*/
/* the return value is expected to be in WREG:PRODL, therefore we choose return
- * type void here. Generic pointer is expected to be in WREG:FSR0H:FSR0L,
+ * type void here. Generic pointer is expected to be in WREG:PRODL:FSR0L,
* so function arguments are void, too */
extern POSTINC0;
* 11 -> unimplemented
*/
btfss _WREG, 7
- goto _lab_01_
+ bra _lab_01_
/* data pointer */
/* data are already in FSR0 */
+ movff _PRODL, _FSR0H
+
movf _POSTINC0, w
movff _POSTINC0, _PRODL
movff _POSTINC0, _PRODH
_lab_01_:
/* code or eeprom */
btfsc _WREG, 6
- goto _lab_02_
+ bra _lab_02_
; code pointer
- movwf _TBLPTRU
movff _FSR0L, _TBLPTRL
- movff _FSR0H, _TBLPTRH
+ movff _PRODL, _TBLPTRH
+ movwf _TBLPTRU
/* fetch first byte */
TBLRD*+
** $Id$
*/
-/* write address is expected to be in WREG:FSR0H:FSR0L while
- * write value is in TBLPTRL:TBLPTRH:PRODH:PRODL */
+/* write address is expected to be in WREG:PRODL:FSR0L while
+ * write value is in TBLPTRL:TBLPTRH:PRODH:[stack] */
extern POSTINC0;
+extern PREINC1;
extern INDF0;
extern FSR0L;
extern FSR0H;
* 11 -> unimplemented
*/
btfss _WREG, 7
- goto _lab_01_
+ bra _lab_01_
/* data pointer */
/* data are already in FSR0 */
- movff _PRODL, _POSTINC0
+ movff _PRODL, _FSR0H
+
+ movff _PREINC1, _POSTINC0
return
** $Id$
*/
-/* write address is expected to be in WREG:FSR0H:FSR0L while
- * write value is in TBLPTRL:TBLPTRH:PRODH:PRODL */
+/* write address is expected to be in WREG:PRODL:FSR0L while
+ * write value is in TBLPTRL:TBLPTRH:PRODH:[stack] */
extern POSTINC0;
+extern PREINC1;
extern INDF0;
extern FSR0L;
extern FSR0H;
extern TABLAT;
extern PRODL;
extern PRODH;
+extern _GPTRREG;
void _gptrput2(void) _naked
{
* 11 -> unimplemented
*/
btfss _WREG, 7
- goto _lab_01_
+ bra _lab_01_
/* data pointer */
/* data are already in FSR0 */
- movff _PRODL, _POSTINC0
+ movff _PRODL, _FSR0H
+
+ movff _PREINC1, _POSTINC0
movff _PRODH, _POSTINC0
return
*/
/* write address is expected to be in WREG:FSR0H:FSR0L while
- * write value is in TBLPTRH:TBLPTRL:PRODH:PRODL */
+ * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */
extern POSTINC0;
+extern PREINC1;
extern INDF0;
extern FSR0L;
extern FSR0H;
extern TABLAT;
extern PRODL;
extern PRODH;
+extern _GPTRREG;
void _gptrput3(void) _naked
{
* 11 -> unimplemented
*/
btfss _WREG, 7
- goto _lab_01_
+ bra _lab_01_
/* data pointer */
/* data are already in FSR0 */
- movff _PRODL, _POSTINC0
+ movff _PRODL, _FSR0H
+
+ movff _PREINC1, _POSTINC0
movff _PRODH, _POSTINC0
movff _TBLPTRL, _POSTINC0
*/
/* write address is expected to be in WREG:FSR0H:FSR0L while
- * write value is in TBLPTRH:TBLPTRL:PRODH:PRODL */
+ * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */
extern POSTINC0;
+extern PREINC1;
extern INDF0;
extern FSR0L;
extern FSR0H;
extern TABLAT;
extern PRODL;
extern PRODH;
+extern _GPTRREG;
void _gptrput4(void) _naked
{
* 11 -> unimplemented
*/
btfss _WREG, 7
- goto _lab_01_
+ bra _lab_01_
/* data pointer */
/* data are already in FSR0 */
- movff _PRODL, _POSTINC0
+ movff _PRODL, _FSR0H
+
+ movff _PREINC1, _POSTINC0
movff _PRODH, _POSTINC0
movff _TBLPTRL, _POSTINC0
movff _TBLPTRH, _POSTINC0