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

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

mcoyleAsked:
Who is Participating?
 
RONSLOWConnect With a Mentor Commented:
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
All Courses

From novice to tech pro — start learning today.