组装简单的问题 [英] Simple assembly questions

查看:175
本文介绍了组装简单的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

; int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd)
_wWinMain@16 proc near

var_4= dword ptr -4
hInstance= dword ptr  4
hPrevInstance= dword ptr  8
lpCmdLine= dword ptr  0Ch
nShowCmd= dword ptr  10h

这是我所看到的,在过去​​的4变量传递给WinMain函数的参数。此外,VAR_4一定是我后来在函数体中声明一个int变量。现在,我有几个问题:

From what I can see, the last 4 variables are the parameters passed to the WinMain function. Also, the var_4 must be a int variable I declared later in the function body. Now, I have a couple of questions:

一)什么是一个字一个32位Windows程序的大小? 4字节?作为一个DWORD 8?

a) What is the size of a word on a 32bit windows program? 4 bytes? being a dword 8?

二)为什么VAR_4设定为-4?为什么在无法启动,让我们说,0?

b) Why is var_4 set to -4? Why not start at, let's say, 0?

C)在C定义整型标准程序是,虽然

c) The standard procedure for defining ints in c is though

var_x = DWORD PTRŸ?

var_x = dword ptr y?

感谢

推荐答案

一。 DWORD是无符号的,32位:请参见这里 (旧名,MS使用回去当Windows启动16位)。

a. DWORD is unsigned, 32 bit: see here (old name, MS started using it back when Windows was 16-bit).

乙。堆栈顶部(DWORD PTR 0)溶于由返回地址

b. the top of stack (dword ptr 0) is taken up by the return-address

℃。变量在这里是行不通的。无论如何,本系统使用 DWORD PTR 是一定的汇编器和反汇编程序,而不是一个标准程序。

c. a variable y here would not work. Anyway, this systematic use of dword ptr is characteristic of certain assemblers and disassemblers, not a "standard procedure".

这篇关于组装简单的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆