Solved

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

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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 …
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 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.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

776 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