English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 20 May 2011, 01:34   #1
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,406
VBCC assembler linking syntax?

I'm trying to call some assembler code (which has been compiled into an object using PhxAss) from my 'C' code.

For gcc I have to do this kind of crap:

Code:
void c2p1x1_8_c5_bm_stub(UWORD chunkyx, UWORD chunkyy, UWORD scroffsx, UWORD scroffsy, UBYTE *chunkyscreen, UBYTE *bitmap) {
register UWORD _chunkyx __asm("d0") = chunkyx;
register UWORD _chunkyy __asm("d1") = chunkyy;
register UWORD _scroffsx __asm("d2") = scroffsx;
register UWORD _scroffsy __asm("d3") = scroffsy;
register UBYTE *_chunkyscreen __asm("a0") = chunkyscreen;
register UBYTE *_bitmap __asm("a1") = bitmap;
__asm volatile ( "jsr _c2p1x1_8_c5_bm" : : "r" (_chunkyx), "r" (_chunkyy), "r" (_scroffsx), "r" (_scroffsy), "r" (_chunkyscreen), "r" (_bitmap) : "d4", "d5", "d6", "d7", "a2", "a3", "a4", "cc", "memory");
}
 
And for SAS/C it looks like you need to do this kind of thing:
 
Code:
void __asm c2p1x1_cpu3blit1_queue_init (
register __d0 UWORD chunkyx, // width
register __d1 UWORD chunkyy, // height
register __d3 UWORD scroffsy, // y offset
register __d5 ULONG bplsize, // modulo to next plane
register __d6 ULONG signals1,
register __d7 ULONG signals3,
register __a2 struct Task *thistask,
register __a3 struct Task *othertask,
register __a4 UBYTE *chipbuff);
 
How about VBCC?

Last edited by NovaCoder; 20 May 2011 at 01:40.
NovaCoder is offline  
Old 20 May 2011, 01:54   #2
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
Check the manual.

http://sun.hasenbraten.de/vbcc/docs/vbcc_3.html

"3.5.2 Register Parameters"
Kalms is offline  
Old 20 May 2011, 03:04   #3
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,406
Oh, good old RTFM

So basically:

Code:
void c2p1x1_8_c5_bm(__reg("d0") int chunkyx, __reg("a2") Task *thistask);
Looks neat enough, thanks Kalms
NovaCoder is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling CLib37 with VBCC 0.9 tnt23 Coders. General 2 29 July 2013 10:28
Linking to assembler objects using C++ gcc (StormV4) NovaCoder Coders. General 6 09 December 2009 19:35
VBCC 0.8j for Windows hitchhikr Coders. General 11 09 October 2008 00:58
Kickstart 1.3 and GCC or VBCC? cdoty Coders. General 1 23 April 2005 06:10
Assembler: Linking binaries with blink redblade Coders. General 0 29 March 2005 11:02

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:52.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06242 seconds with 13 queries