Answer the question
In order to leave comments, you need to log in
What is the line add dl,'0' for?
org 100h
; складываем два числа
mov ax,5
add ax,10
xor cx,cx
mov bx,10
; переводим число в "строку"
lp1:
xor dx,dx ; обнуляем dx
div bx ; делим ax:bx
add dl,'0' ; зачем эта строчка нужна? ЗАЧЕЕЕЕЕЕМ?
push dx ; кладём в стек остаток от деления
inc cx
or ax,ax
jnz lp1
lp2:
pop ax
int 29h
loop lp2
mov ah,4ch
int 21h
Answer the question
In order to leave comments, you need to log in
Well, somehow it happened, purely by chance, that the numeric characters '0'-'9' in the ASCII table are in the same order as the numbers 0-9 in the decimal number system.
So, if we take the character '0' and add a number from 0 to 9 to its code, then, oddly enough, we get the code of the character corresponding to this number.
'0' + 0 = '0'
'0' + 1 = '1'
etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question