[comp.sys.cbm] ML question

JMHAAS@MTUS5.BITNET (Elezar) (12/07/90)

If you just want to shove in something that will be taken care of via
interrupts, you do the following (I profusely apologize if this has
been said before):

Shut off your interrupts with an SEI.
Somehow copy the address where the interrupts go to...
Set this location to your routine.
When done (the end of your routine), jsr to location that you stored
  that is the normal interrupt routines..
The RTI at the end of the normal routines will take care of stuff as usual.


Just as some tacky humour.. An interesting way to execute a jmp:
  Push the address that you want to jump to on the stack.
  Execute a rts..  It looks for the address to go home to on the stack.

(Or was this vax11 assembly??)

Fiat Lux!

|-={ Elezar, last Wizard of Xandurae | Dekhion, keeper of the Three }=-|
|-={ jmhaas@MTUS5 == mtus5.bitnet == mtus5.cts.mtu.edu              }=-|
|-={ jmhaas@balance.cs.mtu.edu                         "Per Aspira  }=-|
|-={ Warning: Magic is real, unless defined integer.    ad Astral!" }=-|

cs4344af@evax.arl.utexas.edu (Fuzzy Fox) (12/11/90)

In article <90340.174157JMHAAS@MTUS5.BITNET> JMHAAS@MTUS5.BITNET (Elezar) writes:
>Just as some tacky humour.. An interesting way to execute a jmp:
>  Push the address that you want to jump to on the stack.
>  Execute a rts..  It looks for the address to go home to on the stack.

Careful with this one!  The addres that the 6502 jumps to on an RTS is
actually one GREATER than the address pushed onto the stack.  (This is
offset by the fact that the JSR instruction pushes the address just
BEFORE the return point onto the stack.)

Heh...Go figure....