. : : Assembly Language : : .  |  首页  |  我提出的问题  |  我参与的问题  |  我的收藏  |  消息中心   |  游客  登录  | 
刷新 | 提问 | 未解决 | 已解决 | 精华区 | 搜索 |
  《汇编语言》论坛 ->第一个程序
  管理员: assembly   [回复本贴] [收藏本贴] [管理本贴] [关闭窗口]
主题 : :  第四章实验3的问题 Unable to open input file:  [待解决] 回复[ 7次 ]   点击[ 1615次 ]  
asongsky
[帖 主]   [ 发表时间:2009-07-14 13:36 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:0
注册日期:2009-07-10 14:13
按书本要求编写tl.asm,存放在c:\masm5\masm目录下(与masm.exe同一目录)
assume cs:codesg
codesg segment
mov ax,2000h
mov ss,ax
mov sp,0
add sp,10
pop ax
pop bx
push ax
push bx
pop ax
pop bx
mov ax,4c00h
int 21h
codesg ends
end
打开ms-dos,运行c:\masm5\masm tl
C:\DOCUME~1\ADMINI~1>c:\masm5\masm
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987.  All rights reserved.

Source filename [.ASM]: t1
Object filename [t1.OBJ]:
Source listing  [NUL.LST]:
Cross-reference [NUL.CRF]:
Unable to open input file: t1.ASM

C:\DOCUME~1\ADMINI~1>c:\masm5\masm
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987.  All rights reserved.

Source filename [.ASM]: c:\masm5\masm\t1.asm
Object filename [t1.OBJ]:
Source listing  [NUL.LST]:
Cross-reference [NUL.CRF]:
Unable to open input file: c:\masm5\masm\t1.asm
试了很多次,总是这样,根本打不开文件,不知道哪里错了,
asongsky
[第1楼]   [ 回复时间:2009-07-14 13:42 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:0
注册日期:2009-07-10 14:13
解决了,直接用masm.exe可以,用cmd打开的dos下使用masm就不行
mywiil
[第2楼]   [ 回复时间:2009-07-14 15:41 ]   [引用]   [回复]   [ top ] 
荣誉值:61
信誉值:4
注册日期:2008-10-14 16:29
直接进入到那个路径下在操作就行了,这么写一长串忒麻烦。
mrlee
[第3楼]   [ 回复时间:2009-07-17 11:26 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:4
注册日期:2009-07-14 10:39
解决了,直接用masm.exe可以,用cmd打开的dos下使用masm就不行
------------------
回复:我和你一样的问题。直接运行masm.exe进去编译可以,但是为什么用cmd打开的dos下使用masm进行编译就会出现:'Unable to open input file: t1.ASM '。的问题呢?
希望知道的朋友帮忙解答一下,谢谢!
mrlee
[第4楼]   [ 回复时间:2009-07-17 15:15 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:4
注册日期:2009-07-14 10:39
回复:[第3楼]
------------------
呵呵,弄明白了。是文件路径的问题,2楼mywill说的对。
回答楼主:
你可以进入DOS后运行:cd c:\masm5 (这系统会把c:\masm5作为默认工作路径)
然后你在运行:
c:\masm5> masm  
Source filename [.ASM]: t1
Object filename [t1.OBJ]: 
Source listing  [NUL.LST]: 
Cross-reference [NUL.CRF]: 
应该没问题了。
当然不改默认路径也可以,但需要指明文件所在路径。
楼主运行第一次失败原因:没有指明源文件t1的路径
C:\DOCUME~1\ADMINI~1>c:\masm5\masm 
Source filename [.ASM]: c:\masm5\t1
Object filename [t1.OBJ]: c:\masm5\ (不写'c:\masm5\'的话object默认生成后在C:\DOCUME~1      \ADMINI~1下)
Source listing  [NUL.LST]: 
Cross-reference [NUL.CRF]: 
楼主运行第二次失败原因:源文件t1的路径错误:
应该是Source filename [.ASM]: c:\masm5\t1.asm ,不是Source filename [.ASM]: c:\masm5\masm\t1.asm 
从启动MASM.exe命令:C:\DOCUME~1\ADMINI~1>c:\masm5\masm ,可以看出来MASM.exe在c:\masm5这个目录下你问题开头说:tl.asm与masm.exe同一目录下。
szqh97
[第5楼]   [ 回复时间:2009-08-08 19:18 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:0
注册日期:2009-08-06 20:22
设置一下路径就好了。
example123
[第6楼]   [ 回复时间:2012-09-02 21:36 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:0
注册日期:2012-08-24 22:39
看到这里的回答,问题迎刃而解了!
直接运行masm.exe 不需要设置默认路径但是 命令提示符窗口一闪过,
先运行 cmd 然后进入 1.asm的默认路径  再运行masm.exe 就可以了
ztylxy123
[第7楼]   [ 回复时间:2014-02-05 23:07 ]   [引用]   [回复]   [ top ] 
荣誉值:0
信誉值:0
注册日期:2014-01-31 11:09
我爱你们 我爱论坛 太好了!
需要登录后才能回帖 -->> 请单击此处登录
    Copyright © 2006-2024   ASMEDU.NET  All Rights Reserved