Solved

inline assembler & opcodes

Posted on 2002-04-16
1
1,104 Views
Last Modified: 2012-06-27
my assembler reference tells me, that the line

db 8Eh, 0D8h

should resemble

mov ds, ax

...the problem: the VC++ inline assembler doesn't accept this line...
If I change it to

db 0x8Eh, 0xD8h

or

db 0x8ED8

it still doesn't work...Error:

E:\cpp\myProject\source.cpp(211) : error C2400: inline assembler syntax error in 'opcode'; found 'constant'

So: how do I user opcodes in VC++ inline assembler ?

thx a lot :)

Ben Utzer
0
Comment
Question by:benutzername
1 Comment
 
LVL 6

Accepted Solution

by:
thienpnguyen earned 200 total points
ID: 6946081
void Test()
{
    __asm
    {

        // first way
        mov  ds, ax
       
        // second way
        _emit  0x8E
        _emit  0xD8

    }

}

0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

803 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