Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi N - Z > Sicurezza > stack pointer
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
ste182
.arcimaestro.

User info:
Registered: Oct 2004
Posts: 258 (0.04 al dì)
Location:
Corso: informatica
Anno:
Time Online: 2 Days, 5:06:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
stack pointer

ragazzi non capisco una cosa:
in x86 assembler le istruzioni sono del tipo: destinazione, sorgente.
quindi se faccio: mov eax,10 metto il valore 10 in eax.

il problema è:

code:
unsigned long sp(void) { __asm__("movl %esp, %eax"); } void main(void) { printf("0x%x\n", sp()); }


questo serve per ottenere lo stack pointer(ESP), ma come mai l'istruzione è "movl %esp, %eax" ??? se la sintassi è destinazione, sorgente non dovrebbe essere "movl %eax, %esp" così da mettere il valore di esp in eax??(eax non è mica il registro dove vengono depositati anche i valori da ritornare??)

__________________
Live Fast, Die Fun

07-06-2013 10:22
Click Here to See the Profile for ste182 Click here to Send ste182 a Private Message Find more posts by ste182 Add ste182 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ste182
.arcimaestro.

User info:
Registered: Oct 2004
Posts: 258 (0.04 al dì)
Location:
Corso: informatica
Anno:
Time Online: 2 Days, 5:06:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ok ho trovato la risposta: il compilatore gcc usa la sintassi AT&T, quindi sorgente, destinazione... risolto

__________________
Live Fast, Die Fun

07-06-2013 10:29
Click Here to See the Profile for ste182 Click here to Send ste182 a Private Message Find more posts by ste182 Add ste182 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Fego
.fedelissimo.

User info:
Registered: Sep 2010
Posts: 58 (0.01 al dì)
Location:
Corso: Informatica
Anno:
Time Online: 20:07:32 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

appena vedi dei % è at&t

10-06-2013 10:38
Click Here to See the Profile for Fego Click here to Send Fego a Private Message Find more posts by Fego Add Fego to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 10:26.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.043 seconds (68.50% PHP - 31.50% MySQL) con 27 query.