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: 42
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: 42
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: 1078
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: 42
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
El Jefe/Slackers^sidD
Dan
MWR/Visdom
csabanw
Metal Maniac/Dual Crew
McGurk/Coma
Xiny6581/Dees Produc..
Morpheus/IPC+C64.COM
E$G/HF ⭐ 7
algorithm
Guests online: 116
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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