delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/19/11:46:47

From: Matthew Mastracci <mmastrac AT acs DOT ucalgary DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: NASM + DJGPP newbie problem
Date: Fri, 19 Sep 1997 08:13:24 -0600
Organization: The University of Calgary
Lines: 36
Message-ID: <5vu1ck$um2@ds2.acs.ucalgary.ca>
References: <341FD2A0 DOT 54CC1C76 AT mwci DOT net>
NNTP-Posting-Host: mmastrac AT acs2 DOT acs DOT ucalgary DOT ca
Mime-Version: 1.0
In-Reply-To: <341FD2A0.54CC1C76@mwci.net>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Wed, 17 Sep 1997, Larry Swanson wrote:

> I recently decided to learn how to program in assembly using NASM and
> DJGPP.  I'm having a problem trying to get the following code to work.
> (I usually get a message like 'access denied') that appears to be when I
> push something on the stack.

> _AddFour:
>          push  ebp;
>          mov ebp , esp;
[cut]
>          mov ebp,esp
>          pop ebp
>          ret
> ;End of

You mixed up:

mov ebp, esp
pop ebp
ret

should read:

mov esp, ebp
pop ebp
ret

Also in the other two procedures.  That should fix your problems...

/\/\att /\/\astracci                  mmastrac AT acs DOT ucalgary DOT ca

GCS/GE    d- s+:+ a--- C++++ UA P+ L E-- W+ N++ o K+ w+ O M- V 
          PS++ PE++ Y+ PGP t+++ 5+++ X++ R++ tv+ b+++ DI++++ I 
          G++ e h r* z?

- Raw text -


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