accessing stack variables with inline assembly for gnu c (68000 assembly)
category: code [glöplog]
I'm tired of enumerating variables in stack and would like to use inline assembly!! so I write this:
and the gnu c compiler says this:
I'm trying to move what into %d0. I think I have a conceptual problem, I think I get inline assembly
I'm trying to move what into %d0
what should this look like?
Code:
void test(int what) {
asm("move.l %[what], %d0" :: [what] "r" (what));
}
and the gnu c compiler says this:
Code:
invalid 'asm': operand number out of range
I'm trying to move what into %d0. I think I have a conceptual problem, I think I get inline assembly
I'm trying to move what into %d0
what should this look like?
nevermind, I figured it out
and years from now, someone will have the exact same problem, and they'll find your post with google and get frustrated because you didn't tell what it was you figured out.
here's a hint: stop playing with men's toys, damn woman.
also look up at&t syntax
Quote:
here's a hint: stop playing with men's toys, damn woman.
What? Not that I know either of your genders, what the heck does that have to do with anything? What's wrong with you?
@superplek: fuck off with that sexist attitude.
Fail to locate the funny. Also, 68k, not intel.
@visy: shut up you socialist dick
C'mon people /o\
But yes, @sigflup: please post what the solution was (even if just the new line you used), somebody else may find it useful... or even yourself some time from now on =P
But yes, @sigflup: please post what the solution was (even if just the new line you used), somebody else may find it useful... or even yourself some time from now on =P
sigflup, I went to your website, and I thought that little thing dancing around was really cool! :)
ignore this asshole, i can safely say you can fuck around as much as you want with "men's toys" :)
ignore this asshole, i can safely say you can fuck around as much as you want with "men's toys" :)
Well, I'm hesitant to say why it doesn't work. I changed my register to d1 and it worked fine. I found that if you put your registers in the clobber list it works fine
I wonder who the bitch respects more; superplek the jerk, or the paternalistic jerkoffs. Hmm. And why am I worried about what some bitch thinks, must be the 68k skillz.
Wat?
okay, so who's trolling?
don't feed the trolls
and hey, if nobody is allowed to mess up, nobody learns, Sigflup
and hey, if nobody is allowed to mess up, nobody learns, Sigflup
Yes, you have to put the register in the clobber list to reserve it for your asm code. Otherwise GCC tries to use it and complains that you'll be messing with it in your asm code.
Useful references :
* http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html
* [url]http://www.gtoal.com/compilers101/small_c/vectrexc/INCLUDE/VECTREX.H[/urll] has some useful examples (it's targetted for Vectrex and 6809, but some of it is applicable to other platforms as well, after some register renaming).
Useful references :
* http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html
* [url]http://www.gtoal.com/compilers101/small_c/vectrexc/INCLUDE/VECTREX.H[/urll] has some useful examples (it's targetted for Vectrex and 6809, but some of it is applicable to other platforms as well, after some register renaming).