Intel Assembler on OSX?
Intel Assembler on OSX?
- Subject: Intel Assembler on OSX?
- From: Uli Kusterer <email@hidden>
- Date: Fri, 3 Nov 2006 21:19:20 +0100
Hi folks,
I'm trying to learn Intel assembler for OS X, and since I couldn't
find any Mac tutorials and the calling conventions appear rather
different, I've tried learning by dissecting code generated using gcc
-S simle_c_program.c ... I mostly understand the output, but I'd be
very grateful if one of you could help me by explaining why the
marked spots below move the stack pointer by that much?
.text
.globl _addNumbers
_addNumbers:
pushl ëp
movl %esp, ëp
subl $8, %esp ### HERE
movl 12(ëp), êx
addl 8(ëp), êx
leave
ret
.globl _main
_main:
pushl ëp
movl %esp, ëp
subl $40, %esp ### HERE
movl $7, 4(%esp)
movl $5, (%esp)
call _addNumbers
movl êx, -12(ëp)
movl -12(ëp), êx
leave
ret
.subsections_via_symbols
I would have expected that to be maybe 8 bytes for the parameters,
and since the stack according to all docs I could find is 4-byte
aligned, that would be 8. Instead it's 40. Does anyone know a bare-
bones-beginner tutorial that is written in a way that I can actually
follow along on my Intel Mac? I know 68000 assembler, but Intel
assembler is completely new territory for me.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden