错误提示no program entry point

lyl_98 2009-08-26 12:01:55
觉得汇编语言是一个好东西,听说 王爽 的《汇编语言》不错,就买来,看了一下,
看起来,非常容易理解,感觉还不错。
今天,刚学到“第一个程序”,写了下面的一段代码
assume cs:codesg
codesg segment
mov ax,0123h
mov bx,0456h
add ax,bx
add ax,bx

mov ax,4c00h
int 21h
codesg ends
end
使用TASM5,编译,正常生成.obj文件,tlink时,出现了
Invalid keyboard code specified
Turbo Link Version 7.1.30.1. Copyright (c) 1987, 1996 Borland International
Fatal: No program entry point
不知道应该怎办才好了。小弟,刚开始学习汇编,还请各位多多指点!
...全文
549 13 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
qb_2008 2009-08-30
  • 打赏
  • 举报
回复
众人拾柴那个火焰高
xiaopoy 2009-08-26
  • 打赏
  • 举报
回复
没有 start标号

assume cs:codesg
codesg segment
start:
mov ax,0123h
mov bx,0456h
add ax,bx
add ax,bx

mov ax,4c00h
int 21h
codesg ends
end
lyl_98 2009-08-26
  • 打赏
  • 举报
回复
start记得以前学习的时候,好像用过,不过,记不清楚了。
还是要谢谢各位的回答,
晚上回家试试,实在不行,从网上找一个SAMPLE试一试吧。。。

不顺利的开始,是成功的一大半。
lyl_98 2009-08-26
  • 打赏
  • 举报
回复
谢谢各位的帮助,OK了
cnzdgs 2009-08-26
  • 打赏
  • 举报
回复
一个源文件中只需要在最后写一个END,END之后的代码不被汇编。把END START改到最后,另一个END去掉。
BAYNPU 2009-08-26
  • 打赏
  • 举报
回复
汇编后没有警告和错误提示:
E:\TASM\BIN>tasm b62.asm
Turbo Assembler Version 4.1 Copyright (c) 1988, 1996 Borland International

Assembling file: b62.asm
Error messages: None
Warning messages: None
Passes: 1
Remaining memory: 453k


E:\TASM\BIN>tlink b62.obj
Turbo Link Version 7.1.30.1. Copyright (c) 1987, 1996 Borland International
Warning: No stack

E:\TASM\BIN>
BAYNPU 2009-08-26
  • 打赏
  • 举报
回复
assume cs:codesg
codesg segment
start:
mov ax,0123h
mov bx,0456h
add ax,bx
add ax,bx
mov ax,4c00h
int 21h
codesg ends
end start
lyl_98 2009-08-26
  • 打赏
  • 举报
回复
经过自己的验证,下面的代码应该是没有问题的
assume cs:codesg
codesg segment
start:
mov ax,0123h
mov bx,0456h
add ax,bx
add ax,bx

mov ax,4c00h
int 21h
end start
codesg ends
end
但是,TASM是有下面的警告,不是可否忽略。。。。
Invalid keyboard code specified
Turbo Assembler Version 4.1 Copyright (c) 1988, 1996 Borland International

Assembling file: D:\tasm5\src\a.asm to a.OBJ
*Warning* D:\tasm5\src\a.asm(11) Open segment: CODESG
Error messages: None
Warning messages: 1
Passes: 1
Remaining memory: 451k
djking1986 2009-08-26
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 baynpu 的回复:]
换个汇编编译器MASM5.0版本就可以了。
[/Quote]
在MASM5.0下是可以不写入口start的
gzgzlxg 2009-08-26
  • 打赏
  • 举报
回复
最后的那个end的格式是

end "xxxx"

其中 xxxx 是你准备首先执行的初始化代码,随便叫什么名字都可以,一般习惯上使用 start,也有许多人用c带过来的main,都无所谓啦。
BAYNPU 2009-08-26
  • 打赏
  • 举报
回复
换个汇编编译器MASM5.0版本就可以了。
ahjoe 2009-08-26
  • 打赏
  • 举报
回复
开始的地方加 start:

结束写 end start
kaifaye 2009-08-26
  • 打赏
  • 举报
回复
提示:没有程序入口点

就是没写start
Installing c++/g++ on Windows Disclaimer: This page is being maintained mainly for my students. Use these instructions at your own risk. There is no warranty in any form or shape whatsoever!. There is no guarantee that these instructions are up-to-date. With that understood you may continue with the rest of this page if you choose to accept these terms. This page was last updated on September 13, 2005, but still good as of April 30, 2009. Follow these steps to install g++ (the GNU C++ compiler) for Windows. There is no room for creativity here; you must follow the directions exactly. Pick the drive and a folder in which you want to install g++. I'll assume that it is C:, but you can choose a different one. If you choose a different drive or a different folder, you'll need to adapt the directions below accordingly. Download full.exe, an about 14 megabyte executable, to C:\full.exe by right-clicking on the link. Use Save Link As... or Save Target As... Be sure the browser saves the file as C:\full.exe. Run the downloaded executable. This will install g++ (and a lot of other things that you don't really need) on your hard drive. Go to the C: drive using Windows Explorer and double-click on full.exe. Or, open a DOS window (Start > Programs > Command Prompt), connect to the C: drive using the cd command, and type full. Locate where the bin folder was created for the g++ installation. On my Windows XP machine, it was created in the following path: C:\cygnus\cygwin-b20\H-i586-cygwin32\bin You now should add it to the PATH environment variable. You do that by following: Start -> Control Panel -> System -> Advanced -> Environment Variables At this point you can see the PATH variable either in the User Variables or in the System Variables. Add the g++ path into the PATH variable. You add it to the end of the existing value separated by a semicolon (';'). Make sure that you do not lose the original value. You are just appending more to the end separated by a semicolon. Restart your computer. A Cygnus Solutions entry will appear in your Programs menu, and an icon may appear on your desktop. Don't use them! You will use it using the g++ command on a DOS prompt as explained below. You should now be able to run g++ from a DOS (Command Prompt) window. For example, to compile a file called C:\mine\hello.cpp, connect to the C:\mine folder and enter g++ -g hello.cpp -o hello -lm You'll then be able to run the compiled program by entering hello in the DOS window. If you've installed Emacs as described here, you will also be able to run g++ from Emacs. If, when you do this, Emacs tries to compile with the command make -k, you made a mistake during the Emacs installation. If you want to learn how to run g++ on emacs, see here. If you'd like to learn more about where this free compiler came from, we downloaded it from an older site of http://sourceware.org/cygwin/. If you wish to clean up a little, you may delete the file: full.exe at this point. Your g++ compiler is installed under C:\cygnus.

21,497

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧