zoukankan      html  css  js  c++  java
  • 汇编语言的强制类型转换

    首先来看错误的写法

     1 .386
     2 .model flat,stdcall
     3 option casemap:none
     4 
     5 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
     6 ;
     7 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
     8 include windows.inc
     9 include user32.inc
    10 include kernel32.inc
    11 
    12 includelib user32.lib
    13 includelib kernel32.lib
    14 
    15 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    16 ;
    17 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    18 .data
    19 szBuffer   db  1024 dup(?)
    20 
    21 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    22 ;
    23 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    24 .code 
    25 start:
    26 move  eax,dword ptr szBuffer
    27 invoke  MessageBox,NULL,NULL,NULL,MB_OK
    28 invoke ExitProcess,NULL
    29 end start


    下面是正确的写法

     1 .386
     2 .model flat,stdcall
     3 option casemap:none
     4 
     5 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
     6 ;
     7 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
     8 include windows.inc
     9 include user32.inc
    10 include kernel32.inc
    11 
    12 includelib user32.lib
    13 includelib kernel32.lib
    14 
    15 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    16 ;
    17 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    18 .data
    19 szBuffer   db  1024 dup(?)
    20 
    21 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    22 ;
    23 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    24 TestProc proc 
    25     
    26     push eax
    27     mov  eax,dword ptr szBuffer
    28     pop eax
    29     ret
    30 
    31 TestProc endp
    32 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    33 ;
    34 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    35 .code 
    36 start:
    37 call TestProc
    38 invoke  MessageBox,NULL,NULL,NULL,MB_OK
    39 invoke ExitProcess,NULL
    40 end start

    。。。

  • 相关阅读:
    idea添加类注释和方法注释
    蓝桥杯ALGO-1,区间k大数查询
    personalblog
    ul+li水平居中的几种方法
    前端ps部分
    帝国cms-tab
    帝国cms判断某一字段是否为空
    帝国cms建站总结-(分页)
    Js获取验证码倒计时
    前端截取字符串:JS截取字符串之substring、substr和slice详解
  • 原文地址:https://www.cnblogs.com/tk091/p/2681968.html
Copyright © 2011-2022 走看看