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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/12/01 18:58
Read: times


 
#8178 - RE: does anyone know the reason
Tom, this is not a 'C' issue, I have 'repaired' that on several assembly programs requiring TLC (sorry, not all US readers it means "tender loving care"). Besides, using a local copy of a pointer does not prohibit an interrupt updating that pointer while it it being copied.
We may be talking over someones head here, there is an example below.
Y'all have fun now, ya hear.
Erik Malund

EXAMPLE OF INTERRUPT POINTER BOO_BOO
not complete code, for demonstration purposes only!!!!!!!!

; in the serial input ISR
mov dpl,pointer_low
mov dph,pointer high
mov a,sbuf
mov @dptr,a
inc dptr
inc count
mov pointer_low,dpl
mov pointer_high,dph

;in the main code
mov a,count
jz not_now
;Y marks the spot
mov dpl,pointer_low
;X marks the spot
mov dph,pointer high
;Z marks the spot
mov a,@dptr

now assume that the pointer points to hex 07ff and is incremented to hex 0800 in the ISR. If the interrupt happens at point X, the main routine will see the pointer as 0700. The cure is to push the IE and clear EA at Y, pop the IE at Z.
If anyone want to discuss this particular subject, please start a new thread


List of 19 messages in thread
TopicAuthorDate
does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      
RE: does anyone know the reason            01/01/70 00:00      

Back to Subject List