rusi/test/asm.c

24 lines
581 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#включить "тест.з"
#включить "stdvv.c"
символ *асмункция1(пусто) {
асм("mov $50, %rax\n\t"
"mov %rbp, %rsp\n\t"
"pop %rbp\n\t"
"ret");
}
символ *асмункция2(пусто) {
асм inline volatile("mov $55, %rax\n\t"
"mov %rbp, %rsp\n\t"
"pop %rbp\n\t"
"ret");
}
цел главн() {
ПРОВЕРИТЬ(50, асмункция1());
ПРОВЕРИТЬ(55, асмункция2());
printf("OK\n");
возврат 0;
}