Advertisement
rengetsu

Asemblerinis Programavimas

Nov 14th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int res;
  8.     _asm{
  9.         push eax
  10.         push ebx
  11.        
  12.         mov eax, 5
  13.        
  14.         cmp eax, 0
  15.        
  16.         jg did
  17.        
  18.         cmp eax, 0
  19.         jl maz
  20.        
  21.         cmp eax, 0
  22.         je lygu
  23.        
  24.        
  25.         did:
  26.         mov ebx, -10
  27.         jmp exit_if
  28.        
  29.         maz:
  30.         mov ebx, 5
  31.         jmp exit_if
  32.        
  33.         lygu:
  34.         mov ebx, 0
  35.         jmp exit_if
  36.        
  37.         exit_if:
  38.        
  39.         mov res, ebx
  40.    }
  41.     cout<<"b reiksme: "<<res<<endl;
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement