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

    。。。

  • 相关阅读:
    在windwos创建的脚本文件在linux环境中无法执行的问题
    shell的文件锁操作
    systemd target
    算法-排序数组
    算法-存在重复元素
    算法-移除元素
    算法-两数之和
    touch事件详解
    小程序 打包太大
    taro/vue 左滑删除购物车
  • 原文地址:https://www.cnblogs.com/tk091/p/2681968.html
Copyright © 2011-2022 走看看