[Coco] Reading keyboard input without basic

Arthur Flexser flexser at fiu.edu
Wed Feb 10 08:06:56 EST 2016


The two most basic (no pun intended) ROM routines in Color Basic for
getting keyboard input are called by JSRs to $A1C1 or $A1B1.  In both
cases, the character that is input from the keyboard is returned in the A
register.  The difference between the two is that the $A1C1 routine returns
zero until a key is pressed, so a call to that is generally embedded in a
loop that is exited when a nonzero value is returned.  The one at $A1B1
blinks the cursor and waits until a character is entered.  (This is from
memory, no guarantees.)  The one at $A1C1 also has a documented vector and
so may also be called by JSR [$A000] if memory serves me correctly.  (Or
maybe it's $A002, too lazy to look it up.)  But there's no particular
advantage to using that, since we now know that there will be no future
Basic version where a direct call to the routine won't work because the
entry point has changed.

Art

On Wed, Feb 10, 2016 at 7:52 AM, <spereira1952 at comcast.net> wrote:

> I would suggest consulting the "unraveled" series of books available here:
>
>
> http://www.colorcomputerarchive.com/coco/Documents/Books/Unravelled%20Series/
>
> I believe that "Color Basic Unraveled" will reveal how the Color Computer
> performs its console I/O, and you can build up from there.
>
> Good luck!
>
> smp
>
>
> ----- Original Message -----
>
> From: "Jason M" <oleribus at gmail.com>
> To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
> Sent: Wednesday, February 10, 2016 7:20:13 AM
> Subject: Re: [Coco] Reading keyboard input without basic
>
> Thanks for the info all. Does anyone have more info on the available rom
> routines and maybe an example of using one in assembly ?
> On Feb 9, 2016 7:53 PM, "Brett Gordon" <beretta42 at gmail.com> wrote:
>
> > Coco3 can do a key interrupt... but once it fires make sure you shut off
> > the interrupt (via FF92 or FF93 ) for a jiffy or two, otherwise the key
> > interrupt will fire non-stop until the user releases the key(s). :(
> >
> > CoCo2 doesn't have a key interrupt. So you'll have to poll every once in
> a
> > while. I usually use the VSYNC interrupt for this. Basic has some pretty
> > handy routines for scanning the keyboard, btw. (Manipulation of the
> > "rollover" RAM is allows for some cool stuff btw...)
> >
> >
> > Brett M Gordon
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > https://pairlist5.pair.net/mailman/listinfo/coco
> >
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list