In gcc4ti, we have a syntax like this to interface with assembly libraries:

;short CollideSprite8 (register short x0 asm ("%d0"), 
; register short y0 asm ("%d1"),
; register short x1 asm ("%d2"),
; register short y1 asm ("%d3"),
; register short h asm ("%d4"),
; register void *sprite0 asm ("%a0"),
; register void *sprite1 asm ("%a1"));

Sebastien

On Thu, Nov 11, 2010 at 11:59 AM, SourceForge.net <noreply@sourceforge.net> wrote:
Feature Requests item #2886060, was opened at 2009-10-25 22:04
Message generated for change (Comment added) made by b-s-a
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=350599&aid=2886060&group_id=599

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: z80 port
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: fullmetalcoder (fullmetalcoder)
Assigned to: Nobody/Anonymous (nobody)
Summary: A new "class" of functions

Initial Comment:
I find myself in a case which I suspect is not that rare : I need to wrap system calls for a particular platform (z80 in my case but I'm sure the ssue is similar in all ports) in a lib to make them available to C code. My two problems are :

 * writing all the wrappers by hand is cumbersome
 * the resulting is *dramatically underoptimized*

my proposal is to define a new class of function that go beyond what _naked offers and specify which registers should be used for parameter passing (for both input and output). This would open huge opportunities for optimizations, do away with wasteful use of index registers and stack and vastly reduce the overhead of wrapper functions at all levels (writing, size and speed).

I have no idea how hard this would be to implement and unsure as to what would be the best way to add these attributes to function declaration but what I'm dead sure about is that it would be a huge improvement that would increase the competitivity of C over handwritten assembly and that's something I'm interested in.

----------------------------------------------------------------------

Comment By: b-s-a (b-s-a)
Date: 2010-11-11 13:59

Message:
related issue ID:1921061:
https://sourceforge.net/tracker/?func=detail&aid=1921061&group_id=599&atid=350599

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=350599&aid=2886060&group_id=599

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
sdcc-devel mailing list
sdcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-devel