On Mon, 23 Sep 1996, Philip Lalone wrote: > Is it possible to write a MPASM macro that will print a string > using: PRINT "This is the string"? The only way i've been able to get > anything like this working is writing seperate code for each string I > want to print, any theory or code would be appriciated. I need to do this > for serial data and a LCD, which I've written code for, so all the macro > would need to do is call the serial/lcd routine with each character or a > pointer to the string. I'm not certain about the syntax, but I believe there's a built-in that will take a string (?) and assemble a series of retlw instructions, which suggests that you could get the macro to generate something like this: goto str1_end str1: retlw 'T' retlw 'h' retlw 'i' retlw 's' . . . retlw 0 str1_end: movlw high(str1) movwf StrPtrHi movlw low(str1) call RoutineToOutputStringToWherever Where the output routine would handle stepping the pointer and fetching bytes until the terminating NUL was reached. Alternately, I believe you could make the first byte returned be a count. In either case, the string's (far) address is in StrPtrHi:W on entry to the output routine. Hmmm... I may have a use for this in a project that's been simmering on the back burner for a while. :-)