Ausgaberoutine im Wesentlichen von der Seite: www.sprut.de Beispiel: Tabelle steht in page 7 (ORG 0x700) - siehe weiter unten Dann sind H- und L-Byte des Pointers auf die Tabelle so zuzuweisen: #undefine Table_H ;falls Lcd_Out mehrfach aufgerufen wird Table_H = high table_string ;Pointer H-byte movlw low table_string ;Pointer L-byte CALL Lcd_Out ;Ausgabe aufrufen ;------------------------------------------------------------ Lcd_Out ; Übergabeparamter Pointer z.B. movwf tmp ;pointer L-byte read from table position decf tmp,f ;pointer decr -> incf tmp,F in "Char_Read" movf LcdLines_F,w ;flagregister z.B. b'00000011' für 2zeilige Ausgabe movwf tmpLines_F ;temporary flagregister ; Lcd_Out_Line rrf tmpLines_F,f ;Zeilenbits über Carry rechtschieben bcf tmpLines_F,7 ;bit7 Carry=1 verhindern btfss STATUS,C ;Carry=0? All lines displayed? GOTO Lcd_Out_0 ;Yes, job is done CALL Char_Read ;No, get DDRAM adress from table (in WREG) iorlw b'10000000' ;function set + DDRAM adress CALL OutLcdControl ;sends instruction to LCD ; Lcd_Out_Char CALL Char_Read ;Pointer+1, next number in table addlw 80h ;+128 marks end of line btfsc STATUS,C ;bit7=1? end of line? GOTO Lcd_Out_Line ;YES, send command DDRAM adress next line andlw 7fh ;NO, +127 restore character CALL OutLcdData ;display character GOTO Lcd_Out_Char ; Char_Read movlw Table_H ;0x07 ;value to set PCLATH movwf PCLATH ;tables start at page 0x700 incf tmp,f ;pointer to the next number in table movf tmp,w ;copy pointer to WREG movwf PCL ;jumps to adress PCLATH,PCL Lcd_Out_0 ;returns read char/adress in WREG RETURN ;********************************************************************* ORG 0x700 ;z.B. Tabelle ab page 7 (dez. 17929 table_string: dt 43h,"LCD-Ausgabetext",'_'+80h ;1. "table_string" als Literal ist der Pointer auf das 1. Zeichen ; in der Tabelle nach "dt"-, hier die DDRAM-Adresse 42h für ; Zeile 2, Digit 2 (kann beliebig angepasst werden) ; ;2. '_'+80h" ist die Schlussmarke der Zeile ASCII " "=32+80h=128 ; ergeben addiert 160. Die Addition von nochmals 80h im Code ; bewirkt einen Überlauf 255-> wodurch das Carry-Bit gesetzt ; wird, welches somit Indikator für das Erreichen des ; Zeilenendes is