www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/11/00:25:26

Message-ID: <3286D227.669C@gbrmpa.gov.au>
Date: Mon, 11 Nov 1996 15:13:46 +0800
From: Leath Muller <leathm AT gbrmpa DOT gov DOT au>
Reply-To: leathm AT gbrmpa DOT gov DOT au
Organization: Great Barrier Reef Marine Park Authority
MIME-Version: 1.0
To: "John F. Bell" <jfbell2 AT juno DOT com>
CC: djgpp AT delorie DOT com
Subject: Re: AT&T Assembly
References: <328699C5 DOT 2E68 AT juno DOT com>

> __asm__ __volatile__ ("
>   movw $16000, %%cx\n
>   cld\n
>   rep\n
>   movsl"
>   :
>   :"D" (0xA0000+__djgpp_conventional_base), "S" (double_buffer)
>   :"ax", "cx", "si", "di", "memory"
> );

Umm...looks like your mixing 32 and 16 bit operands here. Your count etc
is in 16 bit registers, and then your doing a 32 bit movs (movsl).
Shouldnt
your count then be in ecx? Your code should probably look something
like:
	asm volatile ("
		movl	$16000, %%ecx;
		cld;
		rep;
		movsl"
	etc etc
Also, to access the video memory this way, you have to make sure you
have
the nearptr flag enabled or some similar such thing. This is in the FAQ
if
you haven't done this already...

> This fills the double buffer with one color (it should anyway)
> 
> __asm__ __volatile__("
>    movb %%al, %%ah\n
>    movw %%ax, %%dx\n
>    shl  $16, %%ax\n
>    movw %%dx, %%ax\n
>    movw $16000, %%cx\n
>    rep\n
>    stosl"
>    :
>    :"a" (color), "D" (double_buffer)
>    :"ax", "cx", "dx", "di", "memory"
> );

Same with this bit of code...
 
Leathal.

- Raw text -


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