gnupic: Help needed
Subject:
Re: Help needed
From:
Craig Franklin ####@####.####
Date:
13 Sep 2004 18:58:49 +0100
Message-Id: <4144F0C8.8070304@users.sourceforge.net>
Julian Green wrote:
>Im doing a project with the PIC16F871, and I am using a number of lookup
>tables that uses computed goto. Is there a way of getting the linker to
>chose an address for the table that does not cross page boundaries?
>
>
>
The linker script has one CODEPAGE per page of memory on the device.
The linker will attempt to relocate a section to the smallest location
that satisfies its memory requirements, without crossing a boundary.
This guarantees each program memory section will be on one page. So
make sure your lookup table is in one section.
From the 16f871.lkr file, I would guess that this device one has one
page of memory. So you will run out of memory before you have to worry
about page switching.
>e.g.
>
>CRC16_Lookup:
> global CRC16_Lookup
>
> movwf temp
>
> movlw High($)
> movwf PCLATH
>
> movfw temp
> ANDLW 0x1F
> ADDWF PCL, F
>
> RETLW 0x00 ; LOW Byte Data
> RETLW 0x21
> RETLW 0x42
> RETLW 0x63
> RETLW 0x84
> RETLW 0xA5
> RETLW 0xC6
> RETLW 0xE7
> RETLW 0x08
> RETLW 0x29
> RETLW 0x4A
> RETLW 0x6B
> RETLW 0x8C
> RETLW 0xAD
> RETLW 0xCE
> RETLW 0xEF
> RETLW 0x00 ; HIGH Byte DATA
> RETLW 0x10
> RETLW 0x20
> RETLW 0x30
> RETLW 0x40
> RETLW 0x50
> RETLW 0x60
> RETLW 0x70
> RETLW 0x81
> RETLW 0x91
> RETLW 0xA1
> RETLW 0xB1
> RETLW 0xC1
> RETLW 0xD1
> RETLW 0xE1
> RETLW 0xF1
>
>Many thanks
>
>Julian
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ####@####.####
>For additional commands, e-mail: ####@####.####
>
>
>
>