[A83] Re: interrupt with rom calls
[Prev][Next][Index][Thread]
[A83] Re: interrupt with rom calls
> From: "SUCKER from the old days" <sucker_pvn@hotmail.com>
>
> What should I do if I want to use rom calls inside of my interrupt?
> I heard somebody say something about rom pages, and that
> is also said in ASMguru. My password program sure can't
> work without those calls.
On th 83+ you can use bcall's as you usualy do. On the 83- you must switch
to rom page 0Ch. Before you do that, you must first save the current rom
page in order to switch back to it afterwards.
( Some background on 83- rompages. There are 16 pages in total (00h - 0Fh).
Page 0Ch is the one that contains all the calls to the proper TIOS routines.
Switching between rom pages is done through port 00h and 02h. The lower
three bits of the page number are ORed with 88h and outed to port 02h. Bit 3
of the page number is outed to bit 4 of port 00h. Notice that port 00h's
highest two bits are always set. )
So in your code, you could do something like this.
[...]
shutdown:
[...]
ei
halt
in a,(2) ; get current rom page and save it
push af ;
in a,(0) ;
push af ;
ld a,$8C ; 04h ORed with 88h
out (2),a ;
ld a,$D0 ; 10h
out (0),a ;
[..use rom calls here..]
pop af ; restore rom page
out (0),a ;
pop af ;
out (2),a ;
ret ;
resume:
[...]
Follow-Ups:
References: