Using large table to store/display graphics LCD data
David Cary email (remove spam text)
You're right, Myke. The ``Table'' code I posted still wasn't quite right. Thanks
for fixing it.
myke predko <PASSPORT.CA> on 2001-04-25 04:00:20 PM wrote: myke
I *think* the most efficient way of implementing this function would be:
; PCLATH = HIGH(TStart + Offset)
; w = LOW(TStart + Offset)
; if ((LOW(TStart) + LOW(Offset)) > 255) then PCLATH = PCLATH + 1
; PCL = w: PC = PCLATH/PCL
This is the code that I use for implementing large tables.
Good job optimizing. I don't see any way to make this function ``Table'', in
isolation, faster or smaller. Mind if this gets stuck on http://piclist.com as
public domain ?
However, I don't plan on using it. All my code uses something similar to
; Jump to address in look_hi/look_lo, which presumably is an RETLW.
; Note pointer post increment.
; Equivalent to: W=*look_ptr++
; Handles tables of any size located anywhere in program FLASH.
; (256 byte tables don't work if you merely do ``addwf PCL,f'').
; [FIXME: might be improved by
; tells how to read and write all 14 bits of a program memory location.
movf look_hi,w ; set PCLATH
movf look_lo,w ; and get PCL
incf look_lo,f ; but post inc
movwf PCL ; ok, now jump
which has the benefit of only requiring 1 subroutine for all the various tables
I use (rather than a separate copy for each table, like `Table' does). The code
that *calls* ``lookup'' needs to set up the loop with a couple more instructions
than if I had used ``table'', but overall it's a win ROM-space-wise and, I
I've got another version working that, rather than look_hi:look_lo, uses
whatever register pair FSR points toward. It's a little slower than ``lookup''
or ``table'', but I think it might turn out to be a win (overall) space-wise.
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email mitvma.mit.edu with SET PICList DIGEST in the body listserv
See also: www.piclist.com/techref/io/lcd/pic.htm?key=lcd
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the