主题:[讨论]请教下汇编编写Unicode的问题
请问在汇编里如何编写纯Unicode的程序,如何按Unicode方式编译呢? 我在网上找了下,都是VC里编译Unicode,都没有提到汇编的. MASM默认是用ANSI方式编译的吧,我在ML和LINK的参数里也找不到和Unicode有关的东西.
我自己试了下,字符串用byte定义的话会乱码,但是用word定义编译又会出错
.386
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
includelib kernel32.lib
include user32.inc
includelib user32.lib
UNICODE=1
if UNICODE
MessageBox equ <MessageBoxW>
else
MessageBox equ <MessageBoxA>
endif
.data
szText db 'Hello,Windows 98!',0
szCap db 'HelloMsg',0
.data?
hInstance dd ?
.code
start:
invoke MessageBoxW,NULL,offset szText,offset szCap,MB_OK
invoke ExitProcess,NULL
end start
我自己试了下,字符串用byte定义的话会乱码,但是用word定义编译又会出错
.386
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
includelib kernel32.lib
include user32.inc
includelib user32.lib
UNICODE=1
if UNICODE
MessageBox equ <MessageBoxW>
else
MessageBox equ <MessageBoxA>
endif
.data
szText db 'Hello,Windows 98!',0
szCap db 'HelloMsg',0
.data?
hInstance dd ?
.code
start:
invoke MessageBoxW,NULL,offset szText,offset szCap,MB_OK
invoke ExitProcess,NULL
end start