The MASM Forum

General => The Campus => Topic started by: gelatine1 on April 22, 2014, 05:46:28 AM

Title: error A2206: missing operator in expression
Post by: gelatine1 on April 22, 2014, 05:46:28 AM
What is wrong with my code ? I am getting the error for the line 'integer db 0y01010101' where I am simply trying to define a binary number.
This is my code:

.386
.model flat, stdcall
option casemap :none

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib

.data
integer db 0y01010101
.code

start:

lea eax,integer
push eax
call StdOut

push 0
call ExitProcess

end start

Title: Re: error A2206: missing operator in expression
Post by: GoneFishing on April 22, 2014, 06:10:11 AM

.data
integer db 01010101b
Title: Re: error A2206: missing operator in expression
Post by: gelatine1 on April 22, 2014, 06:16:51 AM
http://msdn.microsoft.com/en-us/library/windows/hardware/ff552157(v=vs.85).aspx

According to that page i should use the 0y prefix and it doesnt even say anything about the b suffix. Why is that ? Is it only working for other assemblers ?
Title: Re: error A2206: missing operator in expression
Post by: GoneFishing on April 22, 2014, 06:22:18 AM
You're reading debugger reference
A few days ago qWord uploaded MASM reference . You may download it here (http://masm32.com/board/index.php?topic=3116.msg32323#msg32323).
Title: Re: error A2206: missing operator in expression
Post by: qWord on April 22, 2014, 06:32:48 AM
For MASM y and b can be used as suffix for binary numbers, whereas the first one is independent of the current radix setting.
e.g.: 101010y