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 > SHX/SHY
2012-11-26 14:30
Oswald

Registered: Apr 2002
Posts: 5020
SHX/SHY

I cant seem to get them working. I'm not sure wether the value for the AND comes from the PC counter or from the destination address, anyway neither running code at $ff00 or storing to $ff00 does work. maybe vice does not support this illegal?

edit: vice 2.2 unstable, x64 on win7.
 
... 25 posts hidden. Click here to view all posts....
 
2019-09-25 05:15
ChristopherJam

Registered: Aug 2004
Posts: 1378
Quoting Copyfault
Both the No more secrets-document and the codebase entry still have some vague phrasing so I dare to ask:

1. Does
Sometimes the AND "#<adr_hi>+1" drops off
actually mean
iff the write-cycle of the SH*-command is processed during an "X"-cycle (DMA-bus-overtake-cycle), the AND drops off?
Or are there more dependencies for the AND to drop off?


I think your timing's slightly off (the instruction needs to be paused after its 3rd cycle for the drop off to occur), but otherwise yes.


Quote:
2. ...
The page where the value is stored may be equal to the value stored


That "may be" is technically true; - read on :)

Quote:
iff there is a page break, the page where the value is stored is (<adr_hi> + 1) & y (ex. for SHY).


This is correct - hence the page is only equal to the value stored if the &(h+1) drop off you mentioned in (1) does not occur.


Quote:
3. Does the page miscalculation as described under 2. also happen on an "X"-cycle? My C64-intuition would say that also the page break fixup works normally on those "X"-cycles, but I did not test anything so far...


The page miscalculation occurs regardless of whether/when the instruction is interrupted by a DMA.

So, the good news is an unexpected DMA won't result in you trashing an unexpected address, it'll just change the value you write to it.

The above behavior has been implemented in VICE for quite some time now, and mostly covered by the test code in

https://svn.code.sf.net/p/vice-emu/code/testprogs/CPU

I added a couple of tests a few days ago to have a closer look at how the &(H+1) drop off compares to cycle stealing; check out *5.s in the shs and shxy subdirectories of the above.


tl;dr:


high byte of address written to, when:
 +--------+------------------+---------------+
 |        | no DMA on cycleN | DMA on cycleN |
 +--------+------------------+---------------+
 |page    |                  |               |
 |not     |        H         |       H       |
 |crossed |                  |               |
 +--------+------------------+---------------+
 |page    |                  |               |
 |crossed |     Y&(H+1)      |   Y&(H+1)     |
 |        |                  |               |
 +--------+------------------+---------------+

value written, when:
 +--------+------------------+---------------+
 |        | no DMA on cycleN | DMA on cycleN |
 +--------+------------------+---------------+
 |page    |                  |               |
 |not     |     Y&(H+1)      |       Y       |
 |crossed |                  |               |
 +--------+------------------+---------------+
 |page    |                  |               |
 |crossed |     Y&(H+1)      |       Y       |
 |        |                  |               |
 +--------+------------------+---------------+
Previous - 1 | 2 | 3 | 4 - Next
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
haschpipan
Guests online: 130
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 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
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 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 S!R  (9.7)
5 Faayd  (9.7)

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