【发布时间】:2015-01-18 10:54:30
【问题描述】:
我目前无法让 NASM 正常工作。我必须为我在大学做的一个主题安装它。我安装了 Windows 8.1 Pro 64 位。我设法通过下载最新版本来安装 NASM。
我们的第一个任务是将代码复制到 Hello World 程序并使其运行。下面是代码:
bits 16
org 0x100 ; Start the program at offset 100h
jmp main ; Jump to main program
message: db 'Hello World', 0ah, 0dh, '$'
main: mov dx, message ; Start address of message
mov ah, 09 ; Prepare for screen display
int 21h ; DOS interrupt 21h
int 20h ; Terminate program
所以我将它保存为 prog1.asm 并使用我们的讲师给我们的批处理脚本来编译它。批处理脚本是这样的:
nasm -f bin %1.asm -o %1.com -l %1.lst
当我在 cmd 中输入 as prog1.asm 时,它编译时没有错误,尽管我在输入 prog1 以运行程序时,我在 cmd 窗口中收到以下错误:
This version of C:\Users\########\AppData\Local\nasm\prog1.com is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.
我真的不知道该怎么做,无论我尝试什么或谷歌,似乎都没有给我一个直接的答案或适当的解决方案。
【问题讨论】:
标签: windows cmd compatibility nasm