Hi Steve,
While I don't see any advantages over the previous examples, it does present a few problems that weren't there before.
They are the same problems I came across when writing the strings program I pointed out in the 2nd post of this thread.
By using the "dt" directive, it uses twice as much code space by only storing 1 byte per word. The "da" directive is much more efficient. It packs two 7-bit characters in each word.
Also, when using the MOVE?CW macro inside another macro, it makes it so that all string data has to be placed at the beginning of the program. If you place the string data after the SendString command that's trying to use it, you will get a "Address label duplicate or defferent in second pass" error.
John Barrat figured out how to get around that problem with this macro. It compiles to the exact same thing as the MOVE?CW, but because of which "Pass" it gets compiled on, it can find an address either before or after the code that uses it.
I think, once you fix those 2 things, you'll have something that looks just like my Strings prog. See second post.Code:'------------GetAddress Macro - Location insensitive ------------------------- ASM GetAddress macro Label, Wout ; Returns the Address of a Label as a Word CHK?RP Wout movlw low Label movwf Wout movlw High Label movwf Wout + 1 endm ENDASM
<hr>
I do like this thoughSure makes things look better when you can indent labels.Code:@ errorlevel 0,-207 ' avoid anoying MPASM error message ' -- found label after column 1 --
<br>





Bookmarks