Skip to content

Language NASM

Donald Sebastian Leung edited this page Apr 14, 2018 · 10 revisions

Status

Beta

Versions

2.11

Submitted code is assembled with nasm -f elf64.

Test Frameworks

Criterion

section .text
global add
add:            ; int add(int a, int b)
  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);
}

Timeout

12 seconds

Packages

None

Services

None

Clone this wiki locally