delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/09/02:04:44

From: lonniem AT cs DOT utexas DOT edu (Lonnie McCullough)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: [Q] Inline Assembly
Date: Wed, 09 Jul 1997 00:42:44 GMT
Message-ID: <33c2ddb6.1352813@news.nol.net>
References: <867681946 DOT 970324 AT red DOT parallax DOT co DOT uk>
NNTP-Posting-Host: ip38-19.nol.net
Lines: 33
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>void vgaBlitBuffer(BYTE *buffer)
>{
>   int
>      selector = _dos_ds;
>      
>   /* Synchronise with vertical retrace to avoid flicker */
>   while ((inportb(IST1_ADDR) & 0x08) == 0); /* Wait for vertical retrace */
>   while ((inportb(IST1_ADDR) & 0x08) == 8); /* Wait for end of retrace */
>
>#if 0
>   /* Blit the double buffer */
>   movedata(_my_ds(), (int) buffer, _dos_ds, 0xA0000, 320 * 200);
>#else
>   asm("movw %%ax, %%es\n\t"
>       "movl $0xA0000, %%edi\n\t"
>       "movl $16000, %%ecx\n\t"
>       "cld\n\t"
>       "rep\n\t"
>       "movsl\n\t"
>       : /* no output registers */
>       : "a" (selector), "S" (buffer)
>       : "%eax", "%esi", "%edi", "%ecx");
>#endif
I don't think you have to put percent signs in front of your clobbered
registers.  When I do inline stuff I never have to.  Not sure if this
will have any effect but maybe gcc ignores percented register's
thinking they will be processed by gas?  I don't know.  Worth a try
maybe.



Lonnie McCullough
lonniem AT cs DOT utexas DOT edu

- Raw text -


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