Hey guys can you help? I dont know how to do sum between two numbers For example :
first number>1
second number>5
sum w
proc display_interval
push BP
mov BP, SP
mov AX, [BP+4]
mov SP, BP
pop BP
print msg4
interval:
mov ax, num1 ;AX = CURRENT NUMBER.
add suma, ax
;CONVERT CURRENT NUMBER TO STRING.
call dollars ;FILL "STR" WITH '$'.
call number2string ;PARAMETER = AX.
mov ah, 9
mov dx, offset str
int 21h
mov ah, 9
mov dx, offset plus
int 21h
inc num1
mov ax, num1
cmp ax, num2
jbe interval ;IF AX <= NUM2
;BACKSPACE (DELETE LAST +).
print back
print equal
call dollars ;FILL "STR" WITH '$'.
mov ax, suma
call number2string ;PARAMETER = AX.
mov ah, 9
mov dx, offset str
int 21h
;-------------------------------------------
;IF SUMA IS EVEN RET WILL JUMP FEW ROWS BELOW(d2)
mov dx,0 ;dividing
mov bl,suma
mov ax,bx
mov cl,2
div cl ;the remainder from division stores in AH
mov dl,ah
add dl,48 ;48 ASCII is 0, for compare
cmp dl,48 ;0?
je d2
;dividing end
pop ax
mov sp,bp
pop bp
ret ;normal RET
d2: pop ax
mov dx,583 ;number whitch it jumps from RET
mov [bp+2],dx
mov sp,bp
pop bp
ret ; jumping RET, if suma is even
endp