Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
For whatever reason, NASM is unable to guess the correct operand size for this instruction (even though the obvious choice here is dword). Add the "dword" keyword and the error will go away.
Do you really need to write this code in assembly? C and C++ both have built-in functionality for this kind of thing.
I have done this. However, I could never figure out if it is next to add the underscore before the name. (I know it’s a stupid question but might as well clear everything up)
It depends on your ABI. The System V ABI doesn't require it: symbols are the same in C and in assembly. The 32-bit Windows ABI does require it: symbols in C will have an extra underscore in assembly.