简体   繁体   中英

Add decimal digits in Assembly Programming 8086

Is there any way to ADD two decimal digits in Assembly Programming 8086 ?

This is what i'm trying:

.model small
.stack 100h

.code

main proc


mov ah,1
Int 21h

mov bl, al

Int 21h
mov cl, al

ADD bl, cl

mov ah, 2
mov dl, bl
Int 21h


mov ah, 4ch
Int 21h

main endp

end main

But the result is in ASCII , I want it in decimal .

要将ASCII转换为十进制值,只需减去0字符的ASCII值(十进制为48),然后进行数学运算,然后通过加回值0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM