www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/08/20:31:45

From: "Hugo Jose Ferreira" <hugojf AT mail DOT telepac DOT pt>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: PLEASE HELP with ExtAsm
Date: Mon, 8 Dec 1997 23:27:19 -0500
Lines: 44
Message-ID: <66hvi6$kef$1@duke.telepac.pt>
References: <66e3ui$9jd$1 AT duke DOT telepac DOT pt> <348B9A4A DOT 58FE AT mailexcite DOT com>
NNTP-Posting-Host: 194.65.176.162
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>> Hi !
>> Can someone, please, help me with this Assembly Routine...
>> I'm new to the Extended ASM of DJGPP.. I used to program with RealMode,
TASM
>> Systax,
>> but, all this AT&T syntax confuse me ! Please, Correct this function:

>> void setdaccolor(byte color, byte red, byte green, byte blue) {
   ...

>>   : "%eax", "%edx" );
>> }

>Hmmm. I'm not going to test this, but it should be close if there is a
>bug :)

>void setdaccolor(byte color, byte red, byte green, byte blue) {
> __asm__ __volatile__ (
>   "movl  $0x3C8, %%edx \n\t"

    ...

>   "outb  %%al, %%dx"
>   : : "a" (color), "rm" (red), "rm" (green), "rm" (blue)
>   : "%eax", "%edx" );
>}

>I also changed your 16-bit move to 32-bit because they are
>faster&better. Also, instead of using %1, I used %b1 to specify byte
>type.

Well, I found that, at least, in my computer, It would only compile if you
switch all the "rm" to "g" in this way:

   : : "a" (color), "g" (red), "g" (green), "g" (blue)

Other thing, do you know how can I configure RHIDE to automatically make GGC
produce a .s file ?!?! When I add -S to the compile parameters, it will not
link...

Anyway, Thanks a Lot..



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019