Re: Universal grammar



"Paul" == Paul J Kriha <paul.nospam.kriha@xxxxxxxxxxxxxxx> writes:

>>>> 1) RESET cannot be caught or masked.
>>>> 2) INTERRUPT is caught, handled and then the system resumes
>>>> from it. RESET abruptly brings to the whole system to a
>>>> "start" state and never resumes from where it left off.
>>>> 3) INTERRUPT is used by peripherals to catch the attention of
>>>> the CPU, > > asking CPU to do something for them quickly. >
>>>> > RESET is usually raised by operators (often human) to bring
>>>> the > > system to a "start" state.

Paul> This is a software engineers vocabulary. The distiction
Paul> between interrupts made in software-engineer-speak is
Paul> artificial. No such distinction actually exists between h/w
Paul> reset and other h/w interrupts.

There is a difference. (see below)


Paul> Technically speaking, there is no difference what-so-ever
Paul> between how a CPU reacts to signals on various interrupt
Paul> lines. Reset interrupt, timer interrupt and various other
Paul> hardware device interrupts cause the CPU interrupt whatever
Paul> it is doing and jump at a predetermined hardwired
Paul> address.

It's not hardwired. It's programmable. The address to jump to is
stored in memory, and the CPU may modify it. That's not what
"hardwired" means.


Paul> At that level the main (and often the only) difference
Paul> between various interrupts is the actual code stored at
Paul> those addresses (they usually happen to be further jump
Paul> instructions to various blocks of codes implementing the
Paul> various h/w servers).

There is a big difference between interrupts and reset signals.

For interrupts, the CPU has to prepare for resuming from it. Thus,
before jumping to the address of the interrupt handler, the CPU has to
save the address of the current (or next) instruction (the return
address) somewhere (usually on the execution stack), so that after
handling the interrupt, a specific instruction can cause the CPU to
*resume* to the previously executing instruction (actually the next
one).


Paul> If you manage to change these arrays of jump instruction,
Paul> aka interrupt vectors, you modify the function of the
Paul> interrupts lines. So on many old as well as new CPUs you
Paul> could swap functionality of reset line and say disk channel
Paul> interrupt. (Not that one would normally want to do that).

Paul> In fact we can view the whole machine's memory as the reset
Paul> interrupt's interrupt server.

No. A RESET signal is different. A RESET causes the CPU to clear its
register contents, reset the "address for next instruction" to some
*hardwired* value, and execute instruction from that address onward.
No return address is saved onto the stack, because the CPU is *not*
expected to *resume* from a RESET signal. (Actually, the stack is
also reset by clearing the stack-pointer register. So, it's
meaningless to store a return address.)



So, there are major differences between these 2 kinds of signals:

Execution flow:
RESET: CPU jumps to a hardwired memory and starts execution there.
INTERRUPT: CPU *saves* the current address onto stack, and then jumps
to a (usually) programmable location to continue execution.
The interrupt handler can resume from the interrupt by
executing a specific instruction that causes the CPU to read
the saved address back from the stack, and jump to that address.

Purpose:
RESET: It is usually a system-wide signal. Not only the CPU but also
peripherals react to this signal and go to an "initial" state.
INTERRUPT: It is usually a one-way communication channel with which
peripherals asks for attention from the CPU. The CPU won't send
interrupts to peripherals. Peripherals won't send interrupts
to one another.


--
Lee Sau Dan 李守敦 ~{@nJX6X~}

E-mail: danlee@xxxxxxxxxxxxxxxxxxxxxxxxxx
Home page: http://www.informatik.uni-freiburg.de/~danlee
.



Relevant Pages

  • Re: Universal grammar
    ... RESET cannot be caught or masked. ... INTERRUPT is caught, handled and then the system resumes from it. ... INTERRUPT is used by peripherals to catch the attention of the CPU, ... Paul> Hans is absolutely correct. ...
    (sci.lang)
  • Re: Universal grammar
    ... Paul> This is a software engineers vocabulary. ... Paul> reset and other h/w interrupts. ... Paul> between how a CPU reacts to signals on various interrupt ... Paul> hardware device interrupts cause the CPU interrupt whatever ...
    (sci.lang)
  • Re: Universal grammar
    ... Of course the address of the actual interrupt ... Paul> vector MUST BE HARDWIRED in the CPU. ... While the reset signal is meant for: ...
    (sci.lang)
  • Re: Is it possible to have a 4KHz hard real time interrupt?
    ... Thanks Paul and Chris, that article and feedback is great, exactly what I needed ... It is something 'spinning', and requires very consistent and time ... and direct to the interrupt service routine without RTOS intervention. ... > sub-us latency, I think that you're looking at a special-purpose processor, ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Universal grammar
    ... Hans> Only you can improve your computer skills. ... Paul> Which is just one of the hardware interrupts that can be ... RESET cannot be caught or masked. ... INTERRUPT is caught, handled and then the system resumes from it. ...
    (sci.lang)