[MPlayer-dev-eng] OT: loader/stubs.s:EH_prolog convertion to C

Mark Zealey mark at zealos.org
Wed Oct 23 20:48:20 CEST 2002


> i've converted it into C using gcc __asm__, but I got some questions:
> 
> original function:
> EH_prolog:
> 	pushl $0xff
> 	pushl %eax
> 	pushl %fs:0
> 	movl %esp, %fs:0
> 	movl 12(%esp), %eax
> 	movl %ebp, 12(%esp)
> 	leal 12(%esp), %ebp
> 	pushl %eax
> 	ret

This function is very magical by the looks of things - it doesn't return to
caller, it jumps to some place else that it figured out and passes various args
to that place. This plain CANNOT be done in C. Why do you want to do it? if it
is to get rid of the file, just put the whole thing into at asm() block and
leave it alone :) (Your version will cause stack corruption too if we ever go
back up the stack as gcc has pushed some garbage onto there)

-- 

Mark Zealey (aka JALH on irc.oftc.net: #zealos and many more)
mark at zealos.org; mark at itsolve.co.uk

UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a17! C++++>$ P++++>+++++$ L+++>+++++$
!E---? W+++>$ !w--- r++ !t---?@ !X---?  !R- !tv b+ G+++ e>+++++ !h++* r!-- y--



More information about the MPlayer-dev-eng mailing list