delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/18/20:30:21

From: "elizabeth anne dominy" <msunguli AT global DOT co DOT za>
Newsgroups: comp.os.msdos.djgpp
Subject: Strange errors after calling an ASM routine
Date: 18 Jan 1998 18:37:47 GMT
Organization: Msunguli Consaltants
Lines: 27
Message-ID: <01bd242e$afe41d60$84a903c4@msunguli.global.co.za>
NNTP-Posting-Host: asy04.anx1.nlsa.gia.net.za
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,

I have a routine that loads data from disk into an array of chars (variable
size) that works properly as far as I can tell. The thing is I have another
routine that clears the graphics screen, and uses the following ASM code
(looped if I have to clear more than one bank, depending on screen mode, NB
not working with VBE2.0+) --

__asm__ __volatile__ ("
 movw	%0,%%es
 movl	$0,%%edi
 movw	$65535, %%cx
 movb	$0,%%al
 rep
 stosb
" : : "g" (graphics_selector) : "memory");

After calling this routine, or in fact any ASM routine, simple assignment
such as 

 f1 = f2; //both are structs of the same type

cause Segmentation Violation Exceptions! Any ideas why?

Any help appreciated!

Thanx!

- Raw text -


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