ASM/DJGPP

Started by
7 comments, last by Ikuyubon 23 years, 9 months ago
HI I wanna know how to use ASM commands with DJGPP... please help
creativity is the key:)
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
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
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

The Great Milenko"Don't stick a pretzel up your ass, it might get stuck in there.""Computer Programming is findding the right wrench to hammer in the correct screw."
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
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
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
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
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
creativity is the key:)
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
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
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.



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?
creativity is the key:)

This topic is closed to new replies.

Advertisement