引子
汇编程序运行需要什么
环境
安装
首先将 DosBox 和 Masm 下载下来
安装DosBox ,DosBox 就是运行汇编的环境
汇编是个比较古老的东西,Masm 需要在 DosBox上才能运行
所以用它来运行
然后 新建一个 汇编的工程目录 如 :
1 | e:/projects/asms/ |
这个目录以后专门放汇编的程序代码
将编译器放入 这个目录下面
1 | e:/projects/asms/masm |
如下
挂载
运行DosBox ,挂载asms 目录
1 | $ mount c e:/projects/asms |
这样就可以调用
1 | $ masm h.asm |
编译汇编程序 ,生成 h.obj 文件
1 | $ link h.obj |
链接obj文件生成EXE文件 h.obj
卸载
1 | $ mount -u c |
DosBox 自动挂载
DosBox 启动的时候 会有这样一段话
1 | DOSBox version 0.74 |
只需要修改配置就可以了
内容很多,只需要在最后加上一段就好了1
2
3
4
5
6
7
8
9
10
11
12
13...
[ipx]
# ipx: Enable ipx over UDP/IP emulation.
ipx=false
[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.
mount c e:/projects/asms
c: