Re: C64 Expansion Port IO1 and IO2 and PEEK and POKE

From: groepaz_at_gmx.net
Date: Sat, 07 May 2016 20:24:29 +0200
Message-ID: <56281772.KmVzptKL68@rakete>
On Saturday 07 May 2016, 14:15:52 Leif Bloomquist <leif@schemafactor.com> 
wrote:
> Hi all,
> 
> I recently got one of the Dorktronic Expansion Port breakouts
> (http://www.ebay.com/itm/331840785722), great way to explore the
> mysteries of the C64 Expansion Port.
> 
> I have an Arduino wired in, triggering interrupts on falling edges on
> /IO1 and /IO2 incrementing simple counters (one for each).
> 
> It works well, but here's an interesting mystery, that folks on
> cbm-hackers might appreciate.
> 
> When I do a PEEK from BASIC of the IO space (i.e 57088 for IO2), I get
> a single falling edge on /IO2, as expected.
> 
> But when I do a POKE (again from BASIC), I get *two* falling edges.
>  This is quite repeatable.
> 
> That's unexpected, any theories on why this may be?
> 
> I don't have a scope unfortunately.  Had a quick browse through the
> BASIC disassembly, nothing jumped out.
> 
> Ideas?

you can use VICE to examine what happens:

go to monitor and put a tracepoint on $df00:

(C:$e5cf) trace df00
TRACE: 2  C:$df00  (Trace load store)
(C:$e5cf) x

...leave monitor, do poke 57088,123 and enter the monitor again, you see this:

#2 (Trace  load df00)  213 049
.C:b82a  91 14       STA ($14),Y    - A:37 X:37 Y:00 SP:f9 ..-...ZC   82195204
#2 (Trace store df00)  213 049
.C:b82a  91 14       STA ($14),Y    - A:37 X:37 Y:00 SP:f9 ..-...ZC   82195204

so, what you are seeing is the dummy load that happens before the actual store 
:)

-- 

http://www.hitmen-console.org    http://magicdisk.untergrund.net
http://www.pokefinder.org        http://ar.pokefinder.org

Es ist schon alles gesagt worden, nur noch nicht von jedem. 
<Karl Valentin>



       Message was sent through the cbm-hackers mailing list
Received on 2016-05-07 19:00:49

Archive generated by hypermail 2.2.0.