[A83] Re: ASM program space alocation


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

[A83] Re: ASM program space alocation




> 
> > Is there any good documentation on interrupts, and on the 
> in and out 
> > functions?
> 
> This is a good interrupt guide:
> 
> http://www.ticalc.org/pub/text/z80/intguide.txt
> 

(Note: all of the following is theory, I didn't test anything of it!)

There might be an error in that guide. It says "Say the LSB is $45.  The
calculator will jump to $9945, right?"
Well, the Z80 docs describe IM2 too. I copied the following literally from
Zilogs documentation:

"The lower eight bits of the pointer must be supplied by
the interrupting device. Only seven bits are required from the interrupting
device because the least-significant bit must be a zero. This is required
because the pointer is used to get two adjacent bytes to form a complete 16-
bit service routine starting address and the addresses must always start in
even locations."

That would mean that the LSB could never be $45. If the value on the
bus happened to be $45, it would be interpreted as $44. (I think.)
This also has two nice side-effects: the address you jump to doesn't
have to be something with MSB=LSB, if you want to jump to $89AB
that's possible too. And you can make a 256-byte jumptable, instead
of a 257-byte table.
(Just a reminder: the addresses must be stored LSB first)

Rob van Wijk

> There was also a recent discussion about it on this list in 
> November/December.
> 
> I don't know of a good port reference apart from the one 
> that Dan Englender (at least I think it was him) posted 
> here a couple of weeks ago this year.
> 
> PG
> 

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net




Follow-Ups: References: