delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/23/04:20:53

Message-Id: <199912230832.KAA13697@www.Foo.COM>
From: "S. M. Halloran" <mitch AT duzen DOT com DOT tr>
Organization: User RFC 822- and 1123-compliant
To: "mus.bouayad" <mus DOT bouayad AT wanadoo DOT fr>
Date: Thu, 23 Dec 1999 10:40:19 +0200
MIME-Version: 1.0
Subject: Re: Djgpp and Nasm
CC: djgpp AT delorie DOT com
In-reply-to: <01bf4e8c$665fb700$33e58aa4@kalashnikow>
X-mailer: Pegasus Mail for Win32 (v3.12b)
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 23 Dec 99, mus.bouayad was found to have commented thusly:

> Hello,I have still problems with using nasm with DJGPP.
> Here is the code : 
> [...]
> _CLVga:       push ebp 
>               mov ebp,esp 
>                
>               push dword[VideoRAM] 
>               pop es 
>               xor di,di 
>               xor eax,eax 
>               mov cx,0x3E80
>               rep stosd 
>                
>               mov esp,ebp 
>               pop ebp 
>               ret  
> [...]
> This routine normally clear the VGA screen that was set up before.
> The program compilation is OK,but when I lunch the application,it
> crashs.Please help me.
> Thanks,
> NB:This asm file is used with C code.

Without really looking or needing to look at your code at this moment, I 
suspect your problem is the usual memory protection problem; you don't 
mention what you do to gain permission to use that memory.  The Intel 
80x86 processors allow operating systems to set up memory protection so 
that executing applications cannot just willy-nilly do whatever they want 
at any address on the machine.  These OSes, such as Windows 9x, do take 
advantage of these memory protection features for the most part.

Through DPMI, DJGPP programmers make polite requests to access and to 
control (e.g., lock) certain areas of memory first before they either read 
from or write to (or both) those areas of memory.  This interface (one of 
the few interrupts you are allowed to call) sets up descriptors properly 
for describing the terms (r/o or r/w) and boundaries (base+limit) of 
access.  You don't need to read the Intel x86 Programmer's Manual to learn 
about the details of memory protection (although it's helpful to you).  
There is a FAQ plus the DPMI specification which will help you to prepare 
your access to memory first, and then you can call your assembly routine.



Mitch Halloran
Research (Bio)chemist
Duzen Laboratories Group
Ankara       TURKEY

- Raw text -


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