共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 跳转至页
回复
有奖活动 | |
---|---|
分享开发笔记,赚取电动螺丝刀(便携轻巧与无刷电机两款可选) | |
看《关键跃升》,聊聊工作心法、动力、能力、沟通与协作,从五个方面深入交流你的工作心得 | |
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
我要给自己挣一部逻辑分析仪 | |
用知识换取送给亲朋的礼物,做个浪漫的开发者 | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 |
打赏帖 | |
---|---|
Buck电路工作在CCM模式下电感电流的计算公式是什么?被打赏5分 | |
buck电路工作原理被打赏5分 | |
基于MSPM0L1306的MODBUS-RTU协议通讯实验被打赏100分 | |
我想要一部加热台+多合一调试工具被打赏18分 | |
每周了解几个硬件知识+485硬件知识分享被打赏10分 | |
【换取手持数字示波器】树莓派PICO调试器官方固件本地化部署实践被打赏24分 | |
【换取手持数字示波器】分享一个KEIL无法识别CMSIS-DAP调试器的解决办法被打赏20分 | |
【换取手持数字示波器】分享一个自制的ArduinoNano扩展板底板被打赏23分 | |
【换取手持示波器】树莓派PICOW网页烟花被打赏18分 | |
【换取手持示波器】树莓派PICO逻辑分析仪被打赏16分 |