:Asm(FDCB1696)It doesn't work with zStart when the program is set on startup D:
:Return
The first line tells the calculator to power off when the program exits, and the second line exits the program. (If you are in a subroutine when you run this, you should use Returnr instead of Return.)Spoiler For Spoiler:
.org $8001
bit 4, (iy + 8)
ret z ;this was a purposeful turn off
;do whatever you want, here's an example if you want to run an axe program
ld hl, axeName
rst 20h
bcall(_executePrgm)
;when you are done, you have two options
ret ;this will turn the calculator off
bcall(_jForceCMDNoChar) ;this will turn the calculator on
axeName:
.db protProgObj, "AXEPROG", 0
OFFSCRPT.8xv (appVar) gets copied to $8001 every time the calculator turns off. This catches both 2ND + ON as well as APD. So instead of going to APD, it can just display your screen saver.
QuoteOFFSCRPT.8xv (appVar) gets copied to $8001 every time the calculator turns off. This catches both 2ND + ON as well as APD. So instead of going to APD, it can just display your screen saver.
My OFFSCRPT always crashs the calc. The code is copied to $8001 and executed. But every times it reaches bcall(_jForceCMDNoChar) the calculator simply doesn't react anymore
I leaved the
bit 4, (iy + 8 )
out because this way the bit is set always and my code is never executed
QuoteOFFSCRPT.8xv (appVar) gets copied to $8001 every time the calculator turns off. This catches both 2ND + ON as well as APD. So instead of going to APD, it can just display your screen saver.
My OFFSCRPT always crashs the calc. The code is copied to $8001 and executed. But every times it reaches bcall(_jForceCMDNoChar) the calculator simply doesn't react anymore
I leaved the
bit 4, (iy + 8 )
out because this way the bit is set always and my code is never executed
Well...
- Before calling OFFSCRPT, the OS turns the LCD off and disables all interrupts (via port 3.)
[...]
- GetKey halts the CPU, which freezes the system since interrupts have been disabled.
As FloppusMaximus said here (http://www.cemetech.net/forum/viewtopic.php?p=195738#195738) :Quote from: FloppusMaximusWell...
- Before calling OFFSCRPT, the OS turns the LCD off and disables all interrupts (via port 3.)
[...]
- GetKey halts the CPU, which freezes the system since interrupts have been disabled.
.org $8001
ld a,3
out ($10),a
ret
.end
.org $8001
ld a,3
out ($10),a
loop:
ld a,$FD
out (1),a
in a,(1)
bit 6,a
ret z
jr loop
.end