当前位置:网站首页>Compile advanced notes
Compile advanced notes
2022-07-07 14:53:00 【weixin_ forty-five million seven hundred and fifty thousand fou】
1、 Pressing stack and elastic stack Is a very important machine operation :
The characteristics of the stack : Grow down , The stack top address is the smallest ;
Stack pressing is 1) Open the drawer (esp Reduce the number of bytes of data to be pressed )2) Put in the data ( high
Put bit data into high address , Put the low order data into the low address ).
The bomb stack is :1) Take out the data ( The number of bytes depends on pop Suffix or destination register , meanwhile
The high address data is put into the high order of the destination register );2) Close the drawer (esp Increase the number of corresponding bytes )
2、 Basic and special operations Operation instructions need to remember the name and specific operation , Especially the sequence of operations ( For example, subtraction is subtracting the front from the back , Put the results in the back );
3、 The four most important Condition code :
1)CF: Think of operations as “ Unsigned number operation ”, If there is progress / Borrow position , Then put 1;
2)OF: Think of operations as “ Signed number operation ”, If overflow occurs , Then put 1;
3)SF: If the highest order of the result is 1, Then put 1;
4)ZF: If the result is 0, Then put 1.
4、 Jump unconditionally jmp Jump directly to the specified address , namely : Write its operand as an address %eip, Realization CPU Change of instruction execution .
Four ways :
jmp LABEL Use it directly LABEL Address
jmp *LABEL Use LABEL Address stored in address ( indirect )
jmp 0x8048056 Directly use the immediate number as the jump address
jmp *%eax take %eax As the address of jump
5、 Conditions jump : According to different combinations of condition codes , Can determine the size relationship , A jump that depends on the size relationship is a conditional jump . The form of the instruction character is J Followed by the suffix indicating the determination result J Followed by the suffix indicating the determination result , example
Such as :JGE, Namely :jump if greater or equal— Jump when greater than or equal .
6、 Conditional transmission (cmov), Function and format and mov Exactly the same , The difference is that it is different from conditional jump
Same with suffix , Only when the comparison relationship represented by the suffix is satisfied can the data be transferred , for example :
comvge %ax,%bx Only when it is greater than or equal to %ax The content of is passed on to %bx
7、 Flag bit setting instruction ( Flag bit setting instruction (set) Is the operand that will follow ( A byte ) Set to 1, The premise is that the determination result meets its suffix
for example :setge %al Indicates that when greater than or equal to %al Set up 1. such , The result of the comparison is in one byte 1 In the form of .
8、 Circulation in the machine is through Conditions jump To achieve .
After the loop body is executed , To judge ( Loop variable , Or other cycle end conditions ), Not meeting the conditions , Jump directly to the next instruction address outside the circulation ; Meet the conditions , Jump back to the beginning of the loop .
边栏推荐
猜你喜欢
Cocoscreator operates spine for animation fusion
Pytorch model trains practical skills and breaks through the bottleneck of speed
Simple use of websocket
Protection strategy of server area based on Firewall
Discussion on CPU and chiplet Technology
Xiaomi's path of chip self-development
Bill Gates posted his resume 48 years ago: "it's not as good-looking as yours."
Stm32cubemx, 68 sets of components, following 10 open source protocols
[server data recovery] a case of RAID data recovery of a brand StorageWorks server
[today in history] July 7: release of C; Chrome OS came out; "Legend of swordsman" issued
随机推荐
2022pagc Golden Sail award | rongyun won the "outstanding product technology service provider of the year"
Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
Lidar Knowledge Drop
⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?
#yyds干货盘点# 解决名企真题:交叉线
Attribute keywords serveronly, sqlcolumnnumber, sqlcomputecode, sqlcomputed
拜拜了,大厂!今天我就要去厂里
Ffmpeg --- image processing
How to enable radius two factor / two factor (2fa) identity authentication for Anheng fortress machine
CTFshow,信息搜集:web9
大厂做开源的五大痛点
Applet directory structure
Demis hassabis talks about alphafold's future goals
CTFshow,信息搜集:web13
Niuke real problem programming - Day9
用于增强压缩视频质量的可变形卷积密集网络
Jetson AGX Orin CANFD 使用
Niuke real problem programming - Day11
激光雷达lidar知识点滴
leetcode:648. Word replacement [dictionary tree board + find the shortest matching prefix among several prefixes]