2012年7月4日星期三

array.asm


;made by correy
;Email:leguanyuan@126.com
;QQ:112426112
;rc me.rc
;ml /coff test.asm /link /subsystem:windows me.res
.386
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
include user32.inc
includelib user32.lib
includelib kernel32.lib
.data
correy db "made by correy",0
a db 0
mail db "%c",0
azz db "abcdefghijklmnopqrstuvwxyz0123456789-_.",0
m126 db "
.data?
buffer DB 2 DUP (?)
b db ?
a1 db ?
a2 db ?
.code
a0 proc
mov esi,97
againa:
invoke wsprintf,addr buffer,addr mail,esi
invoke MessageBox,0,addr buffer,addr correy,0
inc esi
cmp esi,123
jne againa
mov esi,48
again0:
invoke wsprintf,addr buffer,addr mail,esi
invoke MessageBox,0,addr buffer,addr correy,0
inc esi
cmp esi,58
jne again0
a0 endp
;访问数组的方法
start:
call a0
lea ebx,azz
xor esi,esi
arre:
mov al,byte ptr [ebx]
mov b,al
invoke MessageBox,0,addr b,addr correy,0
inc ebx
inc esi
cmp esi,39
jb arre
;用jbe 多一个空格
invoke MessageBox,0,addr correy,addr correy,0
lea ebx,azz
xor esi,esi
arrey:
mov al,byte ptr [ebx+esi]
mov b,al
invoke MessageBox,0,addr b,addr correy,0
;inc ebx
inc esi
cmp esi,39
jb arrey
exit:invoke MessageBox,0,addr correy,addr correy,0
invoke ExitProcess,NULL
end start

没有评论:

发表评论