| |
cadaver
Registered: Feb 2002 Posts: 1160 |
Do you analyze page crossings / try to eliminate them?
Particularly in a game context, where code isn't easily separated into hot paths + data can be spread out in a manner that is not conductive to page-aligning everything cleanly?
As for the methods, I personally do that by symbol table analysis + a customizable simple emulator for runtime detection & counting ( https://github.com/cadaver/oldschoolengine2 ) |
|
... 28 posts hidden. Click here to view all posts.... |
| |
Oswald
Registered: Apr 2002 Posts: 5103 |
Quote: If someone would happen to feel like it, don't hesitate to write a short article on this topic on codebase64.
https://codebase64.org/doku.php?id=start
By the way: I just realised that the Codebase64 wiki has existed for 17 years now. Quite a while. :)
//FTC
thank you for keeping it alive, I bet it helped countless coders throughout the years. I use it to steal some routines from time to time I know. |
| |
Oswald
Registered: Apr 2002 Posts: 5103 |
Quote: I sometimes use macros like this:
!macro lobcs .target {
!if (* - .target) <= 126 {
bcs .target
} else {
bcc +
jmp .target
+
}
}
.copy
... Code that might grow or shrink depending on zeropage usage etc ...
+lobcs .copy
with a switch 64tass does this automatically for you, every too far branch is replaced like that.
.page
...
.endp
if a page is crossed between .page and .endp you get a warning. |
| |
Martin Piper
Registered: Nov 2007 Posts: 726 |
Quote: with a switch 64tass does this automatically for you, every too far branch is replaced like that.
.page
...
.endp
if a page is crossed between .page and .endp you get a warning.
Yeah I don't want a switch to have that for every branch, I want more control. I never really liked TASS, it never felt like a good assembler. |
| |
Krill
Registered: Apr 2002 Posts: 2997 |
Quoting Martin PiperI never really liked TASS, it never felt like a good assembler. Care to elaborate? :)
I, for one, prefer my assembler's pseudo-ops not to scream at me (and the assembler itself to accept canonical syntax). |
| |
chatGPZ
Registered: Dec 2001 Posts: 11433 |
--fullstop to the rescue :D
I prefer ACME too, only because the dev is on IRC so i can yell at him when something doesn't work as expected :) |
| |
Martin Piper
Registered: Nov 2007 Posts: 726 |
Quote: Quoting Martin PiperI never really liked TASS, it never felt like a good assembler. Care to elaborate? :)
I, for one, prefer my assembler's pseudo-ops not to scream at me (and the assembler itself to accept canonical syntax).
It's mostly the syntax. For example, having "." used for directives feels very wrong. For me a "." is meant to be a local label, and a label without is a global label.
Then after .text and .byte etc we have functions, like binary(), suddenly appear with a different syntax and naming convention again.
I really just get a massive headache every time I look at TASS stuff.
I've tweaked ACME to include much better label resolving and code generation that can settle on stable addresses instead of aborting the assembly. I've also added python support for inline assembly and data generation. With these additions, I don't need TASS. |
| |
Raistlin
Registered: Mar 2007 Posts: 694 |
We're veering off topic here but I prefer KickAss .. for reasons hinted at in its name. I wish it wasn't Java-based, of course, but that's not such a huge bugbear. |
| |
Frantic
Registered: Mar 2003 Posts: 1650 |
Quote: thank you for keeping it alive, I bet it helped countless coders throughout the years. I use it to steal some routines from time to time I know.
👍 Credits should also go to CountZero for hosting, and Moloch for providing the domain name. |
| |
soci
Registered: Sep 2003 Posts: 483 |
Quoting Martin PiperI've tweaked ACME to include much better label resolving and code generation that can settle on stable addresses instead of aborting the assembly. I've also added python support for inline assembly and data generation. With these additions, I don't need TASS.
Hmm, interesting. I take it as a compliment.
Back on topic I do align stuff but only as needed. Did profiling once in a while like on cfsfsck where it was not obvious what takes the most time. But for effects it's usually easy to know which loop(s) need such branch/table optimizations.
Btw. while listing all page crossing branches can be insightful too that's not how it goes. As mentioned above page checks for branch or table page crosses are added where these matter. Sometime in the past I got a friendly reminder that these two crossings are not exactly the same so there's a way to distinguish which one is meant.
Assertions are good but they do trigger eventually and then comes the code reshuffling, sticking stuff to explicit addresses or adding of alignments. To avoid the first two I did some work last year on alignments ( https://tass64.sourceforge.net/#alignment ). Just so I don't need to worry about wasting more than what's necessary for interrupt routines with small timing loops in them. Or to only align a critical table if it's really necessary.
Such alignments were possible through creative use of fill directive already so there's nothing new under the sun. |
| |
Martin Piper
Registered: Nov 2007 Posts: 726 |
Quote: We're veering off topic here but I prefer KickAss .. for reasons hinted at in its name. I wish it wasn't Java-based, of course, but that's not such a huge bugbear.
Hah. I've been thinking of converting ACME to Java so I can integrate assembly into testing and profile guided optimisation. It would allow branch optimisation and also choose which labels/data to put in zeropage. |
Previous - 1 | 2 | 3 | 4 - Next |