Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Assembler_Zadanie6.cpp : Ten plik zawiera funkcję „main”. W nim rozpoczyna się i kończy wykonywanie programu.
- //
- #include "pch.h"
- #include <cstdlib>
- #include <iostream>
- #include <stdio.h>
- using namespace std;
- static int iLiczba, iLiczba2, iLiczba3, iLiczba4, iWynik;
- int main()
- {
- iLiczba = 12;
- iLiczba2 = 5;
- iLiczba3 = 6;
- iLiczba4 = 2;
- __asm {
- mov eax, iLiczba2
- mov ebx, iLiczba3
- imul eax, ebx;
- mov ebx, iLiczba
- sub ebx, eax
- mov eax, ebx
- cdq
- mov ebx, iLiczba4
- idiv ebx
- mov iWynik, eax;
- }
- printf("\nWartosci po wstawce asm \t"
- "Liczba: %d\tWynik: %d", iLiczba, iWynik);
- printf("\n");
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement