汇编语言多文件程序设计
来源:互联网 发布:海尔32电视网络售价 编辑:程序博客网 时间:2024/06/05 11:11
汇编语言多文件程序设计
2011-11-7 晴 于韶关仁化
变量的共享
关键字externdef跟C语言中的extern相似。在定义与引用模块(源文件)中的声明的一致的。
声明格式:
EXTERNDEF [[langtype]] name:type [[, [[langtype]] name:type]]...
MSDN Remars:
If name is defined in the module, it is treated as PUBLIC. If name is referenced in the module, it is treated as EXTERN. If name is not referenced, it is ignored. The type can be ABS, which imports name as a constant. Normally used in include files.
函数的共享
函数在调用之前必须使用proto语句提前声明。否则MASM会提示" error A2190:INVOKE requires prototype for procedure"。要在本模块中使用其它模块中的文件时,只需在调用模块作个proto声明就行了。
程序示例:
;-------------------main.asm--------------------------.386.model stdcall, flatoption casemap:nonefnprotoexterndef string:byte.datastringdb'hello world!', 0.codestart:invoke fnretendstart;-------------------fn.asm--------------------------.386.model stdcall, flatoption casemap:noneinclude msvcrt.incincludelib msvcrt.libexterndef string:byte.codefnprocinvoke crt_printf, offset stringretfnendpend#------------------makefile------------main.exe:main.obj fn.objlink /subsystem:console /nologo main.obj fn.obj.asm.obj:ml /c /coff /nologo {1}lt;clean:del *.obj
====================================================
dll模块中的数据调用:
include 保证编译时通过
includelib 保证链接时通过
dll文件 保证运行时正常
- 汇编语言多文件程序设计
- 汇编语言程序设计,文件操作管理
- 《汇编语言程序设计》
- 汇编语言程序设计
- 汇编语言程序设计
- 汇编语言程序设计
- 汇编语言程序设计
- 汇编语言程序设计
- 汇编语言程序设计
- 汇编语言程序设计
- Windows 环境下32位汇编语言程序设计 Makefile文件定义
- 汇编语言程序设计词汇表
- 汇编语言程序设计学习交流
- 汇编语言程序设计读书笔记
- 三章 汇编语言程序设计
- 汇编语言程序设计(一)
- 汇编语言程序设计(二)
- 汇编语言程序设计(三)
- Jsp概述
- Servlet应用---HttpServletRequest的应用
- JSP模式2 实现用户注册的功能
- JSP的开发模式和设计模式(MVC)
- JSP执行过程和隐式对象和错误机制
- 汇编语言多文件程序设计
- Web简介和Tomcat安装
- 配置WEB站点的虚拟目录
- HTTP协议与Servlet的应用
- 第四章 Http协议详解
- JSP动作元素详解
- ServletConfig和ServletContext
- XML-3
- Servlet的应用