我想链接一些程序集文件,但我遇到了一些问题。我使用NASM,我让我的对象文件与:在DOSBox上NASM编译
nasm program.asm -f bin -o program.exe
代码从本书
%include "io.mac"
.DATA
name_prompt db "Please type your name: ",0
out_msg db "Your name in capitals is: ",0
.UDATA
in_name resb 31
.CODE
.STARTUP
PutStr name_prompt ; request character string
GetStr in_name,31 ; read input character string
PutStr out_msg
mov EBX,in_name ; EBX = pointer to in_name
process_char:
mov AL,[EBX] ; move the char. to AL
cmp AL,0 ; if it is the NULL character
je done ; conversion done
cmp AL,’a’ ; if (char < ’a’)
jl not_lower_case ; not a lowercase letter
cmp AL,’z’ ; if (char > ’z’)
jg not_lower_case ; not a lowercase letter
lower_case:
add AL,’A’-’a’ ; convert to uppercase
not_lower_case:
PutCh AL ; write the character
inc EBX ; EBX points to the next char.
jmp process_char ; go back to process next char.
done:
nwln
.EXIT
这对我的代码工作在Windows XP中,但在Windows 7中无法正常工作,这里是错误日志 error。请帮我找到错误。
那些引号看起来很可疑。他们应该是'''而不是'''。并确保汇编程序找到宏文件。 – Michael
io.mac位于nasm和program.asm文件中,但我不知道如何检查汇编程序是否找到此文件。 – Damian