分别在屏幕的第2,4,6,8行显示4句英文诗
程序无限循环 调试2天 一点进展没有
求指错
程序代码:
assume cs:code
data segment
db 16 dup (0)
data ends
code segment
s1: db 'Good,better,best,','$'
s2: db 'Never let it rest,','$'
s3: db 'Till good is better,','$'
s4: db 'And better,best.','$'
s: dw offset s1,offset s2,offset s3,offset s4
row: db 2,4,6,8
start:
mov ax,data
mov ss,ax
mov sp,16
mov si,offset s1
mov dx,offset s
mov bx,offset row
mov ax,cs
mov ds,ax
mov ax,0b800h
mov es,ax
mov cx,4
mov ah,0
mov al,160
so: ;数据段行循环
push ax
push cx
push dx
push bx ;保存当前寄存器参数
mul byte ptr [bx]
mov bx,dx
mov di,ax ;di 显存 初始位置
so1:
mov si,[bx]
cmp byte ptr [si],'$'
jcxz ok
mov al,[si]
mov ah,02h
mov es:[di],ax
add di,2
inc si
jmp short so1
ok:
pop bx
pop dx
pop cx
pop ax
inc bx
add dx,2
loop so
mov ax,4c00h
int 21h
code ends
end start
------解决方案--------------------