| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Assembly Questions and Answers for Assembly here! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
emulating assembely commands in c++
Hi, I was wondering if anyone knows how to emulate assembly commands in c++.
Like for instance, there is the command LDA# which is load directly into the accumulator at whatever the address specified is. The only problem is i have no idea how to do this in c++. So what i need help with is taking the LDA# and recreating it in c++(or any other command for that matter). If anyone knows how to do this could you please help me out. Thanks |
|
#2
|
||||
|
||||
|
Re: emulating assembely commands in c++
The inline assembler depends on your compiler... On MSVC++ and on Borland C++ the __asm keyword is used to write inline assembler. On the Gnu Compiler systems the __asm__ keyword is used. Often in combintion with the volatile and the AT&T syntax.
Microsoft VC++ & Borland: Check out: http://msdn.microsoft.com/library/de...m/msmod_35.asp Code:
// Example of the __asm keyword
__asm // __asm block
{
mov eax, 01h
int 10h
}
__asm mov eax, 01h // Separate __asm lines
__asm int 10h
// Multiple __asm statements on a line
__asm mov eax, 01h __asm int 10h
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|