Message-ID: <01BDE216.FEF3F280@mmolekwa.rrs.co.za> From: Mthimkhulu Molekwa To: "'Djgpp List'" Subject: FW: Inline ASM Date: Thu, 17 Sep 1998 08:41:40 +-200 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Precedence: bulk ---------- From: Endlisnis[SMTP:s257m AT unb DOT ca] Sent: Wednesday, September 16, 1998 03:18 To: djgpp AT delorie DOT com Subject: Re: Inline ASM Thomas Luzat wrote: > Hi there! > > I just wanted to start programming in C/C++ and downloaded DJGPP for > this purpose. Everything is working fine, but I haven't figured out how > to use inline assembler. That's what I wanted to convert from Turbo > Pascal to DJGPP: > > asm > mov ax,0003h; > int 10h; > end; > > I need just one sample to start. I can't figure out how to do it from > the docs (maybe you can point me to the right one?) >asm("movw 0x0003, %%ax;" > "int $0x10;" > : : "%eax"); > Correct me if I'm wrong. Should the above code be: asm("movw $0x0003, %%ax\n\t" "int $0x10\n\t" : : "%eax"); ===> replaced "0x0003" by "$0x0003" and ";" by "\n\t" MK ======================================================== Mthimkhulu Molekwa Reutech Systems - Stellenbosch Tel: +27 21 880 1150 Fax: +27 21 880 1153 Cell: +27 83 454 1230