1 /*-------------------------------------------------------------------------
3 gptrput4.c :- put 4 byte value at generic pointer
5 Adopted for pic16 port by Vangelis Rokas, 2004 (vrokas@otenet.gr)
7 Written By - Sandeep Dutta . sandeep.dutta@usa.net (1999)
9 This library is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Library General Public License as published by the
11 Free Software Foundation; either version 2, or (at your option) any
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Library General Public License for more details.
19 You should have received a copy of the GNU Library General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 In other words, you are welcome to use, share and improve this program.
24 You are forbidden to forbid anyone else to use, share and improve
25 what you give them. Help stamp out software-hoarding!
26 -------------------------------------------------------------------------*/
29 ** $Id: gptrput4.c 3714 2005-04-02 13:13:53Z vrokas $
32 /* write address is expected to be in WREG:FSR0H:FSR0L while
33 * write value is in TBLPTRH:TBLPTRL:PRODH:[stack] */
48 void _gptrput4(void) __naked
51 /* decode generic pointer MSB (in WREG) bits 6 and 7:
52 * 00 -> code (unimplemented)
53 * 01 -> EEPROM (unimplemented)
61 /* data are already in FSR0 */
64 movff _PREINC1, _POSTINC0
65 movff _PRODH, _POSTINC0
66 movff _TBLPTRL, _POSTINC0
67 movff _TBLPTRH, _POSTINC0
77 /* code pointer, cannot write code pointers */
83 /* unimplemented yet */