Re: A86: Re: sqrtKEY


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

Re: A86: Re: sqrtKEY




David Phillips wrote:

> 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.
>

Im not so sure that this is so.  Im pretty sure that it is only called if a key
is pressed. Maybe I'll do some disassembly tonight...

>
> > 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 :)

I believe that your problem is that all [sqrt]Key programs are copied into
_asm_exec_ram and _exec_asm'd.
This means that your program will be copied back to _asm_exec_ram when the
[sqrt]Key is finished, and the pc will be restored, but any data that you may
have been saving in your program may be destroyed. I dont know where exactly
your code is going wrong, but make sure that you writeback any data that needs
to be used after a key is pressed, or put it out in the middle of _asm_exec_ram
so that it wont get overwritten when your program is loaded back into
_asm_exec_ram.

Later,
Chicane




Follow-Ups: References: