www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/05/10:34:35

Message-Id: <199603051518.KAA15240@delorie.com>
Date: Tue, 05 Mar 96 15:01:10 LIT
From: Martynas Kunigelis <martynas DOT kunigelis AT VM DOT KTU DOT LT>
Subject: Re: WHY DOESN'T IT WORK!?
To: Chris Dial <cdial AT jeffnet DOT org>, DJGPP mailing list <djgpp AT delorie DOT com>
In-Reply-To: Your message of Sat, 02 Mar 1996 19:53:42 -0800

On Sat, 02 Mar 1996 19:53:42 -0800 Chris Dial wrote:
>
> /*     So how come this does not send one byte to 'screen2'? */
> asm ("
>  pushw %es  <---- skip!
>  movw _our_global_selector,%es  <--- skip!
        why on earth use _dos_ds to access *program's* data? We have our
        good old DS for that!

>  movl _screen2,%edi

   ^^^^ here's another bug. Use `leal _screen2,%edi' or `movl $_screen2,%edi'

>  movb $255,%es:(%edi)
             ^^^ - skip that stuff.

>  popw %es <--- skip!
> ");
>

  And don't forget to restore *all* registers you clobber in your inline
  asm unless you specify them in "clobberred registers" field after the
  third colon (see info on inline asm syntax).

> return 0;

>};
>
>
>-Chris Dial

Martynas Kunigelis

- Raw text -


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