English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 08 March 2016, 20:24   #1
Sephnroth
Registered User

 
Join Date: Oct 2014
Location: England
Posts: 77
very basic C/ASM/Visual Studio hand holding

Hi guys. Had a really rough day today and some bad news. I wanted to distract myself for a while so I decided i'd step towards a life goal and try and write some code for classic amiga.

I have a strong coding background with c/c++/c# and some asm background (arm9 - but many many years ago). I wanted to write my main code in C and then inline some ASM where the speed is critical (such as blitting etc).

I found a pre-configured tool chain (http://www.pouet.net/prod.php?which=65625) which is exactly what i wanted - visual studio support, builds and runs from ide, launches in winuae - perfect. I found what looks like a really neat set of videos on youtube teaching amiga asm too ( [ Show youtube player ] ) which will be just the job.

BUT the videos assume im doing pure asm and working in same IDE as he is and the toolchain assumes I already know what im doing - there is no explination on how to setup my own new project for amiga in visual studio, where the entry point in the program is or how to begin with even a simple hello world. Looking at the demos it APPEARS that ASM is the starting point and the C functions are inline and called from the asm which is the opposite of what i was intending

Are there any tutorials anywhere of how to begin a C program, inline the asm and just do basic step by step things starting with a hello world and working up to loading and blitting a graphic? Because that would be awesome.

Thanks x
Sephnroth is offline  
Old 08 March 2016, 20:38   #2
nogginthenog
Amigan

 
Join Date: Feb 2012
Location: London
Posts: 886
I don't recommend inlining as it will get messy fast. Create separate .c & .s files and link them together.
It's easy to call assembler from c.

Code:
        XDEF    _myfunc
_myfunc:
        ; do stuff
        RTS
Code:
extern void myfunc();
int main()
{
   myfunc();
}
C normally passes parameters on the stack which is not optimal.
However, all Amiga C compilers support passing via registers (syntax is different for each compiler).
nogginthenog is offline  
Old 08 March 2016, 21:15   #3
Sephnroth
Registered User

 
Join Date: Oct 2014
Location: England
Posts: 77
hey, thanks for taking the time to reply

Okay that seems simple enough and very sensible. The compiler this toolchain is using is GCC ftr
Sephnroth 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
Weid colours for some icons or when holding an icon selected tygre support.Other 7 05 September 2015 21:39
Profiling WinUAE with Visual Studio 2013 mark_k support.WinUAE 3 14 January 2014 21:26
Tool to convert asm to gnu asm (gas) Asman Coders. Asm / Hardware 6 12 October 2013 13:45
Is anyone else holding onto their A500 until it increases in value a lot? paul2010 Retrogaming General Discussion 24 25 July 2011 23:54
PAL & NTSC Via Holding Down Mouse Buttons crazyegg support.Hardware 12 13 April 2010 22:58

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 11:56.


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