51汇编与C全面周立功
CSEG AT 0400H
bcdmap: DB '0' ,'0'
DB '0' ,'1'
DB '0' ,'2'
...
DB '5' ,'7'
DB '5' ,'8'
DB '5' ,'9'
END
原程序中是这样初始化二维数组的。但这样的数组无法定位表头的地址,地址由keil自动编译产生。
uchar code bcdmap[60][2]={
"00", "01","02", "03","04", "05","06", "07","08", "09","10", "11","12", "13","14",
"15","16", "17","18", "19","20", "21","22", "23","24", "25","26", "27","28", "29",
"30", "31","32", "33","34", "35","36", "37","38", "39","40", "41","42", "43","44",
"45","46", "47","48", "49","50", "51","52", "53","54", "55","56", "57","58", "59"};
下面这段汇编代码就能把表头地址定位在ROM区的0400H位置上,缩短主程序查询表格的指令周期。就是用这段汇编代码取代原程序中的C语言定义的方法。 但是不知道怎么把这小段汇编代码与C程序连接起来。
自己写的a51文件,用下面这段代码能与C程序连接上吗? 编译后提示 *** WARNING L9: EMPTY SEGMENTS ENCOUNTERED
NAME ?C_STARTUP
?C_C51STARTUP SEGMENT CODE
?STACK SEGMENT IDATA
RSEG ?STACK
DS 1
EXTRN CODE (?C_START)
PUBLIC ?C_STARTUP
CSEG AT 0
?C_STARTUP:
CSEG AT 0400H
bcdmap:
DB '0' ,'0'
DB '0' ,'1'
DB '5' ,'9'
LJMP ?C_START
END