自定义函数

.386
.model flat,stdcall
option casemap:none
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include  windows.inc
include  user32.inc
includelib user32.lib
include  kernel32.inc
includelib kernel32.lib
AsmAdd proto,:dword,:dword,:dword,:dword
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                .data
  var1 byte "123456"
  var2 byte "654321"
  sum  byte (sizeof var1+1) dup (?),0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  .code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                AsmAdd proc lpsum,lpvar1,lpvar2,lengths
                       pushad
                       mov ecx,lengths
                       mov edi,lpsum
                       add edi,ecx
                       dec ecx
                       mov esi,lpvar1
                       mov ebx,lpvar2
                       add esi,ecx
                       add ebx,ecx
                       mov ecx,lengths
                       mov bh,0
                L1: mov ah,0
                       mov al,byte ptr [esi]
                       add al,bh
                       mov bh,ah
                       or bh,30h
                       add al,byte ptr [ebx]
                       aaa
                      or bh,ah
                      or bh,30h
                      or al,30h
                      mov byte ptr [edi],al
                      dec esi
                      dec edi
                      dec ebx
                      dec lpvar1
                      dec lpvar2
                      dec lpsum
                      loop L1
                      mov byte ptr [edi],bh
                      pushad
                      ret
              AsmAdd  endp
start:
               mov eax,sizeof var1
               invoke AsmAdd,addr sum,addr var1,addr var2,eax
               invoke MessageBox,NULL,addr sum,addr sum,0
               invoke ExitProcess,NULL
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  end start
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值