Re: A86: quick off


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

Re: A86: quick off




On Sun, 13 Sep 1992 06:14:06,
assembly-86@lists.ticalc.org wrote...
>
>At 10:30 PM 12/18/97 -0600, you wrote:
>>heres a small, unintelligent pre-beta program that shuts your calc off
>>when you press on. only prob is you have to pull out a battery and press
>>on to turn the calc on without it turning off again. im planning on
>>using a routine to stop this....somehow :)
>
>It's easy enough - Try this:
>
>--Joshua
>
>>int:
>>   push af
>>   push bc
>>   push hl
>>
>    ld a,(OnToggle)
>    xor 1	    ;flip bit 0
>    or a
>    jr z,i0	    ;if it's clear, don't turn the calc off.
>
>>   in a,(3)        ;check for on being pressed
>>   and $8          ;|
>>   or 0            ;V
>>   jr nz,i0        ;if it wasn't then goto i0
>>   res 4,(IY+9)    ;reset break status
>>   pushR           ;save the registers
>>   call $0C29      ;turn the calc off
>>   popR            ;return the registers
>>
>>i0:
>>
>>   pop hl
>>   pop bc
>>   pop af
>>   ret
>>
>OnToggle equ $-int+_user_int_ram
>    .db 0
>
>>int_end:
>>
>>.end

i thought of a better way, i could just send a keypress, like EXIT to the 
calc after it turns back on, that should work