Kodewerx

Our culture has advanced beyond all that you could possibly comprehend with one hundred percent of your brain.
It is currently Thu Mar 28, 2024 12:02 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Oct 03, 2009 11:37 am 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
Look at this:

Code:
@   The assembler screws this
.set            RCH_POST_ORIGIN, RCH_PRIOR_ORIGIN + RCH_PRIOR_SIZE
@   Here, RCH_PRIOR_SIZE was clearly 0x1C (I even had .long RCH_PRIOR_SIZE as one of the lines and it outputs correctly right up until it is used in this equation, just after which is appears as -4 as though its use in the expression modified the value)

What's clearly happening from my debugging is the variable RCH_PRIOR_SIZE is being randomly modified before it's used in the evaluations of the expression. Oddly enough, inserting debugging lines to help me find the integers in the output binary actually causes the binary output to be correct where it usually wouldn't be, and removing that debug output (which is just in the form of ".long 0xEFBEADDE" <- DEADBEEF) caused it to fudge again, implying that the processing related to directives has some severely awkward edge case.

I could file a bug report but it couldn't be handled soon enough. In the mean time I'd like suggestions as to an alternative method of calculating these values (which are defined using the ".set" directive for each variable elsewhere in the source; don't suggest using ".equ" instead: I tried that too on the grounds that supposedly ".equ" creates a "symbol" and not a "variable" which I guessed might be different enough for the former to work where the latter clearly didn't). Or, if you know of a better assembler altogether, that'd be great.

FUCK devkitARM. I bet you they still have the ldrh/ldsb confusion bug in the damn thing. Seriously, how stupid do you have to be to use a user defined variable as a scratch register for your program (which is what it looks like it's doing)? I defined it for MY program. Get your shitty code off my variables' nuts!

Edit: Turns out they DID fix the ldrh/ldsb confusion. I just checked and it wasn't even a bit off; how the hell did the two get confused?

In the mean time, I'm getting around this bug by using a larger expression that calculates what RCH_PRIOR_SIZE should be in the expression on the fly instead of reusing it from its last calculation, since doing the latter, as I've said, causes the stupid assembler to temporarily use the incorrect value for that variable and botch the output.

Edit: Also, this

Code:
bl            SUBTRACT_FUNCTION - RCH_PRIOR_ORIGIN + RCH_PRIOR_START

Causes a warning despite not only being perfectly valid, but yielding the desired output, as well.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 04, 2009 2:38 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
What's this? Another idiot rant instead of a helpful bug report?

No wonder developers hate users.

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Oct 04, 2009 8:32 pm 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
Heh, I'm actually in that same situation with the users of my program.

Except I'm not the one who caused the bugs.

AND

this particular as.exe bug is just inexcusable. How could something like that even happen?

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 05, 2009 3:54 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
Bugs is bugs, homeboy.

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 06, 2009 5:51 pm 
Offline
Komrade
Komrade
User avatar

Joined: Tue Mar 27, 2007 6:23 pm
Posts: 1354
Location: Mario Raceway, 1509.831, 217.198, -564.429
Title: Mario Kart 64 Hacker
Warnings generally mean "this will work exactly as you specified, but you probably meant something else" or "this won't work on all systems/assemblers/etc." If you stuff this into gcc:
Code:
const char *foo = "hello"; char x = foo[-1];
it'll go right ahead and compile it as you'd expect, but warn you that that's a pretty dumb thing to do. Or if you have some crazy C++ construct like
Code:
std::vector<std::list<int>>
, IIRC, it will work fine but warn you that in future standards a space will be required between the ">>".

_________________
Image 143
HyperNova Software is now live (but may take a few tries to load) currently down; check out my PSP/DS/Game Boy/Windows/Linux homebrew, ROM hacks, and Gameshark codes!


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 07, 2009 3:49 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
Those don't sound like bugs at all, nor do they sound stupid, nor unhelpful.

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 09, 2009 10:15 pm 
Offline
Komrade
Komrade
User avatar

Joined: Tue Mar 27, 2007 6:23 pm
Posts: 1354
Location: Mario Raceway, 1509.831, 217.198, -564.429
Title: Mario Kart 64 Hacker
That's because they're examples of useful warnings.

_________________
Image 143
HyperNova Software is now live (but may take a few tries to load) currently down; check out my PSP/DS/Game Boy/Windows/Linux homebrew, ROM hacks, and Gameshark codes!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Yandex [RuBot] and 162 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:  
Powered by phpBB® Forum Software © phpBB Group