masm学习

        .486
        .model flat,stdcall
        option casemap:none   ; case sensitive
;http://www.popbook.com/wbbs/topic.asp?l_id=5&t_id=2294
include \masm32\include\windows.inc 
include \masm32\include\kernel32.inc 
includelib \masm32\lib\kernel32.lib 
include \masm32\include\user32.inc 
includelib \masm32\lib\user32

ABCCC struct
   String1    DWORD      ?
   String2    DWORD      ?
   String3    DWORD      ?
ABCCC ends

.const ; 
    dbtext db "hello",0;
    dbtitle db "title",0;

.data
    testst ABCCC <"A","b","c">

 

.code
 
    start :
        call main;
        invoke ExitProcess,eax;
        
        testfnvar proc C var_1
            ret;
        testfnvar endp
        
        main proc 
            mov esi, OFFSET testst;
            assume esi:ptr ABCCC; ;给寄存器声明结构
            ;类型 pre 变量名 ;转换类型
            mov eax, [esi].String1; 
            invoke MessageBox, NULL, addr [esi].String1, addr dbtitle, MB_OK;
             invoke testfnvar ,1 ;            
        main endp
        
        

        
        testfn proc 
            local @l1:dword;
            local @l2:word;
            local @l3:word;
            mov eax,@l1;
            mov ax,@l2;
            mov bx,@l3;
            invoke MessageBox ,NULL, addr dbtext,addr dbtitle,MB_OK;
            ;ret;
        testfn endp
    
    end start

 

notepad++ 配置

安装 nppexec插件

在插件菜单里添加

npp_save
echo $(CURRENT_DIRECTORY)
echo $(FILE_NAME)
echo $(NAME_PART)
cd $(CURRENT_DIRECTORY)
D:\masm32\bin\ml /c /coff /Cp $(FILE_NAME)
D:\masm32\bin\link /SUBSYSTEM:WINDOWS /LIBPATH:D:\masm32\lib $(NAME_PART).obj

$(CURRENT_DIRECTORY)\$(NAME_PART).exe

 

转载于:https://www.cnblogs.com/solq/p/3622256.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值