Re: A86: Memory Lock
[Prev][Next][Index][Thread]
Re: A86: Memory Lock
Dux Gregis wrote:
> hmm. I couldn't get it to work with the emulator. Did you already have
> [sqrt]KEY on your calc when you tried it?
>
> Trey Jazz wrote:
>
> > kewl man it works!!! :)))) well kinda but gotta add a password and stuff i
> > guess instead of just tellin it to exit
I think that we need to move the code into the program after we create a program
of the right size. :-)I tried this; can anyone tell me why it crashes:
#include "asm86.h"
#include "Ti86abs.inc"
#include "Ti86asm.inc"
.org $d748
ld hl,op_info
rst 20h ;[sqrt]KEY -> OP1
ld hl, code_end - code
call $474f ;creates program
call _FINDSYM
ex de,hl
inc hl
inc hl
inc hl
inc hl
ld a,b
call _SET_ABS_DEST_ADDR
xor a
ex de,hl
call _SET_MM_NUM_BYTES
xor a
ld hl,code
call _SET_ABS_SRC_ADDR
call _mm_ldir
set 6,(iy+24) ;enables program
ret
op_info:
.db $12,$4,$10
.db "KEY",0
code:
call $479f ;special call
ld a,($d625) ;get saved a register
bit 0,(iy+$20)
jr nz,skip_and_pop
push af ;push getkey
ld a,($c1b4) ;load calc state
cp $23 ;check if in delete state
jr nz,skip_and_pop
pop af ;pop getkey
cp $09 ;check for enter press (might be $09
jr nz,skip_key
xor a ;0 out the getkey
skip_key:
cp a ;set zero flag
ret
skip_and_pop:
pop af
jr skip_key
code_end:
.end
References: