08 March 2016, 19:24 | #1 |
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 |
08 March 2016, 19:38 | #2 |
Amigan
Join Date: Feb 2012
Location: London
Posts: 1,317
|
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(); } However, all Amiga C compilers support passing via registers (syntax is different for each compiler). |
08 March 2016, 20:15 | #3 |
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 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tool to convert asm to gnu asm (gas) | Asman | Coders. Asm / Hardware | 13 | 30 December 2020 11:57 |
Weid colours for some icons or when holding an icon selected | tygre | support.Other | 7 | 05 September 2015 20:39 |
Profiling WinUAE with Visual Studio 2013 | mark_k | support.WinUAE | 3 | 14 January 2014 20:26 |
Is anyone else holding onto their A500 until it increases in value a lot? | paul2010 | Retrogaming General Discussion | 24 | 25 July 2011 22:54 |
PAL & NTSC Via Holding Down Mouse Buttons | crazyegg | support.Hardware | 12 | 13 April 2010 21:58 |
|
|