not 100% linear
i.e: in some cases, for different input values, we can get same % results
ex: for 0000001010 ==> 2%
for 0000001011 ==> 2%
for 0000001100 ==> 2%
for 0000001101 ==> 2.1%
for 0000001110 ==> 2.2%
for 0000001111 ==> 2.3%
for 0000010000 ==> 2.3%
for 0000010001 ==> 2.3%
I don't use PICBASIC, so I can't help you with that, in assembler you use a series of RETLW's.
Can you define a single dimensional array in your BASIC?.
EDIT:
Quick rethink! - does your BASIC support the DATA statement?, this is an example from the PIC BASIC compiler version of WinPicProg I was working on.
Code:
DATA 45, 255, 0, "H", "e", "l", "l", "o" - store 8 bytes of data.
READ A - read the first three bytes of data to three variables.
READ B
READ C
RESTORE 4 - reset the read point to 4th byte
FOR X=1 TO 5 - print a stored string.
READ A
PRINT CHR$(A)
NEXT X