能力值:
( LV6,RANK:80 )
|
-
-
2 楼
invoke printf,CTXT("abc")
不知道是不是这样用..
不是的话,你自己查一下CTXT宏
|
能力值:
( LV9,RANK:380 )
|
-
-
3 楼
FUNC MACRO parameters:VARARG
invoke parameters
EXITM <eax>
ENDM
literal MACRO quoted_text:VARARG
LOCAL local_text
.data
local_text db quoted_text,0
align 4
.code
EXITM <local_text>
ENDM
CTXT MACRO quoted_text:VARARG
EXITM <offset literal(quoted_text)>
ENDM
str$ MACRO DDvalue
LOCAL rvstring
.data
rvstring db 20 dup (0)
align 4
.code
invoke dwtoa,DDvalue,ADDR rvstring
EXITM <ADDR rvstring>
ENDM
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
CTXT macro Text:VARARG
local szText
.data
szText byte Text, 0
.code
exitm <offset szText>
endm
ctxt equ <CTXT>
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
#include <stdio.h>
char format[] = "%s %s\n";
char hello[] = "Hello";
char world[] = "world";
void main( void )
{
__asm
{
mov eax, offset world
push eax
mov eax, offset hello
push eax
mov eax, offset format
push eax
call printf
//clean up the stack so that main can exit cleanly
//use the unused register ebx to do the cleanup
pop ebx
pop ebx
pop ebx
}
}
|
能力值:
( LV12,RANK:300 )
|
-
-
6 楼
include masm32rt.inc
includelib masm32.lib
invoke StdOut, CTXT("abc")
楼主主要想要的是在MASM32下怎么用MACRO来使得书写简便,而不是想VC内联汇编,更不想要一个一个push后call,所以楼上的辛苦写的代码楼主应该不会接受。
|
能力值:
( LV3,RANK:20 )
|
-
-
7 楼
.386
.model flat, stdcall
option casemap :none
include windows.inc
include user32.inc
include kernel32.inc
includelib user32.lib
include masm32rt.inc
includelib masm32.lib
.data
.data?
szBuffer db 256 dup(?)
.code
start:
invoke StdOut,CTXT("OUT OK!!!!")
invoke StdIn,offset szBuffer,sizeof szBuffer
invoke ExitProcess,NULL
end start
----------------------------------------------------------
J:\ctxt.asm(25) : error A2006: undefined symbol : CTXT
J:\ctxt.asm(25) : error A2114: INVOKE argument type mismatch : argument : 1
出现这样的错误包含的文件错了吗?
|
能力值:
( LV3,RANK:20 )
|
-
-
8 楼
pengmo 整的宏的,编译时没错,连接时出错了,有哪位有完整的吗,发个来吧。百度在查中,还没查到
CTXT macro Text:VARARG
local szText
.data
szText byte Text, 0
.code
exitm <offset szText>
endm
ctxt equ <CTXT>
|
能力值:
( LV13,RANK:290 )
|
-
-
9 楼
invoke crt_printf
|
能力值:
( LV3,RANK:20 )
|
-
-
10 楼
已解决,
C:\RadASM\masm32\macros
include macros.asm 就行了.开始不行是我在另一台电脑上,环境不对所至.
|
|
|