无法编译 .asm 文件
Unable to compile .asm file
我尝试使用此命令在 Linux 终端中使用 NASM 代码编译文件:
$ nasm -f elf /path/to/file.asm
我有一个错误。首先,我在文件中遇到了这个问题,我将格式更改为 .asm,但它没有帮助。
然后我从维基百科更改代码和过去的程序但仍然不起作用。
这是错误:
nasm: fatal: unable to open output file /home/path/to/file.o'`
这是代码:
section .text
org 0x100
mov ah, 0x9
mov dx, hello
int 0x21
mov ax, 0x4c00
int 0x21
section .data
hello: db 'Hello, world!', 13, 10, '$'
当然这不是汇编问题,但也肯定有帮助。
也许,您的用户名为 staslend
。
如果 programs_for_trying
是一个文件,
ls -lha /home/staslend/programs_for_trying
returns
drwxrwxr--
权利。
mv /home/staslend/programs_for_trying /home/staslend/tempfile
mkdir /home/staslend/programs_for_trying
cat tempfile
您看到了文件的内容。我认为您在此文件中有来源。如果是这样,请执行下一步:
mv /home/staslend/tempfile /home/staslend/programs_for_trying/file.asm
使您成为目录及其内容的所有者:
$ sudo chown -R staslend /home/staslend/programs_for_trying/
让您和您的小组能够阅读、重命名和写入内容:
$ chmod -R ug+rwx /home/staslend/programs_for_trying/
让每个人都能阅读内容:
$ chmod -R a+r /home/staslend/programs_for_trying/
我尝试使用此命令在 Linux 终端中使用 NASM 代码编译文件:
$ nasm -f elf /path/to/file.asm
我有一个错误。首先,我在文件中遇到了这个问题,我将格式更改为 .asm,但它没有帮助。 然后我从维基百科更改代码和过去的程序但仍然不起作用。 这是错误:
nasm: fatal: unable to open output file /home/path/to/file.o'`
这是代码:
section .text
org 0x100
mov ah, 0x9
mov dx, hello
int 0x21
mov ax, 0x4c00
int 0x21
section .data
hello: db 'Hello, world!', 13, 10, '$'
当然这不是汇编问题,但也肯定有帮助。
也许,您的用户名为 staslend
。
如果 programs_for_trying
是一个文件,
ls -lha /home/staslend/programs_for_trying
returns
drwxrwxr--
权利。
mv /home/staslend/programs_for_trying /home/staslend/tempfile
mkdir /home/staslend/programs_for_trying
cat tempfile
您看到了文件的内容。我认为您在此文件中有来源。如果是这样,请执行下一步:
mv /home/staslend/tempfile /home/staslend/programs_for_trying/file.asm
使您成为目录及其内容的所有者:
$ sudo chown -R staslend /home/staslend/programs_for_trying/
让您和您的小组能够阅读、重命名和写入内容:
$ chmod -R ug+rwx /home/staslend/programs_for_trying/
让每个人都能阅读内容:
$ chmod -R a+r /home/staslend/programs_for_trying/