An error "invalid combination of operands and opcodes"!!

This is a discussion on An error "invalid combination of operands and opcodes"!! within the C++ Programming forums, part of the General Programming Boards category; I am using Turbo c++ 3.0 , I tried out asm code within my c++ program. I have the following ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    6

    An error "invalid combination of operands and opcodes"!!

    I am using Turbo c++ 3.0 ,
    I tried out asm code within my c++ program.

    I have the following error on compilation.
    Please help

    "Invalid combination of operands and opcodes"

    I do not have a solution to it due to which my project is getting delayed.

    Please do help me. give me a possible solution.

    Thanks in advance!

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Obviously, the problem must be on line 42 (translation: post the offending code).
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    6
    Code:
    asm {
    	push    ds           // save DS
    	push    es           // save ES
    	lds     si, [ptr1]   // set SI to offset of sprite
    	mov     ax, X        // set AX equal to X
    	mov     bx, Y        // set BX equal to Y
      }
    The bolded line shows the error!!
    Please help..

    This code is a part of the function used to place custom fonts on the 13h mode screen.


    Sorry for not posting the code earlier , I thought it was a complaint of the c++ compiler.

  4. #4
    Registered User
    Join Date
    Oct 2005
    Posts
    6
    I got it solved
    I just changed the memory model to large and it got OK
    I am happy

    Thanks for the helping mentality...

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,341
    > I am using Turbo c++ 3.0 ,
    This is your first mistake

    > I tried out asm code within my c++ program.
    And this is your second mistake.

    > This code is a part of the function used to place custom fonts on the 13h mode screen.
    What is this? ancient history?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21