可以的,这边需要了解函数传参形式
unsigned char func(unsigned char a,unsigned char b)
a -> R0
b -> STK00
返回值 -> R0
unsigned int func(unsigned int a,unsigned int b)
a -> R0 STK00
b -> STK01 STK02
返回值 -> R0 STK00
另外C符号如何转换为汇编符号 在C符号前加下划线。比如在C函数中的main,对应汇编的_main
可重定位代码段的书写格式
section_name .code
其中section_name为段名,用户自定义
可重定位数据段书写格式
section_name .idata
section_name .udata
其中section_name为段名,用户自定义
idata对应初始化数据,在此段中使用.db .dw存放数据
udata对应为初始化数据,在此段中使用.res占用内存
符号声明 .extern fun
声明一个外部符号fun
声明一个全局符号 .global fun
声明fun为全局符号,在其他文件中可以访问此符号
|