<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 01 Mar 2006 00:52:28 +0000
From   : jgh@... (Jonathan Graham Harston)
Subject: Re: SHELIA and the VIA's

BBC Micro <b_b_c_m_i_c_r_o@...> wrote:
> confused...Page 397 tells us that the VIAs are
> &FE40-&FE7F. The next chapter tells us that VIA-B is
> &FE60-&FE6F.
 
Correct. The VIAs are at &FE40-&FE7F. The System VIA is at
&FE40-&FE5F and the User VIA is at &FE60-&FE7F. There are sixteen
registers in each VIA, so their defined locations at &FE40+x and
&FE60+x
 
> I'm having trouble tying up the memory locations with
> the registers/ports on the VIA can anyone give a list
> from &FE40-&FE7F? I only found the Electron one on the
> internet search.
 
http://mdfs.net/Docs/Comp/BBC/Hardware/SHEILAddrs
 
> I've dissasembled Castle Quest (with 6502dis) and
> looking at the VIA calls. &FE79? Joystick/Timer?
 
&FE79 is a reflection of &FE69. It happens because only address
lines A5-A7 are decoded, so &FE60 is repeated at &FE70. Similarly,
the CRTC is repeated all along &FE00-&FE07.
 
You should never use or depend on accessing anything at a
reflection address.
 
> This was the one of the pieces of code:-
> 
> $2cfc: a5 32            LDA $32
> $2cfe: 38               SEC
> $2cff: ed 79 fe         SBC $fe79
 
They are being naughty. They should have used $fe69. That code has
no guarrantee of working on any hardware that may fully decode the
address of the VIA.
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
RISC OS Internationalisation - http://mdfs.net/Software/RISCOS
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>