指针浅析(1)

[test.c]
int
main() { char *p_char = 0; int *p_int = 0; p_char++; p_int++; }
[test.s] .file
"test.c" .text .globl main .type main, @function main: .LFB0: .cfi_startproc pushl %ebp .cfi_def_cfa_offset 8 .cfi_offset 5, -8 movl %esp, %ebp .cfi_def_cfa_register 5 subl $16, %esp movl $0, -8(%ebp) movl $0, -4(%ebp) addl $1, -8(%ebp) addl $4, -4(%ebp) movl $0, %eax leave .cfi_restore 5 .cfi_def_cfa 4, 4 ret .cfi_endproc .LFE0: .size main, .-main .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609" .section .note.GNU-stack,"",@progbits

 

留意汇编中红色背景标出的地方。

 

posted on 2018-06-25 22:25  rivsidn  阅读(144)  评论(0)    收藏  举报

导航