This sentence is hard to understand: "When I try to run a .nes rom compiled without -raw nesasm option, it works perfectly, but when I don´t use that option I get an error." So... it works perfectly without -raw, but when you don't use -raw, it fails. How would it work perfectly then? :/
So let's just stick with the documentation. Assuming this is NESASM 3.0 or 3.1 (and not 2.x) -- because you didn't specify:
the documentation is clear about what the
-raw flag does:
Code:
-raw Control the header generation. By default the assembler
always adds an header to the ROM file; unless '-raw' is
specified, in this case no ROM header is generated.
"Header" in this case refers to the necessary
16-byte NES header (i.e.
.nes file extension). This is necessary when used with emulators, for loading via the PowerPak, and so on.
If your code is generating the 16-byte header itself, then you need to use
-raw (otherwise you will end up with two 16-byte headers and your code/game will probably crash upon load).
If your code is not generating the 16-byte header itself, then you should not use
-raw (otherwise you will end up with a raw binary file that lacks the header; this would be used if you were to, say, be flashing your assembled code onto an EPROM/EEPROM).