例1.1.asm

来自「清华汇编实验源代码 字符串匹配 查询电话号码 窗口屏幕程序」· 汇编 代码 · 共 41 行

ASM
41
字号
DATAS SEGMENT
    string1 db 'Move the cursor backward.'
    string2 db 'Move the cursor backward.'
    ;
    mess1 db 'Match',13,10,'$'
    mess2 db 'No Match!',13,10,'$'  
DATAS ENDS
;**************************************************
CODES SEGMENT
;--------------------------------------------------
	main proc far
    ASSUME CS:CODES,DS:DATAS,es:datas
START:
    push ds
    sub ax,ax
    push ax
    ;    
    MOV AX,DATAS
    MOV DS,AX
    mov es,ax
    ;
    lea si,string1
    lea di,string2
    cld
    mov cx,25
    repz cmpsb
    jz match
    lea dx,mess2
    jmp short disp
match:
	lea dx,mess1
disp:
	mov ah,09
	int 21h
	ret
main endp
;--------------------------------------------------
codes ends
;**************************************************
    END START

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?