rusi/test_ru/asm2.c

15 lines
539 B
C
Raw 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.

// asm2.c - Проверка оператора asm с системным вызовом
длин сис_вызов(длин номер, длин арг1, длин арг2, длин арг3) {
асм("mov %rcx, %r10");
асм("mov %rdi, %rax");
асм("mov %rsi, %rdi");
асм("mov %rdx, %rsi");
асм("mov %r10, %rdx");
асм("syscall");
}
цел главн(){
// syscall 60 = exit, аргумент 0
сис_вызов(60, 0, 0, 0);
возврат 1; // Сюда не должны попасть
}