Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/02/05 13:15
Read: times


 
Msg Score: +2
 +2 Good Answer/Helpful
#98678 - It all depends....
Responding to: ???'s previous message

Whatever method works for you is probably the best method! There are many ways of solving this problem. Each of the methods you presented have an application - choose the one the best solves your problem.

for example:

if I have a routine to print a string. I have to pass one pointer to the string, so it would seem reasonable to use the dptr.

mov dptr,#test_str
call pstring

say I have a routine that does a memory copy. For this I need two pointers - a source and destination. It would seem reasonable to pass these pointers in registers.

;
; source pointer in R3:R1
; destination pointer in R2:R0
; byte count in R4
;
mov r2,#high(src)
mov r0,#low(src)

mov r3,#high(dest)
mov r1,#low(dest)

mov r4,#NUM_BYTES_TO_COPY

;
; yes, I know this can be optimised using xch or using
; multiple dptrs if the micro has them!!!!! It is kept simple
; for illustration.
;
memcpy:
mov a,r4
jz memend
mov dpl,r0
mov dph,r2
movx a,@dptr
inc dptr
mov r2,dph
mov r0,dpl
mov dpl,r1
mov dph,r3
movx @dptr,a
inc dptr
mov r3,dph
mov r1,dpl
dec r4
sjmp memcpy
memend:
ret

I don't know what you mean by a 'floating pointer' - 'floating point' is a method of storing and manipulating numbers - nothing to do with pointers as such. Whilst I understand english is not your first language, it is best if you keep your english simple.



















List of 13 messages in thread
TopicAuthorDate
Allocate 2 bytes to a floating pointer            01/01/70 00:00      
   fixed or variable pointer?            01/01/70 00:00      
      More Description!            01/01/70 00:00      
         MMIO?            01/01/70 00:00      
         It all depends....            01/01/70 00:00      
         My Opinion!            01/01/70 00:00      
            does not exist and does not address atom            01/01/70 00:00      
               16 bit data!!!!            01/01/70 00:00      
            My Problem Solved!            01/01/70 00:00      
               To Reza            01/01/70 00:00      
                  To Erik            01/01/70 00:00      
                     ???????            01/01/70 00:00      
                     if no external registers >8 bits, no pro            01/01/70 00:00      

Back to Subject List