Article View: pl.comp.lang.asm
Article #2479Re: naruszenie ochrony pamieci - dlaczego
From: yesma
Date: Sun, 12 Jun 2011 12:34
Date: Sun, 12 Jun 2011 12:34
46 lines
1633 bytes
1633 bytes
panki pisze:
[...]
> ps. moze to trywialne pytanie ale dlaczego kladzie sie ebp na stos(a
> także eax i esi, pushfd)
>
;~~~~~~~~~~~~~~~~~~~~
;te procedury odkladaja na stos
;wszystkie rejestry ktorych uzywaja wewnatrz
PROC1:
push eax
mov eax,1
call PROC2
add eax,1
;eax==2
pop eax
ret
;~~~~~~~~~~
PROC2:
push eax
mov eax,4
pop eax
ret
;~~~~~~~~~~~~~~~~~~~~
;a te procedury odkladaja na stos
;te rejestry ktore beda im potrzebne nie zmienione
;po instrukcji call
PROC1:
mov eax,1
push eax
call PROC2
pop eax
add eax,1
;eax==2
ret
;~~~~~~~~~~
PROC2:
mov eax,4
ret
;~~~~~~~~~~~~~~~~~~~~
;poczytaj "Konwencje wywołania"
--
Pozdrawiam - Grzechu
Linux x86_64
Technical Details
Message-ID:
<it2c1c$9t7$1@inews.gazeta.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mailReferences:
<9b70ec81-f1ce-4857-b679-c0d1498ae9ee@v8g2000yqb.googlegroups.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail From: yesma <yesma@false.pl> Newsgroups: pl.comp.lang.asm Subject: Re: naruszenie ochrony pamieci - dlaczego Date: Sun, 12 Jun 2011 14:34:23 +0200 Organization: "Portal Gazeta.pl -> http://www.gazeta.pl" Lines: 46 Message-ID: <it2c1c$9t7$1@inews.gazeta.pl> References: <9b70ec81-f1ce-4857-b679-c0d1498ae9ee@v8g2000yqb.googlegroups.com> Reply-To: yesma@false.pl NNTP-Posting-Host: user14-095.satfilm.net.pl Mime-Version: 1.0 X-Trace: inews.gazeta.pl 1307882348 10151 77.91.14.95 (12 Jun 2011 12:39:08 GMT) X-Complaints-To: usenet@agora.pl NNTP-Posting-Date: Sun, 12 Jun 2011 12:39:08 +0000 (UTC) X-User: yesma User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100329) In-Reply-To: <9b70ec81-f1ce-4857-b679-c0d1498ae9ee@v8g2000yqb.googlegroups.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit