Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Question about indirect ZP
2014-10-26 10:36
Starfox

Registered: Jul 2014
Posts: 31
Question about indirect ZP

I was watching the memory reads in ICU for VICE and saw that on reads from (ZP),y if it crosses the page boundary - it reads from 2 adresses (see the screenshot: https://dl.dropboxusercontent.com/u/4130839/zeropage.png)

I had ($f0) pointing at $13fe, and the Y register was 3 which gives the address $1401. It reads from both $1301 and $1401. The byte returned is from $1401. Is this a quirk of ICU, or does it just do that internally because of wraparound?

Cheers,

Peter
2014-10-26 11:33
Ejner

Registered: Oct 2012
Posts: 43
Hi,

Maybe I'm missing something, I don't see what indicates any read from $1301 ?

Anyway, as far as I remember there should be no wraparound in the code you're using. Wraparounds occur when using f.i. lda ($f0,x), if x is so high that the final read address exceeds the zeropage. Then the readaddress wrapsaround and stays in the zeropage.

But as I said, maybe I'm missing something..?
2014-10-26 11:40
Starfox

Registered: Jul 2014
Posts: 31
hello :-)

The adress turns green on read in the ICU debugger when stepping though. They ($1301 and $1401) become green at seemingly the same time. But ICU is very prone to crashing, so who knows if it isn't a bug.
I was just curious about it.

Edit: in the screenshot if you look closely you can see that they are dark green while the surrounding bytes are Black. I guess it doesn't matter as it isn't a bug in the code, as you explained.
2014-10-26 12:28
MagerValp

Registered: Dec 2001
Posts: 1055
The 6502 does a dummy read when indexed addressing causes an extra cycle, as it needs that cycle to adjust the MSB of the target address.
2014-10-26 12:30
Starfox

Registered: Jul 2014
Posts: 31
Ohh, that explains it then, thanks :)
2014-10-26 20:35
Mace

Registered: May 2002
Posts: 1799
I learn every time I come to this forum.
Thanks.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Fred/Channel 4
Majikeyric
Menace/Spaceballs
Chico/Civitas
Pad/G★P
Bieno/Commodore Plus
Guests online: 135
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Logo Graphicians
1 Sander  (10)
2 Facet  (9.7)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.032 sec.