Welcome, Guest. Please login or register.

Author Topic: Storm C Asm 68k  (Read 3147 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline billyfish

  • Jr. Member
  • **
  • Join Date: Oct 2005
  • Posts: 51
    • Show all replies
Re: Storm C Asm 68k
« on: March 22, 2012, 01:34:08 PM »
Quote from: Piru;684766
StormC ditched their rather sh*tty custom compiler for V4 and switched to GNU toolchain. StormC 4 == GNU + IDE.


LOL, I feel your love of StormC 3! :-)
Version 3 of the compiler is still available in Storm. If you go to the project environment option under the settings menu, you can check which compiler you're currently using; either the gcc-based version or their custom compiler.

cheers

billy
 

Offline billyfish

  • Jr. Member
  • **
  • Join Date: Oct 2005
  • Posts: 51
    • Show all replies
Re: Storm C Asm 68k
« Reply #1 on: March 23, 2012, 03:34:30 PM »
Quote from: Byakhee;684911
Yes, I'm ussing stormc v3, the version that I have.

But I found the method to include asm.

Adding files whit .s extension, and ussing the next format you can call functions from c.

Code: [Select]

machine 68000

section function_name,code

xdef _function_name


....

code

....


to call from c you need to do the next:

Code: [Select]

void function_name(register __d0 type, register __a0 type, ....)


It worked with compiler of stormc v3.

Thanks for your help.


No worries. I would suggest that you write your code so that so that you can switch between compilers without needing to edit your source. If you have a header file that has something like:

Code: [Select]

#ifdef _DCC /* DICE */
#define REG(x) __ ## x
#define ASM
#define SAVEDS __geta4
#elif defined(__SASC) /* SAS/C */
#define REG(x) register __ ## x
#define ASM __asm
#define SAVEDS __saveds
#elif defined(__GNUC__) /* GCC */
#define REG(x) register __ ## x
#define ASM
#define SAVEDS
#elif defined(__STORM__)
#define REG(x) register __ ## x
#define ASM
#define SAVEDS __saveds
#endif


and then define your function as

Code: [Select]

SAVEDS ASM LONG DroppedFile (REG(a2) APTR object_p, REG(a1) struct AppMessage **msg_pp);


then you shouldn't need to worry about changing your compiler at any point.

cheers

billy