A86: Re: sqrtKEY


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

A86: Re: sqrtKEY




This all based on memory of when this was all discovered a year and a half
ago by Dux Gregis, Stephen Hicks and Kirk Meyer, so take it as that.  Kirk's
April Fools program is also a great example if you're looking for one.

> Just when exactly is sqrtKEY executed?  When _getkey is called?  It
> apparently does not just run when a key is pressed, but continuously as
> far as I can tell.  And that's a problem.

It is called by _get_key, so, yes, it is always called.  I believe that A
contains the key pressed, so if it is zero, you want to immediately return.

> I'd wanted to add memory lock abilities to Lockdown, a password protect
> program.  After I looked at the source to Dux's Yugi2 I got the general
> idea of how to do it (I modified it a bit).  But once installed and
> active, the sqrtKEY program messes up my text input routine for password
> entry.  The calculator recieves keycodes, because EXIT and ENTER work.
> If I press the (2ND) key and then a key, it registers as having been
> pressed.  But not otherwise.  SqrtKEY is messing up my _getkeys!

I can think of two things offhand that would cause that.  First, is that
you're probably trashing something important in your [sqrt]KEY program that
you shouldn't trash.  Second, it is re-entrant when it shouldn't be (i.e.
you're calling _get_key inside, and it's calling itself, etc.).  I had that
problem at first when playing with [sqrt]PARSE (think that is it...whatever
one lets you make 1 + 1 = 3 :)

> So I was wondering, if someone can give an extremely detailed
> description of what leads up to the running of the sqrtKEY program, and
> what happens immediately afterwards.  And what is sqrt supposed to mean,
> other than replacing that funny little character that looks like a 'd'
> with a slash through it?

I think that basically, A is the key that was hit (like _get_key), and it is
changed to whatever A is when the function returns.  Of course, I'm probably
totally wrong, but that is the general idea.  The April Fools source will be
your best bet to screw with that stuff.  Hehe, [sqrt] means the actual
square root symbol, value 16.  The name of the program on the calc starts
with the square root symbol.



Follow-Ups: References: