Kodewerx
https://www.kodewerx.org/forum/

as.exe is a piece of trash
https://www.kodewerx.org/forum/viewtopic.php?f=11&t=7038
Page 1 of 1

Author:  Hextator [ Sat Oct 03, 2009 11:37 am ]
Post subject:  as.exe is a piece of trash

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.

Author:  Parasyte [ Sun Oct 04, 2009 2:38 pm ]
Post subject:  Re: as.exe is a piece of trash

What's this? Another idiot rant instead of a helpful bug report?

No wonder developers hate users.

Author:  Hextator [ Sun Oct 04, 2009 8:32 pm ]
Post subject: 

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?

Author:  Parasyte [ Mon Oct 05, 2009 3:54 pm ]
Post subject:  Re: as.exe is a piece of trash

Bugs is bugs, homeboy.

Author:  HyperHacker [ Tue Oct 06, 2009 5:51 pm ]
Post subject:  Re: as.exe is a piece of trash

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 ">>".

Author:  Parasyte [ Wed Oct 07, 2009 3:49 pm ]
Post subject:  Re: as.exe is a piece of trash

Those don't sound like bugs at all, nor do they sound stupid, nor unhelpful.

Author:  HyperHacker [ Fri Oct 09, 2009 10:15 pm ]
Post subject:  Re: as.exe is a piece of trash

That's because they're examples of useful warnings.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/