Solved

Accessing registers (ax, etc.) thru C/C++ variables

Posted on 1998-04-22
1
393 Views
Last Modified: 2012-06-21
How do you assign the value of a register, at any given time, to a variable.  In particular, I would like to do something like this (I know it's a crude example):

int blah;
 asm
  {
      :
   mov ax, some_value
      :
  }
blah=ax;  //blah now equals some_value

0
Comment
Question by:mcoyle
1 Comment
 
LVL 10

Accepted Solution

by:
RONSLOW earned 50 total points
ID: 1163160
you should be able to put
  mov blah,ax
into your asm block

Of course asm (or __asm) etc is all compiler/platform specific.

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Implementing a ResolveEventHandler in C++ 13 103
Grammars for C C++ and java 1 108
Unresolved External Symbols 3 55
Dialogbox API leak? 18 62
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

746 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

12 Experts available now in Live!

Get 1:1 Help Now