Sdl with assembler

hi, currently i’m tryin to get sdl working with assembler, my problem is how
to define the main function (int main (int, char**); in c), because i’m
quite new to assembler. i’m using the macro assembler(MASM). thanks for help.–
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte l?cheln! Fotogalerie online mit GMX ohne eigene Homepage!

Assembler…that seems kinda silly unless you are writing to one specific
processor Like a PIC mirco or something.

Other than that there is little advantage of usgin asm over C w/ an optimzed
compiler.

The very idea of SDL is to be cross platform, which is the anti-thesis of ASM

…but if you really want to…then dump MASM (but not really), and use inline
assembly in your C code, that would probably be the best way to combine the
two.
Or you can make your assembly module into a libaray and then write your C
routine w/ SDL and link to your ASM built library.

most modern compilers support inline assembly now.
but I really haven’t a clue as to what M$ products do these days as I left in
the days win95 and haven’t looked back since (but I did like MASM)On Sunday 13 April 2003 8:48 am, se_police at gmx.de wrote:

hi, currently i’m tryin to get sdl working with assembler, my problem is
how to define the main function (int main (int, char**); in c), because i’m
quite new to assembler. i’m using the macro assembler(MASM). thanks for
help.


"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety. "
–Benjamin Franklin

…but if you really want to…then dump MASM (but not really), and use
inline
assembly in your C code, that would probably be the best way to combine the
two.
Or you can make your assembly module into a libaray and then write your C
routine w/ SDL and link to your ASM built library.

hi, currently i’m tryin to get sdl working with assembler, my problem is
how to define the main function (int main (int, char**); in c), because i’m
quite new to assembler. i’m using the macro assembler(MASM). thanks for
help.

Hello!

You’re not alone… I would also be very interested in source code and code
examples doing exactly this. (This = Using SDL both from a “pure” assembler
and from inline asm in gcc for example.) Anyone?

Of course I know assembler and machine code is, kind of, against the
multiplatform philosophy of SDL, but it is totally in line with my own
use-the-tools-you-know-for-whatever-you-want philosophy. :slight_smile:

Later…

/M Andr?n>On Sunday 13 April 2003 8:48 am, se_police at gmx.de wrote:

LITTLE COMPUTER PEOPLE 2003 - http://www.lcp.c64.org

What about fun?On Sun, Apr 13, 2003 at 09:07:43AM -0700, Samuel wrote:

Assembler…that seems kinda silly unless you are writing to one specific
processor Like a PIC mirco or something.


Free Software - find interesting programs and change them
NetHack - meet interesting creatures, kill them and eat their bodies
Usenet - meet interesting people from all over the world and flame them
Decopter - unrealistic helicopter simulator, get it from http://decopter.sf.net

What about fun?
that’s the spirit

Assembler…that seems kinda silly unless you are writing to one specific
processor Like a PIC mirco or something.
i want to teach my self x86 assembly and currently i try to write a 2d tile
engine based on opengl and sdl, and i think using sdl only because it’s
platform independet is as sylly as using assembler, beacause sdl offer a much more
clean way to write mulitmedia application by handling the whole windwo
manager overhead, so the my whole init routine in c is just about 20 lines.
currently i use this part of code to declare my function, if my
understanding of c isn’t completly wrong, it should be right

_SDL_main PROC PUBLIC argc :DWORD, argv :DWORD
xor eax, eax
ret
_SDL_main ENDP

but it says at link time: unresolved external symbol _SDL_main–
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Bitte l?cheln! Fotogalerie online mit GMX ohne eigene Homepage!

_SDL_main PROC PUBLIC argc :DWORD, argv :DWORD
xor eax, eax
ret
_SDL_main ENDP

but it says at link time: unresolved external symbol _SDL_main

The assembler may be changing the leading underscores. Did you
try just SDL_main and __SDL_main?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment