Ethan McTague
Ethan McTague

Reputation: 2358

"Comma expected after operand 1" when defining a series of bytes in NASM?

According to NASM's documentation, the following allows me to define 64,000 uninitialized bytes at the label Vid:

Vid resb 64000

According to subsequent documentation, this should allow me to initialize those bytes to 0xFF instead:

Vid db 64000 dup (FFh)

This, however, yields the error error: comma expected after operand 1.

I have also tried:

I cannot find anything online suggesting that this syntax has changed or that there are any cases where it should not work.

As important background, I am compiling to a bin file and have the cpu 8086 directive in my source.

Upvotes: 1

Views: 572

Answers (1)

hobbs
hobbs

Reputation: 239682

Converting comment to answer: DUP was only added to NASM with version 2.15 (released in June 2020). For compatibility with older versions, use TIMES, e.g. times 64000 db 0xff.

Upvotes: 3

Related Questions