Re: A86: im 0
[Prev][Next][Index][Thread]
Re: A86: im 0
No, that's IM 2. Both IM 1 and IM 2 are called 200 times a second by the
calculator, if timer interrupts are enabled (port 3 controls that).
However, the calc can only be in one interrupt mode at a time (mode 0, 1 or
2). When an IM 2 interrupt is triggered, the processor forms a 2-byte
address. The high byte (MSB) is taken from the I register. The low byte
(LSB) is taken from the data bus. However, the calculators don't have a
data bus, so the value can and will be anything. So you need to create a
257 byte vector table (the low byte can be any of 256 values, and a 2-byte
value is read...Mardell is correct, it does NOT have to be even...I crashed
my calc [but not TI86EMU] several times testing this).
The vector table needs to be filled with the same value, because the calc
will read two bytes from anywhere in it. The calc reads the two bytes to
form another 16-bit address. It then calls this address. For example, you
could store your vector table starting at $8100. Note that it HAS to start
at a 256 byte boundary, because the low byte could be anything. For this,
you would set the I register to $81. When the interrupt is called, it will
read an address from $81XX, where XX is random.
A good place to put the interrupt handler might be $8080 (close to start of
ram page 1). Note that the both bytes of the address HAVE to be the same,
becuase the value can be read from any part of the table. For this, you
would fill all 257 bytes of the table with $80. After setting this up, you
set IM 2 to activate your interrupt. Also make sure you disable interrupts
for the duration, so they aren't called in the middle of the installation.
For more info, see 86 Central: http://ti86.acz.org/
--
David Phillips <david@acz.org>
http://www.acz.org/
----- Original Message -----
From: <HonorIam2@aol.com>
To: <assembly-86@lists.ticalc.org>
Sent: Thursday, January 14, 1999 10:55 PM
Subject: Re: A86: im 0
>
>as far as I can remember from the syntax for im 0 on the 85, it doesn't
>execute code in the register, but uses the register as a pointer to the
>executed code, but I can't remember exactly where, I think it is at ii,
which
>means with i=$0c it would execute code at $0c0c in the ram. Don't trust me
>completely on this but Jimmy Mardell's Gamewizard for Zshell did something
>like that.
>