共3条
1/1 1 跳转至页
AVR,comm 请问AVR中的.comm是什么意思?
问
答 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
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
共3条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
【有奖活动】震撼来袭!这场直播将直击工程师的心灵! | |
“我想要一部加热台”活动,不花钱赢取开发好工具!活动开始了哦 | |
【有奖活动】伙伴们:您的“需求”解决了吗? | |
抽奖了,抽奖了,金升阳医疗电源 |
打赏帖 | |
---|---|
【换取手持数字示波器】+与同事对定时器输出相位可调PWM移相全桥控制分享被打赏50分 | |
【换取手持数字示波器】+LP-MSPM0L1306开发板试用体验+串口被打赏40分 | |
CC-RL编译器相关问题求助被打赏10分 | |
【换取手持数字示波器】+与同事对ESP-12开发调试经验分享被打赏50分 | |
【换取手持数字示波器】+同事tek示波器调试spi解析被打赏50分 | |
【换取手持数字示波器】+2.6寸墨水屏调试经验被打赏50分 | |
换取手持数字示波器+个人开关电源的设计经验被打赏50分 | |
【换取手持数字示波器】+【APT32F173测评】+URAT被打赏20分 | |
【换取手持数字示波器】CH32X035的定时器以及外部中断体验被打赏50分 | |
【换取手持数字示波器】CH32X035搭建开发环境(RISC-V)被打赏50分 |