这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 综合技术 » 基础知识 » AVR,comm 请问AVR中的.comm是什么意思?

共3条 1/1 1 跳转至

AVR,comm 请问AVR中的.comm是什么意思?

院士
2006-09-17 18:14:16     打赏
AVR,comm 请问AVR中的.comm是什么意思?



关键词: 请问     中的     .comm     是什么     意思    

院士
2006-12-22 22:43:00     打赏
2楼
1: 什么处有.comm 2: gas.comm declares a common symbol named symbol. When linking, a common symbol in one object file may be merged with a defined or common symbol of the same name in another object file. If ld does not see a definition for the symbol–just one or more common symbols–then it will allocate length bytes of uninitialized memory. length must be an absolute expression. If ld sees multiple common symbols with the same name, and they do not all have the same size, it will allocate space using the largest size.

When using ELF, the .comm directive takes an optional third argument. This is the desired alignment of the symbol, specified as a byte boundary (for example, an alignment of 16 means that the least signifiCANt 4 bits of the address should be zero). The alignment must be an absolute expression, and it must be a power of two. If ld allocates uninitialized memory for the common symbol, it will use the alignment when placing the symbol. If no alignment is specified, as will set the alignment to the largest power of two less than or equal to the size of the symbol, up to a maximum of 16.
3: 这么长一段英文,谢谢 4: 加段程序 ;512 byte sector buffer in internal RAM

.global mmc_sbuf
    .comm    mmc_sbuf,512
    .comm    lba,3


get_spi_byte:
        ser    r24
spi_tx_rx:
        out     SPDR, r24            ; send over SPI
vspi1:        sbis     SPSR,SPIF            ; while flag is clear
         rjmp     vspi1                ; wait for SPI
         in     r24, SPDR            ; and get input data
        ret            

专家
2022-08-20 16:59:51     打赏
3楼

感谢分享


共3条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]