C Calling convention?

Go To Last Post
59 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

For any system that uses relocatable objects plus a linker, it's
the linker that decides about the final locations things are being
placed to, so that's whom you gotta tell about your interrupt
vectors.

I would not have used such a method if interrupt vectors can be changed in the running program.
If so, I would simply called "SetIntVec."
But I can't.
In my view be better if some feature is entirely in a single file, and I do not need to change something else (such as linker setup) to add for example a UART driver.
Only one "include" and it's work !

Quote:

And I gotta ask - why did you choose this two month old thread about C....

I was looking for a complete solution to the problem and discovered that the thread in google.

Quote:

What software license are you using to license the code? I did not see anything about this in the package.

Anyone can do everything he wants.
I know very little of these legal licensing issues.
What I should specify in the source?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
What I should specify in the source?

"Free BSD" if you want to be as "open" as possible:

http://www.freebsd.org/copyright...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I was looking for a complete solution to the problem and discovered that the thread in google.

But why this thread over the thousands of others on this site? Couldn't you have found one that was actually relevant to your post? Or maybe even try something novel like starting your own thread?

Regards,
Steve A.

The Board helps those that help themselves.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First good rule: PUSH any registers that youR assembler code wants to use on to the stack and POP them off upon exit. That way you know you are screwing nobody up.

 

Then C argument passing convention is that a first argument is passed in R22,R23; second argument in R24,R25 and beyond that you'll have to Google it.

So passing one byte uses two registers, but you can pass two unrelated byte arguments in R22,R23 for example.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Paul you are resurrecting a 9YO thread.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And you are wrong about the ABI anyway. I don't really understand the point in guessing (wrongly) at some answer that even goes on to say "Google the rest"?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
And you are wrong about the ABI anyway.

Well, depends on your toolchain. ;)  But moot given the necromancer aspects today.

 

[edit] Oops -- I missed that this was a multi-page thread and no mention of toolchain on the second page.  Indeed the thread starts out specifying GCC.

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Fri. Feb 17, 2017 - 10:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
Paul you are resurrecting a 9YO thread.

He seems to be making a habit of that:

 

https://www.avrfreaks.net/comment...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...

Pages