Re: A86: Re: Greeting Messages


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

Re: A86: Re: Greeting Messages



Actually both _alt_on_exec and _alt_off_exec are called with page d swapped.  
It's just in the interrupt routine that you have to worry about the pages.
(Dunno about slink...)

If you want some example source you can take a look at On86, which may
actually do what you want; it says "Property of _____" at calc start-up,
though it also asks for a password.

Also, it is not advisable to use David's code _exactly_ as he as written it,
seeing as how no shell will even list it :-)  Stick a call _clrLCD in there
are the beginning or something.


In a message dated 11/11/00 5:20:57 AM Eastern Standard Time, david@acz.org
writes:


You copy the code that you want to run to _alt_on_exec, similiar to
_alt_interrupt_exec.  Then you set the correct checksum and enable the flag.
After that, it will run everytime the calc is turned on.  I just wrote this
from memory, so I guessed on a couple of things.  I would guess that ROM
page D cannot be assumed to be loaded, so the handler swaps it in before
making ROM calls.  Second, I am assuming that it is good to restore the old
ROM page after changing it, so that is done as well.


#include "ti86asm.inc"

.org _asm_exec_ram

bit alt_on,(iy+exceptionflg)       ; check if already installed
jr z,Install
res alt_on,(iy+exceptionflg)       ; uninstall by resetting flag
ld hl,Uninstalled
jp _puts
Install:
ld hl,AltOnRoutine                 ; copy the routine
ld de,_alt_on_exec                 ; to _alt_on_exec
push de
ld bc,AltOnSize
ldir
ld de,40                           ; bytes to checksum are
pop hl                             ; 1, 40, 80, 120, 160 and 200
ld a,(hl)
dec hl
push hl
ld b,5
CalcChecksum:
add hl,de
add a,(hl)
djnz CalcChecksum
pop hl
ld (hl),a                          ; write checksum to alt_on_chksum
set alt_on,(iy+exceptionflg)       ; install by setting flag
ld hl,Installed
jp _puts
Installed:
.db "Installed",0
Uninstalled:
.db "Uninstalled",0
AltOnRoutine:
ld hl,Message-AltOnRoutine+_alt_on_exec    ; code is at _alt_on_exec,
in a,(5)                                   ; not asm_exec_ram
push af                            ; make sure to save current ROM page
ld a,$d
out (5),a                          ; switch to ROM page D
call _puts
call _newline
pop af
out (5),a                          ; restore old ROM page
ret
Message:
.db "Turn me off!",0
AltOnSize = $ - AltOnRoutine







----
Jonah Cohen
<ComAsYuAre@aol.com>
http://jonah.ticalc.org

Follow-Ups: