C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
file: main.c
Created By: Henrik Andersson
Date Created: March 06, 2019
Description: eax esi swap
*/
#include <stdio.h>
void swap(int *a, int *b){
asm("" : "=r" (*a), "=r" (*b) : "1" (*a), "0" (*b));
printf("%d %d\n", *a, *b);
}
int main() {
int a = 1;
int b = 22;
swap(&a,&b);
printf("%d %d", a, b);
return 0;
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run