step1:新建一个Console App工程(其他工程也行),勾选编译模块选项
step2:新建一个模块,命名b.asm。
下面是Test3.asm(主模块)的源代码:
.386
.model flat, stdcall
option casemap:none
include windows.inc
include user32.inc
includelib user32.lib
extern fun@0:proc
fun equ fun@0
.code
start:
call fun
ret
END start
下面是b.asm模块的源代码:
.386
.model flat, stdcall
option casemap:none
include windows.inc
include user32.inc
includelib user32.lib
.code
fun PROC
jmp @F
szText db "Hello, world!", 0
szCap db "Hello", 0
@@:
invoke MessageBox, NULL, offset szText, offset szCap, MB_OK
ret
fun ENDP
END
step5:按Ctrl+F5构建运行就可以了!
这个例子还适用于Intel汇编语言程序设计第五版8.6.5小节的内容,这个问题困扰了我半天的时间,而且网上也搜不到相关的帮助,希望能帮到有需要的朋友吧O(∩_∩)O哈哈~。