...
As for calculating the offset as 5*ascii (or 5*(ascii- .32)), that was one option I considered. The multiplier could be adjusted to make a space. But, is there a common practice of where to put the space(s) -- I don't see that one would need it both before and after each character.
...
An ascii character, such as 0x20 could be set at the start and the next bytes for that character ("n") easily read. However, the offset for the next character is not 0x21, but 0x20+n+1 and so forth. There is no way that I know of to offset to rows in the look-up table without additional calculations.
...
... Yesterday I got the char bitmap look-up "by column" using tables to work (i.e., the first pixel column for each ascii char is in Table1 and so forth). The ascii value is the offset. Indirect addressing allows me to rotate through the 5 tables, but it can also be done by brute force.
...
DW 1 | 2<<7, 3 | 4<<7, 5 | 6<<7
;*******************************************************************************
; ASCII CHARACTER LOOK-UP TABLE AND SUBROUTINE
;*******************************************************************************
;Enhanced indirect addressing capabilities of this chip are utilized
;(See: Memory Organization and Section 3.1.1.2 of the datasheet). Bit <7> of
;FSR0H is a directive to access program memory as data. Location of the table
;in this instance is set by bit <5> of FSR0H to give 0x2000. Actual table data
;are offset by 8*(0x20) to account for the ascii offset.
;*******************************************************************************
Out_Str ;10(9), one-cycle instructions
clrf FSR0H ;an rlf after first lslf not needed as largest
movwf FSR0L ;Str_Num is <128(0x80)
lslf FSR0L
; rlf FSR0H ;not needed
lslf FSR0L
rlf FSR0H
lslf FSR0L
rlf FSR0H
bsf FSR0H,5
bsf FSR0H,7
Out_Str_Loop
movlw 0x08 ;NB:for characters <8 bytes, first byte will set
movwf Byte_Cnt ;Byte_Cnt_Loop will need appropriate modification
Loop
moviw FSR0++ ;movfw INDF0, post increment
; movwf CharByte ;not needed this version 07.02.13
call WriteData
decfsz Byte_Cnt,f
goto Loop
return
;*******************************************************************************
; ASCII CHARACTER DATA
;*******************************************************************************
;Character set from Microchip forum link "5X8 Character Table Used in Most
;of the Graphic LCD" (top row of pixels are blank for line spacing).
;No descenders for l.c., added degree sign (ascii = 7f)
;*******************************************************************************
ORG 0x2100
DW 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ; 20 space
DW 0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x00 ; 21 !
(etc.)
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?