当前位置:网站首页>[summary of problem thinking] Why is the register reset performed in user mode?
[summary of problem thinking] Why is the register reset performed in user mode?
2022-07-01 06:15:00 【kev_ gogo】
Ask questions
When I saw this question in Wang daoshu , I first thought that there are many registers that are opaque , Therefore, the user mode cannot be operated , Can't even operate in the tube state , Based on this idea , I did some research .
reflection
After searching, we found , In fact, if you think of assembly On the level of ( But it's really hard for me, a non - major student, not to learn , Regrets that he is not proficient in learning ) It's a lot easier . Let's take the simplest example :int i=0, This code actually sets the value in a register to 0, This is obviously a very common operation , It is also completely unnecessary to enter the tube state , Therefore, it is in the user mode ( Eye state ) Conduct .
Extended thinking
C Language details
After thinking about it, I thought that all the setting variables are in registers ? But registers are limited , So the search found that C In this language, users can define register variables by themselves, such as :register int i=0, This format , And even if not , The compiler may also store variables in registers, because obviously for some variables, it can greatly improve the efficiency of the system ( For example, frequently used variables , Variables in the loop , Based on the principle of locality , This bracket is a personal guess ).
Register details
in addition , To verify that registers can store variables , I also think of the knowledge point of programmer transparency and programmer opacity , After consulting, it is found that , General purpose registers are opaque to assemblers , This also confirms the authenticity of the previous statement of assembly layer calling registers
Reference material
【1】http://www.cskaoyan.com/thread-7075-1-10.html
【2】https://blog.csdn.net/HumanpieceY/article/details/85917291
边栏推荐
- Flink practice -- multi stream merge
- Golang panic recover custom exception handling
- 【ManageEngine】如何实现网络自动化运维
- 扩散(多源广搜)
- Movable mechanical wall clock
- Factorial divisor (unique decomposition theorem)
- srpingboot security demo
- Freeswitch dial the extension number
- Transformer le village de tiantou en un village de betteraves sucrières
- π disk, turning your computer into a personal private cloud
猜你喜欢

Understanding of C manualresetevent class

Freeswitch dial the extension number

SystemVerilog learning-10-validation quantification and coverage

JDBC database operation

【ITSM】什么是ITSM,IT部门为什么需要ITSM

分布式锁实现

端口扫描工具对企业有什么帮助?

Cjc8988 Low Power Stereo codec with 2 stereo headphone drivers
![Pit of kotlin bit operation (bytes[i] and 0xff error)](/img/2c/de0608c29d8af558f6f8dab4eb7fd8.png)
Pit of kotlin bit operation (bytes[i] and 0xff error)

3D printer threading: five simple solutions
随机推荐
【ManageEngine卓豪】助力黄石爱康医院实现智能批量化网络设备配置管理
c# Xml帮助类
three. JS summary
Tidb database characteristics summary
连续四年入选Gartner魔力象限,ManageEngine卓豪是如何做到的?
可动的机械挂钟
HDU - 1501 Zipper(记忆化深搜)
【KV260】利用XADC生成芯片温度曲线图
【LeetCode】Day91-存在重复元素
Linux closes the redis process SYSTEMd+
利用百度地图查询全国地铁线路
What if the data in the cloud disk is harmonious?
pycharm 配置jupyter
Using Baidu map to query national subway lines
Elements of database ER diagram
DHT11 温湿度传感器
PLA not pasted on the bed: 6 simple solutions
ForkJoin和Stream流测试
jdbc-连接池
XAF Bo of dev XPO comparison