Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

doing sum = al +bl in assembly

i want do something like this code in assembly

al = some number;
bl = some number;
if (al == bl) 
    sum = al + bl;
else 
    sum = 0;
print sum;

this is my code so far and its not working and i don`t know where is the problem

mov al, 5
mov bl, 5

compare:
    cmp al,bl
    je calc_sum:

; if not equal 
    mov sum,0
    jmp print_sum:     

calc_sum:
    add al,bl
    add sum,al

print_sum:        
    mov dl,sum
    mov ah,2
    int 21h

Comments