Solved

Random "Missing Operator In Expression" error

Posted on 2011-03-23
3
947 Views
Last Modified: 2012-05-11
I'm converting a C++ function with a huge _asm block into pure assymbly code.  

I have a huge .data section that defines all my constant array values (basically a bunch of lookup tables).

I've been able to get all the code in the .code section to compile, but I'm getting the following error multiple times in the .data section where there is not any syntax error:

"error A2206: missing operator in expression"

Interestingly enough, If I cause a syntax error somewhere in the .code section, the syntax error in the code is reported before the above error in the .data.

The problem doesn't seem to be associated with the syntax of my .data section because if I rearange the order of the tables, the starting location of the error changes with no apparent rhyme or reason.

Shown below is an example of how I'm defining these lookup tables.
.data

eolmasks	DWORD 0x000000FF, 0x00000080, 0x000000C0, 0x000000E0, 0x000000F0, 0x000000F8, 0x000000FC, 0x000000FE

pass_maskw	DWORD 0xFFFFFF7F, 0xFFFFFF3F, 0xFFFFFF1F, 0xFFFFFF0F
            DWORD 0xFFFFFF07, 0xFFFFFF03, 0xFFFFFF01, 0xFFFFFF00
            DWORD 0xFFFF7F00, 0xFFFF3F00, 0xFFFF1F00, 0xFFFF0F00
            DWORD 0xFFFF0700, 0xFFFF0300, 0xFFFF0100, 0xFFFF0000
            DWORD 0xFF7F0000, 0xFF3F0000, 0xFF1F0000, 0xFF0F0000
            DWORD 0xFF070000, 0xFF030000, 0xFF010000, 0xFF000000
            DWORD 0x7F000000, 0x3F000000, 0x1F000000, 0x0F000000
            DWORD 0x07000000, 0x03000000, 0x01000000, 0x00000000

pass_maskb	DWORD 0x00000080, 0x000000C0, 0x000000E0, 0x000000F0
            DWORD 0x000000F8, 0x000000FC, 0x000000FE, 0x000000FF
            DWORD 0x000080FF, 0x0000C0FF, 0x0000E0FF, 0x0000F0FF
            DWORD 0x0000F8FF, 0x0000FCFF, 0x0000FEFF, 0x0000FFFF
            DWORD 0x0080FFFF, 0x00C0FFFF, 0x00E0FFFF, 0x00F0FFFF
            DWORD 0x00F8FFFF, 0x00FCFFFF, 0x00FEFFFF, 0x00FFFFFF
            DWORD 0x80FFFFFF, 0xC0FFFFFF, 0xE0FFFFFF, 0xF0FFFFFF
            DWORD 0xF8FFFFFF, 0xFCFFFFFF, 0xFEFFFFFF, 0xFFFFFFFF

Open in new window

0
Comment
Question by:HooKooDooKu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
kbens0n earned 500 total points
ID: 35203391
You're probaly not intending to using the hexadecimal notation of C/C++ (where hexadecimal numbers are written as 0x000000FF). In Intel-derived assembly languages, hexadecimal is denoted with a suffixed H or h (FFh).
0
 
LVL 16

Author Closing Comment

by:HooKooDooKu
ID: 35207821
That was it...

The way I was moving code arround, the error didn't simply follow and therefore I never though it was the syntax of the numbers themselves.

But once I got rid of ALL the 0xFF style constants, the errors went away.
0
 
LVL 6

Expert Comment

by:kbens0n
ID: 35208194
Totally understand. One of the gotchas we all experience. Glad you're moving forward. Thanks very much !
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After-hours service is a fact of life for most MSPs. While not the most pleasant aspect of the job, there are ways to make after-hours servicing a more profitable and organized enterprise.
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question