Mips gdb debugging found

Source: Internet
Author: User

(1) If-OS-g is used at the same time, only-OS takes effect.

(2) mips support delay slot, see: http://blog.csdn.net/dogsun88/article/details/7437178

For example:

854f8: 0320f809 jalr t9
854fc: 02202021 move a0, s1

The last time the sub-function is called, the next sentence is to assign s1 to a0. In fact, before calling the sub-function, move a0 and s1 also take effect.

If the-O0 method is used for compilation, the latency slot is not enabled. For example:

Cd670: 1, 10400008
Beqz v0, cd694 <gal_calculateb.pdf + 0x7c>
Cd674: 00000000
Nop

Currently, the-OS optimization is known to enable the delay slot.

(3) During OS optimization, function parameters are transmitted using the a0 a1 a2 register by default.

(4) use disassembly to study the existing optimized Library (the Library debugging information is not visible). Do not use up when using info registers | down. After I find up, the value of info registers has changed.

(5) common instruction sets:

Category Command Description
Add number now Addiu gp, gp,-11040. Gp = gp-11040
Addition Addu GP, GP, T9 Gp = GP + T9
Multiplication Lui GP, 0xa Gp = 0xa0000
Bitwise AND AndI v0, V0, 0X4000 V0 = V0 & 0X4000
Load 32-bit LW v0, 0 (A0) V0 = memory [A0 + 0]
Save 32-bit SW v0, 0 (A0) Memory [A0 + 0] = V0
Load unsigned 8-bit Lbu A0, 9 (S2) A0 = memory [S2 + 9]
Value assignment Li A1, 1 A1 = 1
Variable assignment Move S1, A0 S1 = A0
Jump with a variable of 0 Beqz v0, 851ac If (V0 = 0) Jump to 0x851ac
Variable unequal jump BNE A0, V1, 8544c If (A0! = V1) Jump to 0x8544c
Function call jump Jalr T9 Redirect T9 to address


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.