?
Solved

inline assembler & opcodes

Posted on 2002-04-16
1
Medium Priority
?
1,124 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 800 total points
ID: 6946081
void Test()
{
    __asm
    {

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

    }

}

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

850 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