为什么nasm中的构建汇编源在win 7中不起作用? [英] Why the build assembly source in nasm don't work in win 7?

查看:114
本文介绍了为什么nasm中的构建汇编源在win 7中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的朋友我构建了一个汇编源:

my friend i build a assembly source:

section	.text
    global _start   ;must be declared for linker (ld)
_start:	            ;tells linker entry point
    mov	edx,len     ;message length
    mov	ecx,msg     ;message to write
    mov	ebx,1       ;file descriptor (stdout)
    mov	eax,4       ;system call number (sys_write)
    int	0x80        ;call kernel
	
    mov	eax,1       ;system call number (sys_exit)
    int	0x80        ;call kernel

section	.data
msg db 'Hello, world!', 0xa  ;our dear string
len equ $ - msg     ;length of our dear string



用于构建我使用此命令行:

nasm -f bin index.asm -o hhh.com

i从此链接读取:

doc nasm
我点击它时建立的
:它有错误:请看图片:

图片

可以帮助我吗?

谢谢



< b>我尝试了什么:



i用命令行测试但是内置文件无法运行。

http:/ /www.mediafire.com/view/qoza9228exg9u1e/nasmerrrocombuilt.png#

我该怎么办?


for build it i uses this command line:
nasm -f bin index.asm -o hhh.com
i read it from this link:
doc nasm
it built when i click it :it has error:please see image:
image
can any help me?
thanks

What I have tried:

i tested with command line but built file couldn't run.
http://www.mediafire.com/view/qoza9228exg9u1e/nasmerrrocombuilt.png#
what should i do?

推荐答案

- msg;长度我们亲爱的字符串
- msg ;length of our dear string



用于构建我使用此命令行:

nasm -f bin index.asm -o hhh.com

i从以下链接读取:

doc nasm
当我点击它时它构建:它有错误:请看图像:

图片

可以帮到我吗?

谢谢



什么我试过了:



i用命令行测试但是内置文件无法运行。

http:// www。 mediafire.com/vi ew / qoza9228exg9u1e / nasmerrrocombuilt.png#

我该怎么办?


for build it i uses this command line:
nasm -f bin index.asm -o hhh.com
i read it from this link:
doc nasm
it built when i click it :it has error:please see image:
image
can any help me?
thanks

What I have tried:

i tested with command line but built file couldn't run.
http://www.mediafire.com/view/qoza9228exg9u1e/nasmerrrocombuilt.png#
what should i do?


你不能直接从汇编程序创建一个.com程序(包括源代码的事实)不支持它)。输出应该有.exe扩展名。
You cannot create a .com program directly from the assembler (including the fact that the source does not support it). The output should have a .exe extension.


我有一个愚蠢的错误!!

i完成回答我的朋友后认为我得出结论 int 0x80 不是在windows中,它应该是用于linux。

Richard MacCutchan非常感谢。

亲切的你的堆栈程序员
i had a silly wrong!!
i completed answer my friend after thinking i concluded that int 0x80 is not in windows, it should be for linux.
Richard MacCutchan thanks very much.
cordially your stackprogramer


这篇关于为什么nasm中的构建汇编源在win 7中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆