6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Sep 19, 2024 9:23 pm

All times are UTC




Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Tue Dec 29, 2015 7:23 pm 
Offline

Joined: Sun Nov 17, 2013 5:15 am
Posts: 12
GARTHWILSON wrote:
However, I don't remember ever having to page-align anything in 65c02 anyway. The only use I can think of for page alignment is if something had to be cycle-exact for timing a loop or process, . . .

Reasons I have seen for alignment on (NMOS) 6502:
  • Branching in cycle-exact code -- timing only
  • Table access in cycle-exact code (outside ZP) -- timing only
  • Keeping indexed tables within ZP --a must, not about timing
  • Interfacing with other code that assumes whole-page alignment (passing only the page, supplying 00 as the low byte) -- also not optional
  • Boundaries relating to ROM or RAM areas... but this is more a matter of locating segments correctly, not about the code requiring alignment for correct execution.

Maybe others, but I think that's about it.

Yes, it's probably not a great idea to trust a tool to make correct choices relating to cycle-exact code, I'd have to consider that more closely. It is already so detail-oriented that the care around aligning it should be as great. I chose page alignment as an example because it is relatively easy to understand, and was similar to the OP's premise.

GARTHWILSON wrote:
. . . and the extra cycle taken by branching or indexing across a page boundary would be a problem.

Not necessarily... The cycle-exact part could be fully contained in the aligned segment, and the timing to get there is not critical. If the timed code does (or more aptly could) cross between the segments, then it depends on the type of alignment... if it is "fit within page", then it's possible the branch timing could vary... but if it is "start of page", then the extra cycle is a given, and is already accounted for.


Top
 Profile  
Reply with quote  
PostPosted: Tue Dec 29, 2015 7:43 pm 
Offline

Joined: Sun Nov 17, 2013 5:15 am
Posts: 12
GARTHWILSON wrote:
. . . In my macros to form program structures in 65c02 assembly . . . language

Damn, bro... good stuff. Site bookmarked.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: