![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-10-31 14:04 |
共 47,815 主题排行 / 349,930 发帖 / 今日 0 篇 / 48,290 会员排行 |
| DOS开发编程 & 发展交流 (开发室) » 8088 汇编语言编写的程序 |
| 可打印版本 1,540 / 7 |
| 第1楼 xiaohanchou | 发表于 2008-01-14 10:28 |
| 社区乞丐 发帖 5 积分 -16 | |
|
8088 汇编语言编写的程序 我这有一个用汇编语言写的程序,用批处理将各.ASM文件链接处理后生成的.exe文件,却不知道怎样将其生成.bin文件,以用于烧录到程序片中。用exe2bin.exe时提示内存不够,生成的.exe文件大小为74KB左右。
急切求购相应软件!谢谢! |
|
| 第2楼 bobo98 | 发表于 2008-01-16 17:05 |
| 初级用户 发帖 20 积分 43 | |
|
要生成BIN是需要一定的格式的,不是任意一个EXE文件就能转换.
|
|
| 第3楼 bobo98 | 发表于 2008-01-16 17:06 |
| 初级用户 发帖 20 积分 43 | |
|
如果仅是要烧到光盘上,就EXE也行啊,使用NERO就OK了.
|
|
| 第4楼 xiaohanchou | 发表于 2008-01-17 14:54 |
| 社区乞丐 发帖 5 积分 -16 | |
|
关于格式 你好bobo98:
请问你说的格式是怎样的,我要将最终的二进制文件烧录到程序片ROM中,供仪器使用。不是要烧录到光盘。我知道转换格式前的EXE文件大小不能超过74KB ,而且,其中不能有堆栈段。但源程序应该是没问题的,所以,想弄明白用什么软件可以将源程序转换成64KB大小的BIN文件。谢谢指教! |
|
| 第5楼 bobo98 | 发表于 2008-01-17 19:11 |
| 初级用户 发帖 20 积分 43 | |
|
如果你的程序确定没有问题,刚才看了你另开的一个贴子,提到程序由多个文件构成,
如果这些文件的结构同要求的格式没有出入的话,编译连接应该挺容易的,没有什么 大的问题.对了,你要生成了BIN文件,就是不能重载的文件.启动地址是,硬件上电时 行的那个位置. |
|
| 第6楼 everdos | 发表于 2008-01-17 22:19 |
| 初级用户 发帖 21 积分 52 | |
|
这是微软网站上的一段,说明了MASM如何生成.COM文件而不是.EXE文件:
MASM version 6.0 is the first version of the assembler to support the tiny model. Use the following steps the produce a .com file in MASM 6.0. 1. Use .model tiny. Declare logical segments using the simplified segment directives or full segment declarations. -or- Do not use the .model directive and assemble with /AT. Use full segment declarations. 2. Make sure that the first statement in the the code segment is ORG 100h. 3. Build the .com file. Compiling and linking in one step: If .model tiny was used, no options are needed. The linker will automatically receive the /TINY switch, the file extension on the file produced will be .com, and the executable is indeed a .com file. -or- Performing a separate link: Specify the /TINY option on the link command line. The linker will issue the following harmless warning L4045: name of output file is 'filename' where 'filename' will have a .com extension. 这是有人解决类似问题的方法: 1. Generate the needed EXE (for example, BIOS.EXE) 2. load it into debug: DEBUG BIOS.EXE 3. first of all, rename the file: N BIOS.BIN 4. set the length of the file to save into the BX:CX register pair: r bx 0 (<--- HIGH word; I assume it is not bigger than 64 KB, is it?) r cx xxxx (<--- LOW word) 5. Now, save the file to disc: W CS:0000 ---->要用r先看一下程序入口确实是cs:0才行 如果你的代码确实大于64K,第一种方法显示是不行了。 第二种方法可以写出大于64k的代码: (1)必须确保程序入口是cs:0 (2)第四步不要修改bx和cx。如果纯粹为了得到小于64k的代码而将bx置零,是没有意义的,得到的代码估计不能正确执行。 如果你的代码确实大于64k,而你的片子不能超过64k,那就没有办法了。 |
|
| 第7楼 xiaohanchou | 发表于 2008-01-21 15:32 |
| 社区乞丐 发帖 5 积分 -16 | |
|
非常感谢 非常感谢二位的回帖,这两天一直在忙,没时间上来看看。所以回帖慢了点,还望二位见谅。对于二位的帮助,十分感激与感谢。谢谢!
|
|
| 第8楼 kawaguchi | 发表于 2008-02-13 12:48 |
| 初级用户 发帖 32 积分 67 来自 日本の江户 | |
|
用NASM可以生成Bin文件,命令格式:
NASM XXXX.ASM -O XXXX.BIN |
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |