Solved

Random "Missing Operator In Expression" error

Posted on 2011-03-23
3
921 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
  • 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
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…

770 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