[A83] Re: Distance RAM clearer :-)


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

[A83] Re: Distance RAM clearer :-)




Now look at this:
(it locks ion and is a beta version)

; zmLink2Key by Zeekoe

 #include "ion.inc"

#ifdef TI83P
        .org    sram-2
        .db     $BB,$6D
#else
        .org    sram
#endif
        ret
        .db     $02
 push bc  ;backup bc
 push af  ;backup a
 ld c,00h
 in a,(00) 
 and 03h  ;probably needed
 cp 02h  ;top
 call z,k02
 cp 01h  ;middle
 call z,k01
 cp 00h  ;both
 call z,k00
   ;nothing ;-)
 ld a,c
 cp 01h ;changed
 call z,changed
 call nz,notchanged 
 pop bc  ;restore bc
 ret
k02:
 ld b,03h ;up
 ld c,01h
 ret
k01:
 ld b,04h ;down
 ld c,01h
 ret
k00:
 ld b,05h ;enter
 ld c,01h
 ret
changed:
 pop af
 ld a,b  ;unrestore if changed
 ret
notchanged:
 pop af
 ret
.end
END