<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi all,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I'm writing a plugin which needs to read values contained in registers of an x86 architecture. In particular I need to access to 'AH' and 'AL' registers from a &quot;translate_insn&quot; callback correcly registered. If I access
 the registers through:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>#ifdef TARGET_I386<br>
CPUArchState * cpu = (CPUArchState*) env;<br>
target_ulong reg_ah = cpu-&gt;regs[R_AH];<br>
target_ulong reg_al = cpu-&gt;regs[R_AL];<br>
....<br>
#endif<br>
<br>
The problem is that if I print variables &quot;reg_ah&quot; and &quot;reg_al&quot; I always collect the same value for 'AH' and the same value for 'AL'. It is like if the plugin doesn't flush. So if the first read value is '0xabcd' for 'AH' all the following callbacks will print
 that register 'AH' contains '0xabcd'. <br>
In addition to this, it is strange (in my opinion) that if I do: <br>
<br>
printf(&quot;value of ah: &quot; TARGET_FMT_lx &quot;\n&quot;, cpu-&gt;regs[R_AH]);<br>
<br>
It prints a value which is bigger than an 8-bit number. Registers 'AH' and 'AL' have both size 8 bit , so I would expect that I can get 0xff at maximum. Maybe I must enable something to correctly access to registers?<br>
<br>
Thanks,<br>
<br>
elmanto<br>
<br>
</div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
</div>
</body>
</html>