this slowpoke moves

Basic Arithmetic in ASM

function Addition(sNum1:integer; sNum2:integer):integer;
begin
  asm
    mov eax, sNum2
    add snum1, eax
    mov eax, snum1
    mov @result, eax
  end;
end;

function Subtraction(sNum1:integer; sNum2:integer):integer;
begin
  asm
    mov eax, sNum2
    sub snum1, eax
    mov eax, snum1
    mov @result, eax
  end;
end;

function Multiplication(sNum1:integer; sNum2:integer):integer;
begin
  asm
    mov eax, sNum2
    mov edx,snum1
    mul edx
    mov @result,eax
  end;
end;

function Division(sNum1:integer; sNum2:integer):integer;
begin
  asm
    mov eax, sNum1
    mov edx,0
    mov ebx,snum2
    div ebx
    mov @result,eax
  end;
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate