如何访问处理器寄存器 [英] How to access processor registers

查看:152
本文介绍了如何访问处理器寄存器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一般来说,如何读取CPU寄存器的内容以及如何获取CPU寄存器的地址?

解决方案

dspfun写道:


一般来说,你如何阅读CPU的内容'' s寄存器以及如何获取CPU寄存器的地址?



没有一般的答案。没有多少处理器有寄存器可以对内存进行映射。


大多数编译器都提供了嵌入汇编语言的方法,但是你会用

必须询问编译器和平台特定组。


-

Ian Collins。


" dspfun" < ds **** @ hotmail.comwrites:


一般来说,你如何读取CPU寄存器的内容以及如何操作

你得到了CPU寄存器的地址吗?



C并没有提供任何便携式方法来做任何一个。我会

建议你在专门讨论你的特定C $ / $
实施的论坛上寻求帮助。


另外:on大多数CPU,寄存器没有地址。

-

Comp-sci博士预计在2007年底之前

寻求工业或学术职位* 2008年加州*之外


dspfun写道,在31/03/07 22:57:


一般来说,你如何读取CPU寄存器的内容



上次我做了它我使用的是在线仿真器


以及如何获得CPU的寄存器地址?



是什么让你觉得他们有地址?


另外,是什么让你认为这是一个C问题? />
-

Flash Gordon


In general, how do you read contents of the CPU''s registers and how do
you get hold of the addresses of the CPU''s registers?

解决方案

dspfun wrote:

In general, how do you read contents of the CPU''s registers and how do
you get hold of the addresses of the CPU''s registers?

There isn''t a general answer. Not many processors have registers that
can be memory mapped.

Most compilers provide a means to embed assembly language, but you will
have to ask on a compiler and platform specific group.

--
Ian Collins.


"dspfun" <ds****@hotmail.comwrites:

In general, how do you read contents of the CPU''s registers and how do
you get hold of the addresses of the CPU''s registers?

C doesn''t provide any portable means to do either one. I''d
advise you to seek help in a forum dedicated to your particular C
implementation.

Also: on most CPUs, the registers do not have addresses.
--
Comp-sci PhD expected before end of 2007
Seeking industrial or academic position *outside California* in 2008


dspfun wrote, On 31/03/07 22:57:

In general, how do you read contents of the CPU''s registers

Last time I did it I used an In-Circuit Emulator

and how do
you get hold of the addresses of the CPU''s registers?

What makes you think they have addresses?

Also, what makes you think this is a C question?
--
Flash Gordon


这篇关于如何访问处理器寄存器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆