SDL + assembler

Hello!

I wonder if any of you ever used SDL with either pure assembler, or inline
assembler in gcc? I would love to dig deep in some sourcecode.

I’m running SDL 1.2.5 on win32 with MinGW at the moment…

/Matheus

Hello!

I wonder if any of you ever used SDL with either pure assembler, or inline
assembler in gcc? I would love to dig deep in some sourcecode.
Well, I actually did, but not much though :slight_smile:

Using SDL from assembler does not differ much from using other C libraries
from assembler. Don’t really know about the inline Assembler, but when using
a standalone assembler you can’t use the SDL header(s) so you have to extract
the information you need yourself (like #define’d constants).

I’ll attached a small example, that actually does not much. It sets a
video-mode, then waits until the user presses a key and exits afterwards.
The comments are in german but it may be useful anyway.

I think you’ll lose all of the platform-independence, because AFAIK at least
windows uses a different (function) calling convention (Pascal???). But I
don’t really know, since I program on Linux.

I’m running SDL 1.2.5 on win32 with MinGW at the moment…

I think on Windows you have to push the function arguments left to right
instead right to left and the called funtion itself handles the stack, but
I’m no expert on that.>

/Matheus


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


crusade / binarybrains <@crusade_binarybrains>
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl_asm.tar.gz
Type: application/x-tgz
Size: 2975 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030403/f4d408c7/attachment.bin