Go Back   CodeCall Programming Forum > Software Development > C and C++
Register Blogs Search Today's Posts Mark Forums Read

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-30-2009, 06:46 AM
Newbie
 
Join Date: May 2009
Posts: 9
Kuto is an unknown quantity at this point
16 bit assembly with in Gcc and 16 bit compile (how to?)

I want to use inline asm with in gcc. like:
Code:
int main(){

asm(
"movb $0xe,%ah \n"
"movb $0x65,%al \n"
" int  $0x10 " );

return 0;
}
I could compile and link but didn't work.. it said "segmentation fault".
what can i do, help me plz..

Last edited by Jaan; 07-02-2009 at 10:41 AM.. Reason: Please use code tags when you are posting your codes!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-30-2009, 09:01 AM
TkTech's Avatar
Speaks fluent binary
 
Join Date: Jun 2006
Location: Canada
Age: 18
Posts: 1,528
TkTech will become famous soon enough
Send a message via MSN to TkTech
Re: 16 bit assembly with in Gcc and 16 bit compile (how to?)

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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-30-2009, 02:40 PM
Newbie
 
Join Date: May 2009
Posts: 9
Kuto is an unknown quantity at this point
Re: 16 bit assembly with in Gcc and 16 bit compile (how to?)

Thank you friend.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -5. The time now is 11:39 PM.


vBulletin v3.8.0 ©2010, Jelsoft Enterprises Ltd.


no new posts

LinkBacks Enabled by vBSEO 3.1.0