I want to use inline asm with in gcc. like:
I could compile and link but didn't work.. it said "segmentation fault".Code:int main(){ asm( "movb $0xe,%ah \n" "movb $0x65,%al \n" " int $0x10 " ); return 0; }
what can i do, help me plz..
Last edited by Jaan; 07-02-2009 at 07:41 AM. Reason: Please use code tags when you are posting your codes!
GCC doesn't produce 16bit code. You need to compile it as a separate object file using as and then link it to your final binary using ld with a link script.
The segmentation fault is likely because your trying to run real mode code under another OS...
Thank you friend.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks