assem
assem

Reputation: 3223

What's the syntax for this kind of declaration in MASM32?

szCaption db 'System Information', 0

I now understand such declarations:

var_name type default_value

Which has 3 parts. But what's the syntax for the declarations above?

Upvotes: 0

Views: 100

Answers (2)

jcomeau_ictx
jcomeau_ictx

Reputation: 38482

db actually stands for 'define bytes' and can accept as arguments quoted strings (single or double quotes) and numbers, separated by commas.

Upvotes: 0

Jonathan Wood
Jonathan Wood

Reputation: 67283

Actually, a better description is:

var_name type comma-separated list of values

In your example, each character in the string is a byte. And so is the trailing zero. MASM allows either characters or numbers.

Your example forms a null-terminated string.

Upvotes: 1

Related Questions