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

    。。。

  • 相关阅读:
    Bootstrap表格的使用
    [JS练习] 瀑布流照片墙
    [C#基础] 委托
    [C#基础] 泛型
    [C#基础] 继承
    [C#基础] 类
    [C#基础] 数据类型
    Unity获取手机的电量时间
    C#网络通信Socket详解
    记C#一次服务器搭建和数据库应用
  • 原文地址:https://www.cnblogs.com/tk091/p/2681968.html
Copyright © 2011-2022 走看看