ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/09/16:47:36

Date: Sun, 10 Nov 1996 10:27:56 +0000
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: waitretrace in inline asm...am i stupid ?
To: Benjamin Zeiss <libertine AT t-online DOT de>
Cc: djgpp AT delorie DOT com
Reply-to: billc AT blackmagic DOT tait DOT co DOT nz
Message-id: <3285AE2C.3478@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <55oadv$cku AT news00 DOT btx DOT dtag DOT de>

Benjamin Zeiss wrote:
>=20
> okay fellows,
> i=B4m new to djgpp and therefore i=B4m in trouble with the inline
> assembler. i tried something like
>=20
> void retrace()
> {
>         __asm("
>                 movl $0x3da, %%edx
>                 loop:
>                 inb %%dx,%%al
>                 test %%al,$8
                       ^^^^^^^
I think this is your error (reversed args).

>                 jz loop
>         ");
> }
>=20
Also (as a recomendation) if you are going to use this in optimized
code, and extended asm (I think that might also be your problem, you'=
re
using extended asm registers in a basic asm block).

change the 'loop:' to '1:' and 'jz loop' to 'jz 1b'.
You should also place ': : :"%eax","%edx"' after the last '"'

Hope this helps
Bill
--=20
Leave others their otherness.

- Raw text -


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