www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/03/01:14:52

Xref: news-dnh.mv.net comp.os.msdos.djgpp:3006
Newsgroups: comp.os.msdos.djgpp
Path: news-dnh.mv.net!mv!news.sprintlink.net!tank.news.pipex.net!pipex!news.mathworks.com!newsfeed.internetmci.com!in1.uu.net!psinntp!psinntp!psinntp!psinntp!netrixgw.netrix.com!news
From: ld AT jasmine DOT netrix DOT com (Long Doan)
Subject: Re: Scrolling in ASM
Lines: 33
Sender: news AT netrix DOT com
Organization: Netrix Corporation
Date: Wed, 1 Nov 1995 22:27:38 GMT
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

[The original message was about getting SegFault when copying 199
 bytes of Video Ram to another part in Video Ram.]

Since the copy operation copies 199 bytes, it's possible that the code
use some thing like:
   push eax, ecx, esi, edi, ds, and es
   movl $199, %ecx
   movl $source, %esi
   movl $dest, %edi
   movw _vid_ram_sel, %ax
   movw %ax, %ds
   movw %ax, %es
   rep
   movsb
   pop registers.

Which can cause trouble if:
1. Instead of using 199 and movsb, 199/4 and movsl is used, so the
   last byte is out of the segment.
2. %es and/or %ds is not restored, and causes crashes later on.
3. %esi and/or %edi is not restored, and causes crashes later on.

It will be more helpful if you can post the code that causes trouble.

Hope that helps,
Long.
-- 
==============================================================
Long Doan                                        ld AT netrix DOT com     
Netrix Corporation                         ldoan1 AT osf1 DOT gmu DOT edu
13595 Dulles Technology Drive                               
Herndon Va 22071
==============================================================

- Raw text -


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