Einfache Addition

Reading time ~1 minute

Framework für Addition in C

#include <stdio.h>

extern unsigned int addit(int, int);

int main(void)
{ printf("%d\n", addit(100, 78)); }

Addition in NASM

section .data
section .text

global addit
addit:

    ;CODE
    mov  rax, rdi	;param1 in rax
    mov  rbx, rsi	;param2 in rbx
    add  rax, rbx	;additionsergebnis in rax
    ret