-
Notifications
You must be signed in to change notification settings - Fork 221
Language NASM
kazk edited this page Jun 16, 2020
·
10 revisions
2.11
Submitted code is assembled with nasm -f elf64
.
section .text
global add
add: ; int add(int a, int b) using 32-bit registers for ints
mov eax, edi ; result = a
add eax, esi ; result += b
ret ; return result
#include <criterion/criterion.h>
int add(int, int);
Test(add_test, should_add_integers) {
cr_assert_eq(add(1, 1), 2);
}
12 seconds
None
None
nasm