Solved

Random "Missing Operator In Expression" error

Posted on 2011-03-23
3
976 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
x86 instruction "rdtsc" doesn't work for ARM based cpu (iPhone) 7 3,162
Books on the Windbg debugger? 3 1,384
cmpl in assembly 5 1,386
how to solve the error 1935: 1 1,015
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scannerā€¦
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decadeā€¦

737 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