文档介绍:合泰单片机总结--,支持一维/二维数组(大小小于1bank>;使用const关键字,变量将存储于程序存储区,如,constuint8_ttab[]=“1,2,3”。b5E2RGbCAP中断服务函数:#pragmavectorISR_******@0x0c //定义中断入口地址voidISR_tmr0(void>{tick++。}中断函数中调用普通函数(1>方法1#pragmavectorISR_******@0x0c#pragmanolocalfunfun(>{}voidISR_tmr0(void>{fun(>。}(2>方法2#pragmavectorISR_******@0x0cfun(>{}voidISR_tmr0(void>{#asmcall_fun。#endasm}宏定义#define _pa0 _12_0 //bit0ofRAMaddress0x12位变量定义对于有多个bank的MCU,位变量只能定义在bank0,使用如下方式#pragmarambank0bitflag。#pragmanorambank指针不支持指向“字符串数组”char*rainbow[]={"red","orange","yellow"}。//notsupportedp1EanqFDPw只支持全局的静态函数指针,且所指函数不能带有参数fun(>{return1。}int(*constp>(>=fun。//globalandinitializationrequiredDXDiTa9E3dvoidmain(>{inta。a=(*p>(>。}不支持取得const常量的地址constintldc=0。voidmain(>{int*a。a=&ldc。//cannotpass}内嵌汇编#asm[label:]opcode[operands]...#endasmEg:chara。intb。voidfun(charp1,intp2>{a=p1。#asm//b=p2。MOVA,fun1MOV_b,AMOVA,fun1[1]mov_b[1],A#endasm}voidmain(>{intd1。chard2。unsignedcharq,r。r=0。q=d1/d2。//getquotient#asm//r=q。MOVA,CR3。CR3→qMOVCR4,A。CR4→r#endasm#asm//fun(d2,d1>MOVA,CR2MOVfun0