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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/22/01 09:44
Read: times


 
#12718 - RE: Return vector for interrupts
Hi San,

please can you explain, at which point an interrupt can affect the POP POP PUSH PUSH sequence ???

I see no way. After the last PUSH all was alright again.
Only POP, POP, INC SP, INC SP was dangerous.

Nevertheless the method with using MOV R0, SP was more practical on most interrupts, since before any register was POPed, it should be saved.

But e.g. on some derivates a second data pointer DPTR1 can be reserved for interrupts and used in this way (POP DPH1, POP DPL1).
Also on subroutines the POP POP PUSH PUSH sequence was useful.


Iself use it often, e.g. on subroutines as pointer to an argument list, simply placed after the call.
This save many code memory, if the subroutine was frequently called.
No need to mov any argument into a register. The called subroutine do this job for any caller.

E.g.:

call puts
db 'Hello ', 0

call puts
db 'world ', 0

...

puts:
pop dph
pop dpl
sjmp puts2
puts1:
call putchar
puts2:
clr a
movc a, @a+dptr
inc dptr
jnz puts1
jmp @a+dptr


Peter


List of 14 messages in thread
TopicAuthorDate
Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      
RE: Return vector for interrupts            01/01/70 00:00      

Back to Subject List