Does anyone have a worked example of the how to use the "dtm" directive in MPASM (assembly)?
I have been messing with it all morning without luck.
Consider, for example, some code that prints, "ANGLE."
That is easily done with something like:
Or, one can do it a little more clearly by making a table call, such as :
I used the above method in the example posted in another thread.
I can't get dtm to work the same way. When I use dtm, I can observe in the disassembly listing creation of the "movlw 0xxx" instructions, but I can't access them. BRW returns nothing. I haven't tried a more complicated method of putting a label, then going to that label and using an addlw and PCL as one does with tables on the non-enhanced mid-range devices.
Secondly, while most assembler directives appear in blue, the dtm directive appears in magenta, like a label. If I put it in the first column, however, the assembler screams at me for putting a directive there.
Unfortunately, the example in the Assembler Guide is not very helpful -- at least to me.
John
I have been messing with it all morning without luck.
Consider, for example, some code that prints, "ANGLE."
That is easily done with something like:
Code:
movlw 'A'
call <a routine that prints the ascii equivalent of that literal>
movlw 'N'
etc.
Or, one can do it a little more clearly by making a table call, such as :
Code:
Table
BRA
dt "ANGLE",0
I used the above method in the example posted in another thread.
I can't get dtm to work the same way. When I use dtm, I can observe in the disassembly listing creation of the "movlw 0xxx" instructions, but I can't access them. BRW returns nothing. I haven't tried a more complicated method of putting a label, then going to that label and using an addlw and PCL as one does with tables on the non-enhanced mid-range devices.
Secondly, while most assembler directives appear in blue, the dtm directive appears in magenta, like a label. If I put it in the first column, however, the assembler screams at me for putting a directive there.
Unfortunately, the example in the Assembler Guide is not very helpful -- at least to me.
John
Last edited: