Solved

inline assembler & opcodes

Posted on 2002-04-16
1
1,098 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now