English 中文(简体)
CNNM在UTF-8第1行的视窗错误中,没有任何内容:hello.asm:1:错误:教授
原标题:NASM on Windows errors on first line of UTF-8 source no matter what it is: hello.asm:1: error: parser: instruction expected

I m 试图利用MCMake生成的视力演播室视窗11项目与SNAM编辑组码。

页: 1

hello_world.asm:1: error: parser: instruction expected

我的《会议守则》(针对32-bitlav,而不是Windows):

section .text
   global _start    ; необходимо для линкера (ld)
    
_start:             ; сообщает линкеру стартовую точку
   mov  edx,len     ; длина строки 
   mov  ecx,msg     ; строка
   mov  ebx,1       ; дескриптор файла (stdout)
   mov  eax,4       ; номер системного вызова (sys_write)
   int  0x80        ; вызов ядра
    
   mov  eax,1       ; номер системного вызова (sys_exit)
   int  0x80        ; вызов ядра 
 
section .data
msg db  Hello, world! , 0xa  ; содержимое строки для вывода
len equ $ - msg              ; длина строки

我尝试利用所有可能的预兆(Debug/Release/x86/x64等),但至今没有结果。


我的NAM建筑为2.16.02rc6。 我要求另一名方案者为我制定这一法典,并配备了完全相同的参数,并建造了国家宇宙航行安全局,并为他工作。

即便是以下方案也无法集合起来,但与以前完全相同的错误。

section .text
global main
main:
    ret
问题回答

The assembly source file was encoded in UTF-8 with BOM.
NASM doesn t accept a BOM, only plain UTF-8 or ASCII.
(It does allow non-ASCII UTF-8 for things like label names and comments.)

将来源档案改写到ASCII解决了这一问题。





相关问题
Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Programmatically detect Windows cluster configuration?

Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...

get file icon for Outlook appointment (.msg)

I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...

Identifying idle state on a windows machine

I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签