Solved

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

Posted on 1998-04-22
1
394 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

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 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 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…

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

23 Experts available now in Live!

Get 1:1 Help Now