Calling C function from assembly

Programming, for all ages and all languages.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Calling C function from assembly

Post by Combuster »

BMW wrote:Your two accusations are based on an assumption
I wrote:especially not in the likely case your unposted code screwed something up again.
Q.E.D. Your posting habits force me into doing "guesswork", and the worst thing of it all is that it still happens to be more accurate than your own more "scientific" method.

After all, based on the description of the fix, the bug is still there. As per Occams Razor, the technology behind it is too advanced for you so that you treat it like magic and implement a workaround (bound to bite you later) instead of actually getting rid of the thing.



As for you being able to write C: Turn GCC's friendly-and-all-compatible mode off for a change and see for yourself how bad all your existing code is. The magic command line flags are

Code: Select all

-std=c99 -pedantic -Werror -Wall -Wextra
Point in case: your last two lines of code don't compile anymore and gcc perfectly explains why.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
BMW
Member
Member
Posts: 286
Joined: Mon Nov 05, 2012 8:31 pm
Location: New Zealand

Re: Calling C function from assembly

Post by BMW »

Combuster wrote: After all, based on the description of the fix, the bug is still there. As per Occams Razor, the technology behind it is too advanced for you so that you treat it like magic and implement a workaround (bound to bite you later) instead of actually getting rid of the thing.
Are you talking about the itoa fix or the Calling C function from assembly fix? If you are talking about the itoa fix, I believe there is nothing wrong with that method. Please explain.
Combuster wrote: As for you being able to write C: Turn GCC's friendly-and-all-compatible mode off for a change and see for yourself how bad all your existing code is. The magic command line flags are

Code: Select all

-std=c99 -pedantic -Werror -Wall -Wextra
Point in case: your last two lines of code don't compile anymore and gcc perfectly explains why.
I posted earlier saying I changed it to:

Code: Select all

char a[16] = {0};
itoa(number, a, 10);
(if that's what you're talking about, there are no warnings/errors with all those command line flags)
Currently developing Lithium OS (LiOS).

Recursive paging saves lives.
"I want to change the world, but they won't give me the source code."
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Calling C function from assembly

Post by Combuster »

BMW wrote:I posted earlier saying I changed it to:

Code: Select all

char a[16] = {0};
itoa(number, a, 10);
BMW actually wrote:

Code: Select all

char a[16] = {NULL};
itoa(number, a, 10);
I do not appreciate liars.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Locked