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
  • I wonder why you would call a search within a subroutine a global one. To me, the latter would mean a project-wide search over all source files.

    With a dual dptr, I have a 2000 line module in assembler where the only change of the dptr is flipping AUXR1.

    You should consider yourself a lucky person, then. More often than not, I have to juggle around with about 4 pointers...

    Even so, I really don't see what you're trying to achieve that a 4-macro (or maybe two-macros-with-parameters) solutions can't handle elegantly. A macro that actually checks/sets AUXR is certainly better than your proposal, which only documents which of the two DPTRs a given instruction is meant to use, but doesn't actually ensure that that's the one it does use. I.e. your sptr/fptr idea may well make things worse instead of better by spreading a false impression.

    If you want more mnemonic meanings, you could always call them R_FPTR and W_FPTR and so on, too.

Reply
  • I wonder why you would call a search within a subroutine a global one. To me, the latter would mean a project-wide search over all source files.

    With a dual dptr, I have a 2000 line module in assembler where the only change of the dptr is flipping AUXR1.

    You should consider yourself a lucky person, then. More often than not, I have to juggle around with about 4 pointers...

    Even so, I really don't see what you're trying to achieve that a 4-macro (or maybe two-macros-with-parameters) solutions can't handle elegantly. A macro that actually checks/sets AUXR is certainly better than your proposal, which only documents which of the two DPTRs a given instruction is meant to use, but doesn't actually ensure that that's the one it does use. I.e. your sptr/fptr idea may well make things worse instead of better by spreading a false impression.

    If you want more mnemonic meanings, you could always call them R_FPTR and W_FPTR and so on, too.

Children
No data