📄 scasb.asm
字号:
; This sample shows how
; to use SCASB instruction
; to find a symbol.
#make_COM#
; COM file is loaded at 100h
; prefix:
ORG 100h
; set forward direction:
CLD
; set counter to string size:
MOV CX, 10
; load string address
; into ES:DI
MOV AX, CS
MOV ES, AX
LEA DI, str1
; we will look for the 'C'
; character in string:
MOV AL, 'C'
REPNE SCASB
JZ found
not_found:
; "No" - not found!
MOV AL, 'N'
MOV AH, 0Eh
INT 10h
JMP exit_here
found:
; "Yes" - found!
MOV AL, 'Y'
MOV AH, 0Eh
INT 10h
; DI contains the
; offset of 'C' character:
DEC DI
exit_here:
RET
str1 DB 'AAABBBCDDD'
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -