0
votes

I have just started in nasm x86 Assembly and I just cannot figure out why I get this error:

main.asm:9: error: colon, comma, decorator, or end of line expected after operand

On this line:

mov [msg], db ‘Hello World’

Anyway thank you in advance!

You can't move a string into memory in one instruction. Are you trying to get msg to contain a pointer to the string, or are you trying to actually copy the string there? - Nate Eldredge
An assembler isn't a compiler: you can't just put arbitrary-length string literals wherever you want. The assembler won't invent anonymous space in .rodata for your string data and use its address in the immediate for that store instruction. Also, the operand-size is ambiguous; I hope you wanted to store a dword pointer to msg: resd 1 in the BSS (C equivalent char *msg;), not actually memcpy to a whole array. - Peter Cordes