I am writing a program that performs a NOR function and i keep getting this error I cant figure it out!

1>z:\assembly\p2a\p2b\p2b\p2b\p2b.cpp(28) : error C2443: operand size conflict
1>z:\assembly\p2a\p2b\p2b\p2b\p2b.cpp(29) : error C2443: operand size conflict
1>z:\assembly\p2a\p2b\p2b\p2b\p2b.cpp(30) : error C2443: operand size conflict
1>z:\assembly\p2a\p2b\p2b\p2b\p2b.cpp(31) : error C2443: operand size conflict
1>z:\assembly\p2a\p2b\p2b\p2b\p2b.cpp(33) : error C2443: operand size conflict
1>Build log was saved at "file://z:\Assembly\P2a\P2b\P2b\P2b\Debug\BuildLog.htm"
1>P2b - 5 error(s), 0 warning(s)

// Matthew Tye
// 101 36 654
// This program creates a NOR function
// FFFFFFFF44400002

#include "stdafx.h"
#include <iostream>

using namespace std;

int main(int argc, char* argv[])
//  your properly formatted assembly language data here
	double num1 = 0x22334455;
	double num2 = 0x11223344;
	double num3 = 0x12345678;
	double num4 = 0x88888888;
	double result = 0;

        __asm {
//  your syntatically correct assembly language code here
//  column alignment markers below (to guide you)
//      |       |                |

		mov     eax,num1          ;get first number
		or		eax,num2		  ;perform or on number
		or		eax,num3		  ;perform or on number	
		or      eax,num4          ;perform or on number
		not		eax				  ;perform not operation
		mov		result,eax		  ;store result


9 Years
Discussion Span
Last Post by matt999tye

You should be using unsigned long, not double.

In either case, VC++ could have a problem correctly identifying the size of the operand inside the __asm block. I don't know enough about VC++ __asm to be sure, though...

It might be worth pointing your professor to MASM32.

Hope this helps.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.