应中DOS中断显示字符串(摘自《汇编语言》王爽)

data 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
ends 

code segment
start:   
    mov ax,data
    mov ds,ax
    mov bx,offset s
    mov si,offset row
    mov cx,4
    ok:
    mov bh,0
    mov dh,[si]
    mov dl,0
    mov ah,2
    int 10h     ;set the cusor position
    
    mov dx,[bx]
    mov ah,9
    int 21h
    
    inc si
    add bx,2
    
    loop ok
    
    mov ax, 4c00h ; exit to operating system.
    int 21h    
ends

end start ; set entry point and stop the assembler.

 

你可能感兴趣的:(汇编语言)