Re: trapping the STOP key in an IRQ

From: A. Fachat <afachat_at_gmx.de>
Date: Fri, 25 Apr 2014 19:23:22 +0200
Message-ID: <14599e89dd0.279a.b4d1f2b66006003a6acd9b1a7b71c3b1@gmx.de>
Note that the PET checks the IRQ vector before IEEE488 operations. I don't 
remember if it's only the high byte (no problem here) or also the low byte 
(problem). The check is to ensure that Tape operations are not interrupted. 
Thus the code simply waits till the IRQ vector ia corrected....
My solution was to to check in the interrupt routine whether the main code 
hangs in that check (checking the interrupt return address on the stack) 
and if so, fix up this interrupt return address on the stack to a place 
behind the check...
Ugly but effective...

André


Am 25. April 2014 18:14:53 schrieb William Levak <wlevak@SDF.ORG>:

> On Wed, 23 Apr 2014, Charlie Hitselberger wrote:
>
> > I'm doing this on a PET, but it should be similar for VIC / C=64 / 128
> >
> > On a BASIC 4 PET, the IRQ vector at ($0090) normally points to $E455 which
> > handles the jiffy clock and scankey and whatever else it does.  I'm doing a
> > screen editor for PETTIL (a Forth) which will essentially be HEX 93 EMIT
> > BEGIN TIB 80 EXPECT AGAIN , or an infinite loop to accept a line of input
> > and then ignore it.
> >
> >> From Forth, the user types EDIT to invoke the editor mode.  Then the user
> > will experience the same thing you get when you power up the PET, clear the
> > screen, and start typing/drawing.  The cursor will blink, quoting will
> > work, inserts will be counted, etc... Just like editing PET BASIC.
> > However, there will be no response when the user hits return.  The cursor
> > will move to the beginning of the next line, scrolling the screen.
> >
> > What I would like to do is use the STOP button as an escape key for editor
> > commands. When the user hits STOP - UP, the entire contents of the screen
> > (including the 24 byte line wrap table) will be saved to a buffer, and the
> > previous screen will be pulled out of the buffer and displayed.  STOP -
> > DOWN will stash the entire screen and load the following screen.  STOP - S
> > will save the buffered screens to disk or tape.  STOP - L will load a group
> > of buffered screens from disk or tape.  STOP - Q quits the editor, echoes "
> > OK" and returns to Forth. So that's my design.  PET screen editor and Forth
> > block editor, as intuitive as I can make it.
> >
> > I would like to flash the screen (EOR #$80, wait 5 jiffies, EOR #$80) when
> > the user hits STOP.  The PET will go into a loop waiting for the next
> > keystroke and treat it as an editor command.  I don't want the screen to
> > flash 137 times when the user holds down the STOP key, I only want to
> > notice and react once to each discrete STOP key press and release event
> > pair.  Any ideas?
>
> When writing educational software, we used to disable the stop key so 
> students could not break out of the program.  This was done by redirecting 
> the stop vector.  You could redirect it to a machine language routine.
> The vectors are located at:
>
>        Original BASIC $210-21A
>        Basic 2 & 4    $090-091
>
>
> wlevak@sdf.lonestar.org
> SDF Public Access UNIX System - http://sdf.lonestar.org
>
>        Message was sent through the cbm-hackers mailing list



       Message was sent through the cbm-hackers mailing list
Received on 2014-04-25 18:00:08

Archive generated by hypermail 2.2.0.