Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //***************************************************
- // Simple program returns min value of
- // two input values
- //***************************************************
- #include <stdio.h>
- int main() {
- int number1, number2;
- scanf("%d%d", &number1, &number2);
- int minValue;
- __asm(" movl %1, %%eax;"
- " movl %2, %%ebx;"
- " cmpl %%eax, %%ebx;"
- " jl .L1;"
- " movl %%eax, %0;"
- " jmp .L2;"
- ".L1: movl %%ebx, %0;"
- ".L2: "
- : "=r" (minValue)
- : "a" (number1), "b" (number2));
- printf("%d", minValue);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement