Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

yottskry

Inline ASM in g++?

This topic is 6084 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, Does g++ support inline assembler in the same way as borland turbo c++ does? I can''t find any information on it on the web, though from the errors I''m getting it looks as though it does but my syntax is incorrect. Cheers, Steve --------------------- Light of my life Fire of my loins. My sin, my soul LOLITA ---------------------

Share this post


Link to post
Share on other sites
Advertisement
OK, I''ve read the tutorial and it now recognises the asm and seems to assemble ok, but now I can''t seem to get the computer into mode 13h. I''m using the code (just as a test):

void main(void){
asm(
"movl $0x0013, %eax\n\t"
"int $0x10"
);
getch();
asm(
"movl $0x0003, %eax\n\t"
"int $0x10"
);
}

Which should stick it in 13h, wait for a keypress and then return to text mode but I just get access violations. I know some people have said you can''t just access interrupts and stuff directly from win 2K but I''ve been doing inline assembly in Pascal in win2k and it works fine...

...is there something I don''t know??

Cheers,

Steve

---------------------
Light of my life
Fire of my loins.
My sin, my soul
LOLITA
---------------------

Share this post


Link to post
Share on other sites
It''s a protected-mode compiler which runs through a DPMI server. This means that you need to use a couple compiler-specific dpmi server commands to either dsisable the server before running that ASM nd then re-enabling it afterwards, or using the DPMI server to poke those values into memory for you. Many people use the latter approach; just run a search on google for ''Mode 13h DJGPP'' and I''m sure you''ll find all the information you''d need.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!