[A83] Re: Getkey loop


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

[A83] Re: Getkey loop




Sorry it was z. I guess WinDOwS can't copy and paste.

----- Original Message -----
From: "Charlie Adams" <charlieadams@myrealbox.com>
To: <assembly-83@lists.ticalc.org>
Sent: Wednesday, June 05, 2002 11:34 PM
Subject: [A83] Re: Getkey loop


>
> In that code a few messages back, i think nc should be z.
> X:
> B_Call _getkey ;Gets a keypress
> cp kY ;If key = [Y=]
> jp nc,StartMenu ;Jump to StartMenu<-- should be z since you're checking if
> kY is equal to the number returned by the keypress and put into a.
> jp X ;Repeat the loop (jump to X)
>
>
>
> >I think so, but does replacing nc with nz help?
> >
> > >
> > >TI calculators use the Z80180, right?
> > >
> > > >As a note, it is a GREAT idea to go over to www.zilog.com and check
out
> > >the
> > > >actual manual for the Z80 processor. Once you learn the notation they
> > >use,
> > > >which isn't too esoteric, it will become a valuable learning tool. It
has
> > >the
> > > >(almost) complete instruction set, with opcodes, flags set, clock
cycles,
> > >and
> > > >explanations + more.
> > > >
> > > >The CP instruction can perform two simulated subtraction operations:
> > > >
> > > >A(register) - K(constant)
> > > >or
> > > >A(register) - G(register), where G is an 8-bit register such as B, C,
D,
> > >or E
> > > >
> > > >The flags are set as follows:
> > > >NC, or there is NO CARRY if A - X >= 0.
> > > >*In this case, X would be equal to or less than A.
> > > >
> > > >C, or there is a CARRY if A - X < 0.
> > > >*In this case, X would be greater than A.
> > > >
> > > >NZ, or the result is NOT ZERO if A does not equal X
> > > >
> > > >Z, or ZERO, if A = X
> > > >
> > > >Essentially, the CP operation is the same as the SUB A,X operation,
but
> > >it
> > > >doesn't return the result in A.
> > > >
> > > >Hope this helps,
> > > >Tom
> > > >
> > > >p.s. This was all off the top of my head, so if I may have made a
minor
> > >error
> > > >somewhere...
> > >
> > >
> >
> >
> >
> >
> >_________________________________________________________________
> >Join the world's largest e-mail service with MSN Hotmail.
> >http://www.hotmail.com
>
>
>




References: