TX_STR Problem
I am using Jon Williams' functions for outputting characters via the serial port. I get bytes output correctly but not strings.
TX_BYTE: 'Use: TX_BYTE outgoing byte
'LET temp1 = __PARAM1 'Outgoing port
LET temp2 = __PARAM1 'Outgoing byte
SEROUT TX_DB9, Baud, temp2
RETURN
TX_STR: 'Use: TX_STR [noparse][[/noparse]string| label]
' "string" is an embedded literal string
' "label' is DATA statement for stored z-string
temp3 = __PARAM2 'get string offset
temp4 = __PARAM3 'Get string base
DO
READ temp4 + temp3, temp5 'Read a char from the string into temp5
IF temp5 = 0 THEN EXIT 'String complete
TX_BYTE temp5
INC temp3 'Point to next char
temp4 = temp4 + Z 'Update base on overflow
LOOP
RETURN
When I execute TX_STR "Start" here is what I get at the terminal
TX_BYTE: 'Use: TX_BYTE outgoing byte
'LET temp1 = __PARAM1 'Outgoing port
LET temp2 = __PARAM1 'Outgoing byte
SEROUT TX_DB9, Baud, temp2
RETURN
TX_STR: 'Use: TX_STR [noparse][[/noparse]string| label]
' "string" is an embedded literal string
' "label' is DATA statement for stored z-string
temp3 = __PARAM2 'get string offset
temp4 = __PARAM3 'Get string base
DO
READ temp4 + temp3, temp5 'Read a char from the string into temp5
IF temp5 = 0 THEN EXIT 'String complete
TX_BYTE temp5
INC temp3 'Point to next char
temp4 = temp4 + Z 'Update base on overflow
LOOP
RETURN
When I execute TX_STR "Start" here is what I get at the terminal
Comments
The basic code now works fine.
sigh,
marshall
Post Edited (JonnyMac) : 5/26/2008 2:24:07 AM GMT