Jump to content
  • Advertisement

Archived

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

Ikuyubon

ASM/DJGPP

This topic is 6689 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

Advertisement
Accessing the inline assembler in DJGPP is a real pain (for me, since I''m more used to the Intel syntax).

Anyway if you want documentation on how to use the inline assembler in DJGPP, here''s the link to DJGPP''s Doc page. It assumes you know Intel assembly first



========================================================
If something sounds stupid but works, it's not stupid

Share this post


Link to post
Share on other sites
if I remember right.... you can do inline assembly like this
__asm xor ax,ax
or
__asm{
xor ax,ax
mov ah,4
}

its AT&T style assembly so read up.... I don''t know much about at&t format....
or you can create assembly file.... I think it needs an .S extenchion....
or there is a third option.... use any assembler that can creates COFF object... I know Nasm can and I think MASM and TASM....

Great Milenko

Words Of Wisdom:
"Never Stick A Pretzel In Your Butt It Might Break Off In There."


http://www.crosswinds.net/~milenko
http://www.crosswinds.net/~pirotech

Share this post


Link to post
Share on other sites
erm, Milenko, that''s Intel syntax

in Intel syntax you''d go

__asm{
mov ax, bx //this places bx in ax
}

but in AT&T (at least, under DJGPP) you do this

_asm (
" movw %bx, %ax" //this places bx in ax
);

Pretty funky, eh

========================================================
If something sounds stupid but works, it's not stupid

Share this post


Link to post
Share on other sites
You forgot to Push
And don''t forget to Pop

I learn the hard way back in the good ole'' dos days - ran a bit of C with some inline asm, didn''t work quite right, saved the file I was working on, crashed, hum.... reboot, "Insert DOS disk in drive A:" awww f@#$!.... it was bad - anyway windows will protect you now-a-days, but don''t forget to push & pop any reg''s that''ll you''ll be using

Share this post


Link to post
Share on other sites
Thanx guys
So DJGPP uses AT&T ASM...
aren''t there any solution to use INTEL ASM with DJGPP?
because it really makes me sick

Share this post


Link to post
Share on other sites
Well, Ikuyubon (does that mean anything ? just curious )
You could try using NASM. It supports something like the Intel syntax and it is supported by DJGPP.

Magmai :-
So sue me I haven''t been coding assembly in a while. Guess I''m getting rusty.

========================================================
If something sounds stupid but works, it's not stupid

Share this post


Link to post
Share on other sites
I suggest you just go on and use the AT&T syntax. It is alot more logical than the Intel syntax, and easier to use in DJGPP than NASM is. You could also create .S or .s files (it REALLY matters if the s is lovercase or uppercase), witch is pure assembly files. If you want me to i can send you some AT&T tutorials, but it assumes you know the Intel syntax already.



Share this post


Link to post
Share on other sites
Thanx for helping me
NuffSaid: Ikuyubon -> Nobuyuki
hehe
Zygo_#2000: Yeah please, send me some tutorials on AT&T ASM
And what''s good to use .s or .S files?
How to use them?

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!