欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2648|回復(fù): 4
打印 上一主題 下一主題
收起左側(cè)

請問code int nums[]={....};和int code nums[]={...}; 有區(qū)別嗎

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:518902 發(fā)表于 2020-10-16 20:05 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
大家好,我查到 code的意思是固化在rom里 ,我想: 那么應(yīng)該是不可寫了? 豈不是const了
由此想到了標(biāo)題這個問題

不知道順序的變化是否會影響代碼,這里的num應(yīng)該是個常量指針,不可改。。。

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報

沙發(fā)
ID:155507 發(fā)表于 2020-10-16 22:18 | 只看該作者
code 順序的變化是不會影響代碼的

  1. code

  2. The code memory type may be used for constants and functions. This memory is accessed using 16-bit addresses and may be on-chip or external.

  3. For constants (ROM variables), code memory is limited to 64K. Objects are limited to 64K and may not cross a 64K boundary. Constant variables declared code are located in the CODE memory class.
  4. For program code (functions), code memory is limited to 64K. Program functions are stored in the CODE memory class by default. The code memory type specifier is not required.
  5. Declare code objects as follows:

  6. unsigned char code code_constant;

  7. unsigned int func (void)
  8. {
  9.    return (0);
  10. }

  11. ============================================
  12. The Cx51 Compiler conforms to the ANSI definition of const objects.

  13. Variables declared with the const type qualifier alone are stored in the memory area (data, idata, xdata, and so on) associated with their definition.

  14. Variables you want to locate in ROM must be declared with the code memory type. For example:
  15. code char test[] = "This is a text string";

復(fù)制代碼

回復(fù)

使用道具 舉報

板凳
ID:518902 發(fā)表于 2020-10-16 22:56 | 只看該作者
angmall 發(fā)表于 2020-10-16 22:18
code 順序的變化是不會影響代碼的

哇塞! 這個文檔看起來好像很厲害的樣子 請問在哪里可以看到?
回復(fù)

使用道具 舉報

地板
ID:155507 發(fā)表于 2020-10-16 23:44 | 只看該作者
laopihappy123 發(fā)表于 2020-10-16 22:56
哇塞! 這個文檔看起來好像很厲害的樣子 請問在哪里可以看到?

這里
https://www.keil.com/support/man/docs/c51/c51_le_code.htm
回復(fù)

使用道具 舉報

5#
ID:518902 發(fā)表于 2020-10-17 00:08 | 只看該作者
angmall 發(fā)表于 2020-10-16 23:44
這里
https://www.keil.com/support/man/docs/c51/c51_le_code.htm

感恩大佬!
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表