asm2

 

.globl  全局对象

.data 数据区

.align 4 对齐 16字节对齐

.type

For ELF targets, the .type directive is used like this:

.type name , type description

This sets the type of symbol name to be either a function symbol or an object symbol. There are five different syntaxes supported for the type description field, in order to provide compatibility with various other assemblers.

STT_FUNCfunction

Mark the symbol as being a function name.

STT_GNU_IFUNCgnu_indirect_function

Mark the symbol as an indirect function when evaluated during reloc processing. (This is only supported on assemblers targeting GNU systems).

STT_OBJECTobject

Mark the symbol as being a data object.

https://sourceware.org/binutils/docs/as/Type.html#index-ELF-symbol-type

 

 

 

Here, the dot . means "current location".

Then .-main would be the distance to the start of main. If placed at the end of main, it would also be the size of main.

"-" means minus and this expression means "size of main" = "." (current address) minus "address of main

 

 movl    c(%rip), %eax    rip 相对寻指 x86 64

 

 

 

 

 

 

 https://www.ruanyifeng.com/blog/2010/06/ieee_floating-point_representation.html

https://tooltt.com/floatconverter/

 

 

 

 

 

 leaq  获取地址 获取-12(%rbp) 指向的地址

posted @ 2021-07-28 16:57  通杀  阅读(256)  评论(0编辑  收藏  举报