This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

clarity of dual dptr code

to make an assembly routine clearer to read, I want to indicate which of the 2 dptrs are used in each instance. One is fetch, another is store.

So, to achieve that, I insert the following:

 fptr equ   dptr
sptr equ   dptr

And these lines error out.

and below it could be

 movx a,@fptr
mov r7,a
inc fptr
inc auxr1
movx a,@sptr
orl a,r7
movx @sptr,a
inc sptr
inc auxr1

Obviously I can do two macros FETCH and STORE, That, however would not support the identical name when mov dptr,# is there, and as seen in the above 3 macros (or 4 or 5) would be needed.

Is there a way to do this other than the above?

Erik

PS the actual code is far more complicated than the above example.

Parents
  • "The AX51 asssembler has a "LIT" directive that sounds like what you might want: literal text substitution of short strings rather than blocks of code, more like the C #define macro."

    Doesn't AX51 handle C-like #define macros? I seem to recall reading about that facility in the manual.

    Anyway, if it doesn't or if like me, you use A51 (w/o the 'X'), there are a number of "standalone" preprocessors that would do the trick.

Reply
  • "The AX51 asssembler has a "LIT" directive that sounds like what you might want: literal text substitution of short strings rather than blocks of code, more like the C #define macro."

    Doesn't AX51 handle C-like #define macros? I seem to recall reading about that facility in the manual.

    Anyway, if it doesn't or if like me, you use A51 (w/o the 'X'), there are a number of "standalone" preprocessors that would do the trick.

Children