单个led.c文件

#include <stdbool.h>

__sfr __at(0xb0) P3;

__sfr __at(0x88) TCON;
__sfr __at(0x89) TMOD;
__sfr __at(0x8a) TL0;
__sfr __at(0x8c) TH0; __sfr __at(0xa8) IE; volatile unsigned long int clocktime;
volatile _Bool clockupdate; void clockinc(void) __interrupt(1)
{
TH0 = (65536 - 922) / 256;
TL0 = (65536 - 922) % 256;
clocktime++;
clockupdate = true;
} unsigned long int clock(void)
{
unsigned long int ctmp; do
{
clockupdate = false;
ctmp = clocktime;
} while (clockupdate); return(ctmp);
} void main(void)
{
// Configure timer for 11.0592 Mhz default SYSCLK
// 1000 ticks per second
TH0 = (65536 - 922) / 256;
TL0 = (65536 - 922) % 256;
TMOD = 0x01;
IE |= 0x82;
TCON |= 0x10; // Start timer for(;;)
P3 = ~(clock() / 1000) & 0x03;
}

  

编译:

sdcc-sdcc led.c

生成的文件

led.asm led.c led.ihx led.lk led.lst led.map led.mem led.rel led.rst led.sym

  

生成的led.ihx转位led.hex

sdcc-packihx led.ihx > led.hex

  

最新文章

  1. Freeswitch 添加可转码的G729编码
  2. Heartbeat使用梳理
  3. gulp 安装 使用 和删除
  4. 基于Mono.Cecil的静态注入
  5. Java命名约定
  6. qq2440启动linux后插入u盘出现usb 1-1: device descriptor read/64, error -110,usb 1-1: device not accepting address 8, error -110
  7. sql,插入最大值加1
  8. python学习小结2:if和while控制语句
  9. C#中的OLEDB连接2
  10. QuerryRunner Tools
  11. PHP - 数组去重,(折中:符串去重)
  12. Swift 实现俄罗斯方块详细思路解析(附完整项目)
  13. Python学习笔记(九)
  14. 系列博文-LowPoly风格的图像生成器
  15. JavaScriptCore全面解析
  16. java基础 易忘易混点复习1
  17. centos7.2重新安装yum
  18. Linux的nmon监控结果分析文件中网络分析NET
  19. ecmall 的一些方法说明
  20. SELECT INTO 和 INSERT INTO SELECT比较

热门文章

  1. 增加select的option之间的间距
  2. http协议与tcp协议的理解
  3. 以图搜图(demo创建流程)
  4. 论文阅读: CCF A 2022 MVD: 基于流敏感图神经网络的内存相关漏洞检测 (ICSE)
  5. list集合之流操作
  6. 一些JVM指令
  7. 使用.Net工具安装某种程序
  8. 胖AP组建小型企业WLAN
  9. Mac下Homebrew更新国内源brew update卡死(完美解决,网上都不完整)
  10. windows 系统进行升级之后,如何删除 Windows.old 文件夹。