windows ce 安装java,Windows CE的汇编语言

如何用Windows CE(x86)的汇编语言编写程序?现在我正在使用VS2008 winth Windows CE 5.0 SDK,我的C程序运行正常 . 我尝试使用我的代码创建一个asm文件并将其包含在项目中:

#include "stdafx.h"

#include "windows.h"

extern "C" void clear();

int _tmain(int argc, _TCHAR* argv[])

{

clear();

return 0;

}

clear.asm:

.586 ;Target processor. Use instructions for Pentium class machines

.MODEL FLAT, C ;Use the flat memory model. Use C calling conventions

.STACK ;Define a stack segment of 1KB (Not required for this example)

.DATA ;Create a near data segment. Local variables are declared after

;this directive (Not required for this example)

.CODE ;Indicates the start of a code segment.

clear PROC

xor eax, eax

xor ebx, ebx

ret

clear ENDP

END

一切顺利,直到我想调用WinApi函数(MessageBox)形式的asm代码 .

.DATA ;Create a near data segment. Local variables are declared after

szMessageText DB "Hello world text", 0

szMessageCaption DB "HWorld capt, 0

.CODE ;Indicates the start of a code segment.

clear PROC

Invoke MessageBox, NULL, ADDR szMessageText, ADDR szMessageCaption, MB_OK

clear ENDP

END

它给

错误A2006:未定义的符号:MessageBox

我为MASM添加了包含Windows CE SDK库的包含路径:

C:\ Program Files \ Windows CE Tools \ wce500 \ STANDARDSDK_500 \ Lib \ x86

并试图包括coredll.lib,但没有效果

includelib coredll.lib

所以主要问题是: Where is my mistake? Can I write asm code with winapi functions?

Thaks for your answers!

-----------------------------------------------

UPD: 谢谢大家 . 我设法通过编写一个函数的proto defenition来构建项目:

MessageBoxW PROTO hwnd:DWORD,lpText:DWORD,lpCaption:DWORD,uType:DWORD

我怎样才能避免为我将要使用的每个函数编写这样的原型?据我所知,我需要.inc文件与proto defenitions的功能?或者以某种方式使用.h文件中的函数定义?

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值