Assembly 本汇编程序的意义

Assembly 本汇编程序的意义,assembly,Assembly,我试图理解这个汇编程序,它可以将两位数的未打包BCD编号转换为: 1) 等效ASCII码 ;Unpacked BCD to ASCII & Packed BCD .model small .data msg db 10,13,'Two ASCII Digits are ' asci1 db 30h,' and ' asci2 db 30h, '$' .code segment start: mov ax, @data ;Initializing dat

我试图理解这个汇编程序,它可以将两位数的未打包BCD编号转换为:

1) 等效ASCII码

;Unpacked BCD to ASCII & Packed BCD
.model small
.data
    msg db 10,13,'Two ASCII Digits are ' 
    asci1 db 30h,' and '
    asci2 db 30h, '$'
.code segment 
start:
    mov ax, @data ;Initializing data Segment register 
    mov ds, ax
    mov al, 2 ;1st Unpacked BCD number 
    mov bl, 4 ;2nd Unpacked BCD number
    add asci1, al ;equivalent ascii 
    add asci2, bl
    mov bh, al ;1st Unpacked bcd to bh 
    mov cl, 4 ;to shift lower 4 bits to higher 
    shl bh, cl
    or bh, bl ;Combine to get packed bcd in bh 
    lea dx, msg 

    ;Display All
    mov ah, 9 
    int 21h
    mov ah, 4ch ; exit to operating system. 
    int 21h
end start ; stop the assembler.
2) 压缩BCD当量

;Unpacked BCD to ASCII & Packed BCD
.model small
.data
    msg db 10,13,'Two ASCII Digits are ' 
    asci1 db 30h,' and '
    asci2 db 30h, '$'
.code segment 
start:
    mov ax, @data ;Initializing data Segment register 
    mov ds, ax
    mov al, 2 ;1st Unpacked BCD number 
    mov bl, 4 ;2nd Unpacked BCD number
    add asci1, al ;equivalent ascii 
    add asci2, bl
    mov bh, al ;1st Unpacked bcd to bh 
    mov cl, 4 ;to shift lower 4 bits to higher 
    shl bh, cl
    or bh, bl ;Combine to get packed bcd in bh 
    lea dx, msg 

    ;Display All
    mov ah, 9 
    int 21h
    mov ah, 4ch ; exit to operating system. 
    int 21h
end start ; stop the assembler.
我特别不理解数据段中的三行,特别是数字10、13、30h在这里的意思是什么

我也不理解代码部分,特别是
msg
如何将第一行与数字以及它们之间的单词“and”结合起来

一,;e该程序的输出为:

The ASCII digits are 2 and 4
我理解最后一段显示并退出操作系统的代码


请解释此程序执行此操作的原因和方式。

msg db 10,13在
两个ASCII数字的末尾添加一个CRLF…
语句。您需要查看ASCII图表。10是
LF
,13是
CR
,30h是字符“0”。