<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Mon, 29 Aug 1994 07:45:22 EST
From   : Stephen Quan <quan@...>
Subject: BBC keyboard interrupts.

Frankly, I can't get the System VIA or the keypad to respond.
I have put in debug code that will trace all reads and writes to
&FE40-&FE4F.  Also, I painstakenly got all the flags in IFR and
IER figured out (I might bring it in tomorrow and post the 4 line
macro for both of these 2 via registers to see if anyone see
anything wrong with it).

Basically, in trapping IER, I can see the last value it has after
booting up and coming to the first '>' prompt, the value is 0xF2.
In otherwords, bit 1 is cleared, or that means CA2 interrupts are
disabled.  If this is the case, then how is any keypress going to
respond to the system.  Also I find it odd that whenever a call to
OSRDCH is made it doesn't send anything to the system via, there
is no clue that IER will change from 0xF2 at any point later in
the emulation.

I put in a hack that sets bit 1 of IER if I detect a keypres so
that I can interrupt on CA2.  When this happens, the system actually
goes of and checks sheila for interrupts.  It checks the serial
system, then the system via.  When it does so, it sees IFR with the
changed bit from my interrupt, and it also sees that IER was 0xF3,
and then changes to 0xF2 (by writing 0x01 to IER, I think).  I seem
to have a problem with getting the correct value from the keypad, but
I will eventually nut this out.

Also, I don't know why, for clean entry to the NMI, what I have to do is

    push(P)
    push(PC)
    P |= P_I;
    PC = readmemoryword(0xFFFE);

I noticed in xbeeb by James F, MaskableInterrupt pushses  P and PC onto
the stack the other way around.  When I did that the interrupt never
returned to the same place and spewed a lot of junk as if it was
executing a BRK command and was dumping parts of the BASIC ROM all over
my screen.

I doubled check RTS and RTI and they seem ok.  As a matter of fact,
generating error messages using BRK seems fine, so I don't know why
I should be having problems with maskable interrupts.
-- 
Stephen Quan (quan@...                 ), SysAdmin, Analyst/Programmer.
Centre for Spatial Information Studies, University of Tasmania, Hobart.
GPO BOX 252C, Australia, 7001.  Local Tel: (002) 202898 Fax: (002) 240282
International Callers use +6102 instead of (002).
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>