NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: zev on November 11, 2012, 08:00:15 AM

Title: data error
Post by: zev on November 11, 2012, 08:00:15 AM
In section.data, the line: number db 7 dup 0 gives the error message:comma expected after operand 1. But, there is no operand. Why the error message?
Title: Re: data error
Post by: Frank Kotler on November 11, 2012, 09:02:29 AM
Nasm doesn't know "dup" - that's Masm/Tasm/Jwasm syntax. Try:
Code: [Select]
number times 7 db 0
Should give you the same effect.

Best,
Frank

Title: Re: data error
Post by: Gunner on November 11, 2012, 05:08:25 PM
you could and should put uninitialized data in the .bss section and do it this way:
Code: [Select]
section .bss
number    resb 7
Title: Re: data error
Post by: Bryant Keller on November 12, 2012, 01:07:15 AM
you could and should put uninitialized data in the .bss section and do it this way:
Code: [Select]
section .bss
number    resb 7

I'm afraid I don't understand your point here. Zed did initialize the data. That's why he was using the MASM directive dup(0) instead of dup(?).