A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / combine asm-one and gcc or something other c++ compiler.

 

Author Message
Peabrain
Member
#1 - Posted: 15 Feb 2012 08:23
Reply Quote
hello,

is it possible to code functions in assemlber and link them to gcc or other c++ compiler?
i don't want to use the gcc inline assembler.
i need a little bit startup help to code on amiga.
the c2p routines are all in assembler and i want to use them.
but how?

best regards,
Peabrain
jamie2010
Member
#2 - Posted: 15 Feb 2012 14:56
Reply Quote
Hey Peabrain,

You can use external assembler file with gcc. You need to use extension .S for all your assembler file and to do some minor change as some directive are different with gcc. If you want i can send you some example, just gime your email.

Jamie
Peabrain
Member
#3 - Posted: 16 Feb 2012 10:20
Reply Quote
thank you :)

but i don't want to public my email address :D
perhaps you can give me a link or something? :)
jamie2010
Member
#4 - Posted: 16 Feb 2012 15:10
Reply Quote
fmacre(...)gmail.com
Raylight
Member
#5 - Posted: 6 Apr 2012 15:12
Reply Quote
this gcc setup gets me thinking... :) On a similar topic, would that be a possible route to get c++ into the mix in an crossdev environment?

Having started with vbcc, I feel a strong urge to be able to use c++ for some things (e.g. were c++ will easier to structure/maintain/grow - editors, tools etc..), while still keeping the higher-level parts "cross-platorm". Any ideas?
jamie2010
Member
#6 - Posted: 6 Apr 2012 15:39
Reply Quote
I explored lot of solutions before choosing Gcc, i use c++ every day at work so for me it was not an option to code in c++. With Gcc you have 3 choice:

1) Use make file
2) Use amidevcpp (If you want a quick start)
3) Use Gcc in Visual Studio(need more time but it's really comfortable)

One negative point it's for debugging, personally i debug on the pc side as the code is running on pc too.
Raylight
Member
#7 - Posted: 6 Apr 2012 16:56
Reply Quote
Oh thanks! :-) I've been using VS for ages, although I'm considering using something else for this to get the environment more portable. Anyway, it sounds like I could make Gcc + vbcc (c + asm) agree with each other then? With "some" effort, that is. :-D

..and wrap it up with some IDE with custom build steps, makefiles.. to end up with MyUberWorkspace filled with interesting projects that produces object files, executables and whatnot - both Amiga and pc stuff..

So you use Gcc all the way then? For some reason I trust vbcc more when it comes to producing any code that would potentially end up in an Amiga demo. :-) So Gcc/c++ for tools, as abstraction etc. is my line of thought.

PS. For all this to work though, I first have to overcome that nagging feeling of not wanting to put c-code in a demo in the first place! ;)
jamie2010
Member
#8 - Posted: 6 Apr 2012 17:28
Reply Quote
Yep i confirm you can use asm file(it's what i use) or inline asm(the syntax is really weird) and c++. You can call asm function from c++ files and you can share some variables between c++ and asm.

If i have one advice to give you, it's to test really often on the real computer, for our last production we coded and designed the demo on pc and we had a giant screen resolution. At my big surprise the porting on amiga was fast and the code was not so slow, i converted lot of files in asm, practically all routines that are called every frame are in pure assembler. Our major mistake was the artistic part, don't forget amiga resolution is low and you need to adjust your textures and sprites for this resolution.

If you don't want to spend lot of time with gcc and project creation just go with amidevcpp, it's an Cross Platform development for windows and it's really solid!!!
Raylight
Member
#9 - Posted: 6 Apr 2012 21:32
Reply Quote
Thanks for the advice, and yeah, that's really something to be aware of, amiga resolution isn't exactly like one remembered it hehe!

Well, I need to use the real thing a lot anyway to be able to design around actual dma constraints, still, I'm considering writing a display class for pc that would simulate amiga modes and "filter" appropriately. Might be a good solution for prototyping on the pc. :)

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0