🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.games.starcraft
Article #290122

Re: OK you code gurus...

#290122
From: Marshlion
Date: Tue, 21 Mar 2006 22:58
45 lines
2989 bytes
Zealot The Crazy Lui wrote:
> On Tue, 21 Mar 2006 08:28:02 -0800, Zealot The Crazy Lui
> <ktwils...@NOSPAM.comcast.net> wrote:
> 
> 
>>why doesn't this work?
>>(C Lang)
>>void getData( int* n, int* r )
>>{   
>>	char scanString[] = "%d %d";
>>	_asm
>>	{
>>		push r;
>>		push n;
>>		lea ebx, scanString;
>>		push ebx;
>>		call scanf;
>>HERE>		add esp,12;
>>	}
>>}
>>
>>where it's marked "HERE>" I get some error (Unhandled exception at
>>0x004182c0 in Combinations and Permutations.exe: 0xC0000005: Access
>>violation writing location 0xe7430e45.) and it gets stuck at that
>>point. This is exactly how it should be according to my prof, and a
>>one other guide I found. Why the hell doesn't it work?
> 
> 
> Also nice to note...
> whenever I try to use the prof's exact example, I get this:
> Unhandled exception at 0x004182bc in test.exe: 0xC000001E:  An attempt
> was made to execute an invalid lock sequence.
> 
> the first time it tries to add to esp. I'm assuming that if my prof
> says we are suppoed to be able to add to esp, we are probably supposed
> to be able to add to esp, so why won't it let me??

I'm inclined to thign that either you can't add a static number or your 
machine is different in that your add command - I've had the later 
before. I would first try changing "add esp, 12;" to "add 12, esp;" (you 
might want to check the line "lea ebx, scanString;" as well).

--
Marsh Lion
my asm is a little rusty
Technical Details
Message-ID: <442084db$1@clear.net.nz>
Path: mbox-mo1.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.clear.net.nz!news.clear.net.nz.POSTED!not-for-mail
References: <34a022ta3sjetnjnkvluulh8sajiq1t5ih@4ax.com> <9fb022917l7so6ahphku2fin844c138r0s@4ax.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.clear.net.nz!news.clear.net.nz.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 21 Mar 2006 16:57:34 -0600
Date: Wed, 22 Mar 2006 10:58:47 +1200
From: Marsh_lion <marsh...@SPAMparadise.net.nz>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: alt.games.starcraft
Subject: Re: OK you code gurus...
References: <34a022ta3sjetnjnkvluulh8sajiq1t5ih@4ax.com> <9fb022917l7so6ahphku2fin844c138r0s@4ax.com>
In-Reply-To: <9fb022917l7so6ahphku2fin844c138r0s@4ax.com>
X-Original-NNTP-Posting-Host: 203-97-163-23.cable.paradise.net.nz
Message-ID: <442084db$1@clear.net.nz>
X-Original-Trace: 22 Mar 2006 10:57:31 +1200, 203-97-163-23.cable.paradise.net.nz
Organization: CLEAR Net New Zealand http://www.clear.net.nz - Complaints ab...@clear.net.nz
Lines: 45
NNTP-Posting-Host: 203.97.37.6
X-Trace: sv3-xSSQbypYT8b4y1Joer/gk0n/Aofj1Vp7wfoZjaLfiyKoB3rru7OM5oks13kwkuFlYjNGX/Jrj50+5j5!VtsrSQWf6ohsWxh9zw8df3YdF6siUcCrl9lFNwiWxam2H9IRtzgle0aU2w==
X-Complaints-To: Complaints to ab...@clear.net.nz
X-DMCA-Complaints-To: Complaints to ab...@clear.net.nz
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit