I tried to solve this project for school and when i use a compiler the final result is some emoticons instead of the sum of digits
I rewrote the entire code, but I get the same result
.model small
.stack 100h
.data
nstr db 6 dup(' ')
idv dw 10
a dw 2
b dw 9
c dw 6
x dw ? ;x=a+b+c
d dw 7
e dw 5
y dw ? ;y=d+e
z dw ? ;z=x+y
.code
.start
mov ds, ax
; x = a+b+c
mov ax, a
add ax, b
add ax, c
mov x, ax
; y = d+e
mov ax, d
add ax, e
mov y, ax
; z = x+y
mov ax, x
add ax, y
mov z , ax
mov si,5
mov nstr[si], '$'
dec si
mov ax, z
mov dx,0
loop1: ;
div idv
;
add dl, '0'
mov nstr[si],dl
dec si
mov dx,0
cmp ax,0
jne loop1
listn:
mov ah, 09h
mov dx, offset nstr ;
int 21h
stopprg:
mov ah, 4ch
int 21h
end