📄 scasw.asm
字号:
; This sample shows how
; to use SCASW instruction
; to find a WORD (2 bytes).
#make_COM#
; COM file is loaded at 100h
; prefix:
ORG 100h
; set forward direction:
CLD
; set counter to data size:
MOV CX, 4
; load string address
; into ES:DI
MOV AX, CS
MOV ES, AX
LEA DI, dat1
; we will look for the 9012h
; word in data string:
MOV AX, 9012h
REPNE SCASW
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 9012h word:
DEC DI
exit_here:
RET
dat1 DW 1234h, 5678h, 9012h, 3456h
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -