In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jon Williams wrote: Just for fun I wrote another version of LCD_OUT that works with a byte, string constant, or label (that points to DATA string). Note that it does compile SEROUT twice, but I still think this is a decent routine to have in your bag: ' Use: LCD_OUT [ aByte | string | label ] ' -- "aByte" is single-byte constant or variable ' -- "string" is an embedded literal string ' -- "label" is DATA statement label for stored z-String LCD_OUT: temp1 = __PARAM1 ' byte or offset IF __PARAMCNT = 2 THEN ' string specified? temp2 = __PARAM2 ' yes, save base DO READ temp2 + temp1, temp3 ' read a character IF temp3 = 0 THEN EXIT ' if 0, string complete SEROUT LcdTx, LcdBaud, temp3 ' send the byte INC temp1 ' point to next character temp2 = temp2 + Z ' update base on overflow LOOP ELSE SEROUT LcdTx, LcdBaud, temp1 ' transmit to LCD ENDIF RETURN ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=2&m=95955#m96282 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)