Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int perimeter_of_rectangle(int a, int b) {
- _asm {
- mov eax, a;
- add eax, b;
- }
- }
- void print_perimeter_of_rectangle(int a, int b) {
- const char *f = "perimeter_of_rectangle(%d,%d) = %d\n";
- _asm {
- mov eax, a;
- mov ebx, b;
- push eax
- push ebx
- call perimeter_of_rectangle
- push eax
- mov eax,a
- mov ecx,b
- push eax
- push ecx
- push f
- call printf
- add esp, 32
- }
- }
- int main()
- {
- char answer = 0;
- print_perimeter_of_rectangle(5, 4);
- cin >> answer;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement