[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help diagnosing an Apple IIe, please.



Jerry wrote:
"Michael J. Mahon" <mjmahon@aol.com> writes:

Jeff Blakeney wrote:
  To: Michael J. Mahon
On Fri, 27 Feb 2009 15:32:30 -0800, Michael J. Mahon wrote:


You can also GET the key after determining that one has
been pressed:

40 IF PEEK(KB)>127 THEN GET A$

Does the GET clear the keyboard strobe as well?  If so, that is really
cool and is something I never knew.  I'll have to remember that one.
Yes, it does.  (It would have to to avoid GETting the same keypress
over and over.)

The only way to sense the keyboard from Applesoft without clearing
the strobe is to PEEK it.  In this case, it is PEEKed to avoid waiting
at the GET when no key has been pressed.

-michael

Well, you can use the WAIT instruction to sense the keyboard without
clearing the strobe:

   WAIT 49152, 128

It waits until the value at the memory location 49152 bit-wise ANDed
with 128 is non-zero.

Yes, and it "waits faster" by using M/L to poll the keyboard.  ;-)

I've never found a use for WAIT in Applesoft.  In this particular case,
it is so handy to have the actual key value (with the high bit set) that
often the GET is needed only to clear the strobe.

In any case, it's handy to have the key both as a number (the result of
the PEEK) and a string (the result of the GET).

-michael

******** Note new website URL ********

NadaNet and AppleCrate II for Apple II parallel computing!
Home page:  http://home.comcast.net/~mjmahon/

"The wastebasket is our most important design
tool--and it's seriously underused."