Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int a = 3;
- int b = 51;
- int resposta;
- //cmp A and B ,jle jump if less
- asm(
- "cmp %1, %2\n\t"
- "jl greater\n\t"
- "movl %1, %0\n\t"
- "jmp end\n"
- "greater:\n\t"
- "movl %2, %0\n"
- "end:"
- :"=r"(resposta)
- :"r"(a), "r"(b)
- );
- fprintf(stdout,"valor menor é %d\n", resposta);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment