Mov ah,02 ; DOS.PrintCharacter
Mov cl,0A ; Count for the 1st loop
Mov dh,30 ; '0'
0106 is address of top of the 1st loop.
Mov dl,dh
Int 21 ; This prints a digit
Mov dl,20 ; ' '
Int 21 ; This interjects a space character
Add dh,01 ; Next character
Loop 0106 ; Go to top of the 1st loop
Mov ah,02 ; DOS.PrintCharacter
Mov cl,09 ; Count for the 2nd loop
Mov bl,31 ; '1'
01?? is address of top of the 2nd loop.
Mov dl,0A ; Linefeed
Int 21
Mov dl,0D ; Carriage return
Int 21
Mov dl,bl ; Current character
Int 21
Add bl,01 ; Next character
Loop 0106 ; Go to top of the 1st (????????) loop
Mov ah,02 ; DOS.PrintCharacter
Mov cx,0A ; Count for the 1st loop
Mov dl,30 ; '0'
0107 is address of top of the 1st loop.
Int 21 ; This prints a digit
Add dl,01 ; Next character
Loop 0107 ; Go to top of the 1st loop
Mov cl,09 ; Count for the 2nd loop
Mov bl,31 ; '1'
0112 is address of top of the 2nd loop.
Mov dl,0D ; Carriage return
Int 21
Mov dl,0A ; Linefeed
Int 21
Mov dl,bl ; Current character
Int 21
Add bl,01 ; Next character
Loop 0112 ; Go to top of the 2nd loop
int 20 ; DOS.Terminate
1条答案
按热度按时间y0u0uwnf1#
与你的标题中所说的使用TASM相反,截图和代码对应于DOS调试。查看有关编写TASM程序的信息。
让我们从注解代码开始(这是你在发布之前应该做的事情!)):
第一次循环
CX
寄存器为0。您需要使用mov cx, 0A
(十进制10)初始化循环计数器。loop
指令依赖于CX
,而不仅仅是CL
。Mov dl,20
Int 21
的行。第二次循环
mov cl, 09
(十进制9)初始化循环计数器,因为前一条loop
指令将使CX
寄存器的值为0。loop
指令必须转到另一个目的地。程序