Thread: assembler

  1. #16
    essence of digital xddxogm3's Avatar
    Join Date
    Sep 2003
    another question on assembly.
    i'm having problems with inline assembly.
    assignment.cpp(27) : error C2443: operand size conflict
    assignment.cpp(28) : error C2443: operand size conflict
    assignment.cpp(29) : error C2443: operand size conflict
    my code is the following
    using namespace std;
    int sum(int a,int b);
    int main()
    	int a=0,b=0,num=0;
    	cout<<"enter integer";
    	cout<<"enter integer";
    	num = sum(a,b);
    	cout << num;
    	return 1;
    int sum(int a, int b)
    	int n=0;
    //it doesn't like my inline block here
    //i'm assuming it means that the integers a, b, n differ in size from the ah register. 
    //how would i fix this? cast?
    			mov ah, a 
    			add ah, b
    			mov n, ah
    	return n;
    So, I figured it out. I used short instead of int, and it worked.
    Last edited by xddxogm3; 11-28-2005 at 09:01 PM.
    "Hence to fight and conquer in all your battles is not supreme excellence;
    supreme excellence consists in breaking the enemy's resistance without fighting."
    Art of War Sun Tzu

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. Assembler in GCC
    By Magos in forum Linux Programming
    Replies: 4
    Last Post: 11-05-2002, 03:22 PM
  3. assembler and linker stuff...question
    By dirkduck in forum A Brief History of
    Replies: 2
    Last Post: 12-16-2001, 11:10 PM
  4. MAINFRAME Assembler.
    By sean in forum A Brief History of
    Replies: 3
    Last Post: 12-05-2001, 04:32 PM
  5. interfacing assembler with c++
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 10-24-2001, 12:13 AM