Surely set would only work if I had an unsigned offset from the beginning of a table? I'm using a signed offset from the middle of a table.

On 20 May 2008, at 19:48, Edwin Blink wrote:

1)

Normally the value is &FF and it looks pretty stable too considering PRO-DOS uses IM 2 without a vector table. So your choices are IM 0/ IM 1 both do a RST 38H or IM 2 which 'calls' the adress found at the address pointed by I register (MSB) and the value on the databus (LSB). Like the speccy there may be some hardware connected that changes the default value on the databus so a 257 byte vector table is recomended.


2)

If choose to put all the LSB at 32768 followed by the MSB then you could use the following:

set 7,h
ld    e,(hl)
set 3,h
ld    d,(hl)

Other usefull addresses for the table would be 16384 (use SET 6,H), 8192 (SET 5,H), 4096 (SET 4,H) or 0 (you don't need the first SET instruction at all)

Edwin


----- Original Message ----- From: "Thomas Harte" <[EMAIL PROTECTED] >
To: <sam-users@nvg.ntnu.no>
Sent: Tuesday, May 20, 2008 3:03 PM
Subject: Short, short questions


I'm about to finish my lunch break, sorry if I sound slightly short...

1) is there any pattern or logic to the values placed on the bus
during interrupts? I guess an equivalent question is: what realistic
options do I have on the Sam for catching and processing interrupts?

2) are there any non-obvious tricks for fast access to a table
containing 16bit words, indexed by an 11bit (signed) integer? At the
minute I'm essentially doing:

[stuff to work out offset into table in hl]
ld bc, <address of middle of table - which is aligned to a two-byte boundary>
add hl, hl
add hl, bc
ld e, (hl)
inc l
ld d, (hl)


Reply via email to