[pso] [Windows - Tema1]asm_ mov syscall, eax

Bogdan Ardeleanu bogdanardeleanu at gmail.com
Mon Mar 27 11:17:21 EEST 2006


Scuze pentru eroarea lexicala de mai inainte, scrisesem "_mov", dar intrebarea se mentine!
  ----- Original Message ----- 
  From: Adrian - Razvan Deaconescu 
  To: Proiectarea Sistemelor de Operare 
  Sent: Monday, March 27, 2006 5:47 AM
  Subject: Re: [pso] [Windows - Tema1]asm_ mov syscall, eax


  On 3/27/06, Bogdan Ardeleanu <bogdanardeleanu at gmail.com> wrote:
    Se pare ca am ceva probleme cand folosesc aceste instructiuni...

    "asm_ mov syscall, eax"


  Sper ca ai scris tu gresit. Din cate stiu eu pentru inline assembly ar trebui sa folosesti instructiunea
  "_asm mov syscall, eax" (underscore in fata la asm nu dupa). 



    syscall folosita in intercept() are valoarea 120, iar in eax apare valoarea 1 dupa intructiune a de mai sus.


  Sper, de asemenea, ca iti dai seama de ordinea operanzilor folosind sintaxa Intel:

  mov dest, src
  In instructiunea ta vei copia valoarea din eax in syscall. Daca eax era 1 atunci ramane 1, syscall este cel care se modifica. 


    Ma poate ajuta cineva daca ?..Multumesc frumos!


  int add_assembly (int x, int y)
  {
      int res;

      _asm mov eax, x
      _asm mov ebx, y
      _asm add eax, ebx
      _asm mov res, eax


      return res;
  }

  mai sus e un exemplu de adunare a doua numere folosind inline assembly

  Hope this helps,
  Razvan



------------------------------------------------------------------------------


  _______________________________________________
  pso mailing list
  pso at cursuri.cs.pub.ro
  http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/pso/attachments/20060327/11260cc8/attachment.html


More information about the pso mailing list