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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/16/02 06:48
Read: times


 
#25867 - RE: Timer interupt question
Hi Sunny,

In 8051, Interrupt vectors are pre-defined in hardware, and you can not assign your own.

The reason that you don't see the program using these addresses is that whenever an interrupt occurs, the CPU jumps automatiaclly to the corresponding interrupt vector (e.g. 000BH in case of Timer 0), where you write/place a program (using ORG 000BH) which tells the CPU what to do in case of interrupt. This program is called ISR (Interrupt Service Routine). If your ISR is long, you may place a jump at interrupt vector (just as in your example code).

SP has nothing to do with interrupt vectors, its default value is 07H, and you may relocate your stack as required.( Don't place it near to 7FH, there may be risk of stack overflow).

SJMP $ means Jump to the same address as of the instruction SJMP. The $ sign is not part of the assembly language instruction set, but almost every assembler interprets it as current PC location. So the effect of SJMP $ is to wait forever (or until an interrupt occurs, in that case, CPU will jump to ISR, and after executing, it will come back again)


Hope this might help you

Regards

IA


List of 3 messages in thread
TopicAuthorDate
Timer interupt question            01/01/70 00:00      
RE: Timer interupt question            01/01/70 00:00      
RE: Timer interupt question            01/01/70 00:00      

Back to Subject List