English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 25 February 2009, 10:49   #1
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
Storm C V4...using inline assembler

Hi,

Does anyone know how to inline some assember into a C source file (I'm using Storm C V4)?

Last edited by NovaCoder; 25 February 2009 at 10:59.
NovaCoder is offline  
Old 25 February 2009, 11:16   #2
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
Code:
asm("mov.b X.d
mov.b d0,Y");
Compiles ok but fails to link because the symbols (X & Y) are not defined (did I mention that I don't actually know assembler).

Also I've noticed that I've only got the choice of using the GCC compiler or the Storm V3 compiler....what happened to the V4 compiler, didn't they do one?

Last edited by NovaCoder; 25 February 2009 at 11:31.
NovaCoder is offline  
Old 25 February 2009, 11:31   #3
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
Looks like they ditched their own compiler for an updated version of GCC blurb
NovaCoder is offline  
Old 25 February 2009, 11:34   #4
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by NovaCoder View Post
Code:
asm("mov.b X.d
mov.b d0,Y");
Compiles ok but fails to link because the symbols (X & Y) are not defined (did I mention that I don't actually know assembler).
If you don't know assembler, why do you need inline assembler then?

Anyway, when I needed assembler in a Storm C project I just used an external assembler (f.e. phxass), less hassle than trying to figure out how the inline assembler in StormC works.
StingRay is offline  
Old 25 February 2009, 11:55   #5
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
Quote:
Originally Posted by StingRay View Post
If you don't know assembler, why do you need inline assembler then?

Anyway, when I needed assembler in a Storm C project I just used an external assembler (f.e. phxass), less hassle than trying to figure out how the inline assembler in StormC works.
Because I'm a C/C++ coder who needs to use bits of assembler to do things
NovaCoder is offline  
Old 25 February 2009, 12:09   #6
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by NovaCoder View Post
Because I'm a C/C++ coder who needs to use bits of assembler to do things
Which doesn't really compute if you don't know assembler...
StingRay is offline  
Old 25 February 2009, 14:33   #7
hit
Registered User
 
Join Date: Jun 2008
Location: planet earth
Posts: 1,115
found a little tutorial: http://neo.dmcs.p.lodz.pl/pm/inline_asm.pdf
found it on this board: http://utilitybase.com/forum/index.p...m=3&topic=1519
hit is offline  
Old 25 February 2009, 14:39   #8
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
That however only works if he uses gcc instead of the native Storm C compiler.
StingRay is offline  
Old 25 February 2009, 16:24   #9
hit
Registered User
 
Join Date: Jun 2008
Location: planet earth
Posts: 1,115
isnt there a StormGCC included in StormC 4? well, at least something NovaCoder can play with
hit is offline  
Old 25 February 2009, 17:55   #10
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by hit View Post
isnt there a StormGCC included in StormC 4? well, at least something NovaCoder can play with
There is. I always used the native Storm Compiler though.
StingRay is offline  
Old 25 February 2009, 23:41   #11
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
Quote:
Originally Posted by hit View Post
isnt there a StormGCC included in StormC 4? well, at least something NovaCoder can play with
Yep cheers Hit, V4 offers you the choice of either Storm C V3 or StormGCC and it looks like StormGCC is the newer one (ie it's the
preferred choice).

I believe the best way to code on the Miggy is using C++ with assembler where it's needed for performance tweaks. If I need a particular algorithm optimised I can probably get someone else to do it for me and then replace it's C counterpart.
NovaCoder is offline  
Old 26 February 2009, 12:10   #12
hit
Registered User
 
Join Date: Jun 2008
Location: planet earth
Posts: 1,115
ok, so the little tutorial will help, it seems
hit 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
Storm C Compiler 4 XDelusion request.Apps 3 04 August 2012 05:03
Storm C 4 vulture request.Apps 4 26 November 2009 15:52
Storm C V4 NovaCoder Coders. General 5 28 October 2008 10:24
Photon Storm Marlon request.Old Rare Games 11 07 September 2007 19:34
L.E.D Storm + customplay... Grimbog support.Other 4 07 January 2007 01:48

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 17:33.

Top

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