* src/pic16/device.c (pic16_dump_gsection,
authorvrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 10 Oct 2004 20:45:19 +0000 (20:45 +0000)
committervrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 10 Oct 2004 20:45:19 +0000 (20:45 +0000)
* 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

device/lib/pic16/libsdcc/gptr/Makefile
device/lib/pic16/libsdcc/gptr/gptrget1.c
device/lib/pic16/libsdcc/gptr/gptrget2.c
device/lib/pic16/libsdcc/gptr/gptrget3.c
device/lib/pic16/libsdcc/gptr/gptrget4.c
device/lib/pic16/libsdcc/gptr/gptrput1.c
device/lib/pic16/libsdcc/gptr/gptrput2.c
device/lib/pic16/libsdcc/gptr/gptrput3.c
device/lib/pic16/libsdcc/gptr/gptrput4.c

index 9e36970e590ffdf3b5d551d1841e97ce7e6278d9..1659055d4b10d93e1980d96d541bfcbed887086f 100644 (file)
@@ -20,11 +20,17 @@ SRCS        =       gptrget1 \
                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
index cbf36b22b6033672e3ef89c3174d3d5d48d1bf0c..4b208b1e47066eb0b8ba946b1047a90420347082 100644 (file)
 */
 
 /* 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;
@@ -43,6 +45,7 @@ extern TBLPTRU;
 extern TABLAT;
 extern PRODL;
 
+
 void _gptrget1(void) _naked
 {
   _asm
@@ -53,38 +56,38 @@ void _gptrget1(void) _naked
      * 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_:
 
index 485fa4f358ad2fbc1ba43dd01efb1dd7d1d10643..c6b2eb369528e56ab2771f575fa41ac59edc7e95 100644 (file)
@@ -30,7 +30,7 @@
 */
 
 /* 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;
@@ -54,10 +54,12 @@ void _gptrget2(void) _naked
      * 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
     
@@ -67,12 +69,12 @@ void _gptrget2(void) _naked
 _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*+
index 3b4eb25ab3173fb5767dece568b7b40308b34b98..932b96f384015bf0bf461d12c6e7158bf64d8438 100644 (file)
@@ -30,7 +30,7 @@
 */
 
 /* 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;
@@ -55,10 +55,12 @@ void _gptrget3(void) _naked
      * 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
@@ -69,12 +71,12 @@ void _gptrget3(void) _naked
 _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*+
index c57b9e5400816f5d06b58b6ba8fc89db2e10fa1a..821261a9d68a64db45c2f8b7b5f171d257b76c2a 100644 (file)
@@ -30,7 +30,7 @@
 */
 
 /* 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;
@@ -55,10 +55,12 @@ void _gptrget4(void) _naked
      * 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
@@ -70,12 +72,12 @@ void _gptrget4(void) _naked
 _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*+
index decbadf6d9ed946a676a8acb6ca902fd6a7b16d0..1d57533a8ccb06257c775b9cd967e7061d16a067 100644 (file)
 ** $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;
@@ -54,11 +55,13 @@ void _gptrput1(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
     
     return
     
index 514a791448a28c397c17612702f9ba70a8d6986b..3bef2928931df337f15f8166ee5b6df4c81d7902 100644 (file)
 ** $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;
@@ -43,6 +44,7 @@ extern TBLPTRU;
 extern TABLAT;
 extern PRODL;
 extern PRODH;
+extern _GPTRREG;
 
 void _gptrput2(void) _naked
 {
@@ -54,11 +56,13 @@ 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
index d5eea4e646c9a01aeab0aba90691815992cf01d2..80e562e528ba9a92b3f8cde510c9e6d0ff99d5ab 100644 (file)
 */
 
 /* 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;
@@ -43,6 +44,7 @@ extern TBLPTRU;
 extern TABLAT;
 extern PRODL;
 extern PRODH;
+extern _GPTRREG;
 
 void _gptrput3(void) _naked
 {
@@ -54,11 +56,13 @@ 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
     
index 01b7db2b0b0bf1ca957cc0d030b988fb9dcb0b4a..d8358e5e3457f8897fa388b3d4e07dbec2b2cfb0 100644 (file)
 */
 
 /* 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;
@@ -43,6 +44,7 @@ extern TBLPTRU;
 extern TABLAT;
 extern PRODL;
 extern PRODH;
+extern _GPTRREG;
 
 void _gptrput4(void) _naked
 {
@@ -54,11 +56,13 @@ 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