Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error using a string as a macro argument in WASM #1271

Open
pts opened this issue Apr 12, 2024 · 1 comment
Open

error using a string as a macro argument in WASM #1271

pts opened this issue Apr 12, 2024 · 1 comment

Comments

@pts
Copy link

pts commented Apr 12, 2024

.model tiny
.code
foo macro arg
  db arg
endm
foo 42
foo 'bar'  ; From here: Error! E050: Offset cannot be smaller than WORD size       
end
$ wasm test.asm
Open Watcom Assembler Version 2.0 beta Mar  4 2023 00:50:30 (32-bit)
Copyright (c) 2002-2023 The Open Watcom Contributors. All Rights Reserved.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
test.asm(4): Error! E050: Offset cannot be smaller than WORD size
test.asm(4): Note! N291: macro called from file test.asm(7)
test.asm: 8 lines, 0 warnings, 1 errors

MASM and other assemblers can compile this file successfully. WASM reports an error. Am I using it correctly, or is this a bug?

@Baron-von-Riedesel
Copy link

Am I using it correctly, or is this a bug?

It's not a bug, just .... "lacking documentation". Seriously, Wasm's macro engine is not very smart and, IIRC, the first thing what's done with macro arguments is to remove single/double quotes. It also won't help to enclose the macro argument in angle brackets (<>),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants