I have next problem: when I try to do divide a smaller number to a bigger one I get the quotient very high and I cannot understand why. Here is the program where I am trying to divide 1 to 5 and the result is 256. (also the variables 'a' and 'b' must be of type db) Can someone help me? Thank you in advance
.model small
afisareanr macro nr
local m11
local m
xor ax, ax
mov ax, nr
push ax
mov si, 10
mov di, 5
mov dx, 0
cmp ax, 0
jge m
neg ax
m:div si
add dl, 30h
mov s[di],dl
xor dx,dx
dec di
cmp ax, 0
jne m
pop ax
cmp ax, 0
jge m11
mov s[di], '-'
m11:
mov ah, 9
lea dx, s
int 21h
endm
.stack
.data
a db 5
b db 1
s db 6 dup(" "), '$'
.code
mov ax, @data
mov ds, ax
xor ax, ax
xor bx, bx
mov al, b
idiv a
mov bx, ax
afisareanr bx
mov ax, 4c00h
int 21h
end