www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/16/14:51:17

From: "John Fremlin" <fremlin AT oncology DOT wisc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: new asm question...
Date: Tue, 15 Apr 97 17:56:21 CST
Organization: University of Wisconsin, Madison
Lines: 61
Message-ID: <75464.fremlin@oncology.wisc.edu>
NNTP-Posting-Host: f209-034.net.wisc.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On 15 Apr 1997 01:08:25 GMT, 
Jeff Weeks  <pweeks AT execulink DOT com> wrote:

>I've been tring to make a simple inline asm block to copy my virtual
>screen (virt[64000]) to 0xa000 (using near pointers... I've called
                         ^^^^^^
In DJGPP video memory is stored at 0xA0000.

>__djgpp_nearptr_enable()).  So I looked up movsl and tried a little
 ^^^^^^^^^^^^^^^^^^^^^^^^^
If you're using asm then a simpler way to do this is to put the
value returned from _go32_conventional_mem_selector() into es
(see code snippet).

>block but I can'tt get it to work.

It would have been more helpful if you'd posted source code.

>
>Could someone please send a little code snippet to do this.

--
   asm( "
        pushw %es
        pushl %esi
        pushl %edi
        pushl %ecx

        movw  _dos_selector, %es
        movl  $0xA0000, %edi

        movl  _virtscreen, %esi

        movl  $16000, %ecx

        cld
        rep   ; movsl

        popl  %ecx
        popl  %edi
        popl  %esi
        popw  %es
        ");
--

'virtscreen' must be a global variable.
'dos_selector' must be a global short int containing the value returned
from _go32_conventional_mem_selector(), e.g.:
static const short unsigned dos_selector = _go32_conventional_mem_selector();

>
>Sorry, I'm pressed for time, gotta go,
>Jeff Weeks
>
>  email: mailto:pweeks AT execulink DOT com
>


(fremlin AT oncology DOT wisc DOT edu or fremdh AT essex DOT ac DOT uk)

Punching people doesn't win arguments, it just shuts them up.

- Raw text -


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