This was based on info from a book called z-80 Workshop manual by E.A Parr.
The I register gives the high part of the table and the hardware gives the
low part to the table then takes that word for the service routine. So if
you start from one byte before the table and use the same address for all
entries and over run it by one it will work. My demo of a full scrolling
football pitch used this system, which I believe you saw many years a go.
Dave
----- Original Message -----
From: "Andrew Collier" <[EMAIL PROTECTED]>
To: <sam-users@nvg.ntnu.no>
Sent: Tuesday, May 20, 2008 9:50 PM
Subject: Re: Short, short questions
Hi,
I'm sceptical about this claim. I've never heard anybody say that the
vector formed is big-endian - it's just you don't know the byte offset
from which the interrupt vector will be fetched. (As Edwin says, it is
usually 255 - which is odd so your 1-aligned table will usually work -
but I don't know that Sam's hardware guarantees this).
So the high byte comes from I, the low byte from the data bus; this forms
a 16 bit address which will be incremented once (which is why the table
needs 257 bytes, not 256). You could, at least in theory, read the vector
address from even or odd overlapping entries, which is why the usual
strategy is to pick a vector address whose low and high bytes are the
same.
The last IM2 interrupt routine I wrote looked something like this:
ds ALIGN 256
IM2TABLE: equ $
IM2BYTE: equ im2table/256
IM2TARGETBYTE: equ IM2BYTE+1
for 257, DB IM2TARGETBYTE
IM2TARGET: equ 257*IM2TARGETBYTE
ds IM2TARGET-$
EX AF,AF'
...
Andrew
On 20 May 2008, at 21:16, David Brant wrote:
Mode 2 uses a table with 128 word address but as byte high,byte low not
the normal low, high bytes
So if you set your org/dump address to &??FF (i.e. &??00-1)
and then do
DEFW mode2.i,mode2.i
so you have 129 words.
mode2.i:
di
push af
in a,(status.int)
.....
.....
ei
ret
----- Original Message ----- From: "Andrew Collier"
<[EMAIL PROTECTED]
>
To: <sam-users@nvg.ntnu.no>
Sent: Tuesday, May 20, 2008 3:22 PM
Subject: Re: Short, short questions
The usual strategies are to use mode 1, or to use mode 2 with a 257-
byte table all
containing the same byte.
--
--- Andrew Collier ----
---- http://www.intensity.org.uk/ ---
--