根据长度结束循环
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.386
.model flat,stdcall
option casemap:none
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include windows.inc
include gdi32.inc
includelib gdi32.lib
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.data
str1 byte "431028198516341"
testup byte "7"
testdown byte "3"
strBuffer byte sizeof str1 dup(0)
strMsg db "在3-7的数字",0
strMsg1 db "选出在3-7的数字",0
.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start:
pushad
invoke MessageBox,0,addr str1,addr strMsg1,1
mov edi,0
mov esi,offset str1
mov ecx,lengthof str1
L1:mov al,[esi]
cmp al,testdown
jb L2
cmp al,testup
ja L2
mov strBuffer[edi],al
inc edi
L2:inc esi
loop L1
popad
invoke MessageBox,0,addr strBuffer,addr strMsg,1
invoke ExitProcess,NULL
end start
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
根据读到0结束循环
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.386
.model flat,stdcall
option casemap:none
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Include 文件定义
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include windows.inc
include gdi32.inc
includelib gdi32.lib
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.data
str1 byte "43128198516341",0
testup byte "7"
testdown byte "3"
strBuffer byte sizeof str1 dup(0)
strMsg db "在3-7的数字",0
strMsg1 db "选出在3-7的数字",0
.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start:
pushad
invoke MessageBox,0,addr str1,addr strMsg1,1
mov edi,0
mov esi,offset str1
L1:mov al,[esi]
cmp al,0
je L3
cmp al,testdown
jb L2
cmp al,testup
ja L2
mov strBuffer[edi],al
inc edi
L2:inc esi
jmp L1
L3:popad
invoke MessageBox,0,addr strBuffer,addr strMsg,1
invoke ExitProcess,NULL
end start
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
加深对汇编指令的熟练
最新推荐文章于 2024-05-12 00:01:05 发布