Jump to content
PirateClub.hu

high level assemblyvel kapcsolatos kérdés


spawn28
 Share

Recommended Posts

Sziasztok!

 

Kaptam egy feladatot, amelyet hla-ul kell megírnom. De vmiért nem műkszik, ha valaki ért ehhez a programozási nyelvhez kérem segítsen. Bemásolom a forráskódot és a feladatot is.

 

Unit unit_5;

 

procedure Fgv5 (VAR V1:int64; VAL V2:uns8; RESULT R:int64);

Begin Fgv5;//R=V1-V2

 

PUSH(EBX); PUSH(ECX);PUSH(EDI);

 

MOV((type int32 V1),EDI);

MOV([EDI],EAX);

MOV((type int32 V1[4]),EDI);

MOV([EDI],ECX);

MOVZX(V2,EBX);

 

SUB(EBX,EAX);

SBB(0,ECX);

 

MOV(EAX,(type int32 R));

MOV(ECX,(type int32 R[4]));

 

POP(EDI);POP(ECX);POP(EBX);

 

End Fgv5;

 

end unit_5;

 

Köszönöm előre is a segítséget és várom a válaszokat

Link to comment
Share on other sites

Esetleg:

 

Procedure Kivon(VAR V1:int64; VAL V2:uns8; RESULT R:int64);  
Begin Kivon; //R=V1-V2 
    MOV((type int32 V1), EAX); 
    MOV([EAX], EAX);
    SUB(EBX, EBX); 
    MOV(V2, BL);  
    SUB(EBX, EAX); 

    MOV(EAX, (type int32 R)); 
    MOV((type int32 V1[4], EAX); 
    MOV([EAX], EAX);
    SBB(0, EAX); 
    MOV(EAX, (type int32 R[4])); 
End Kivon;

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Hozzászólás a témához...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Jelenleg olvassa   0 members

    • No registered users viewing this page.
×
×
  • Create New...