Solved

Random "Missing Operator In Expression" error

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
can't compile my source code with vbc.exe 3 925
Assemlby_ARM 3 504
Address Range Confusion??? 4 372
Session arrays 10 358
In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now