Re: re-locatable ASM
|
||||
---|---|---|---|---|
新會員
|
Dear Ryang,
剛剛把 SECTION NAME=My_RAM0 RAM=gpr0 // RAM variable space - Bank0 SECTION NAME=My_RAM1 RAM=gpr1 // RAM variable space - Bank1 加到 lkr file 里;asm 加上 list p=16f887 #include "p16f887.inc" #define SCAN_IN0 Temp_Portd,0 #define SCAN_IN1 Temp_Portd,1 #define SCAN_IN2 Temp_Portd,2 #define SCAN_IN3 Temp_Portd,3 #define SCAN_IN4 Temp_Portd,4 #define SCAN_IN5 Temp_Portd,5 #define SCAN_IN6 Temp_Portd,6 #define SCAN_IN7 Temp_Portd,7 #define SCAN_DEC_EN porta,7 #define SCAN_DEC_OUT0 porte,0 #define SCAN_DEC_OUT1 porte,1 #define SCAN_DEC_OUT2 porte,2 #define IN_CODE0 0 #define IN_CODE1 1 #define IN_CODE2 2 #define IN_CODE3 3 #define IN_CODE4 4 #define IN_CODE5 5 #define IN_CODE6 6 #define IN_CODE7 7 #define TABLE_SIZE 128 #define KEYBOARD_TABLE_SIZE 16 #define KEY_BREAK 0 #define KEY_MAKE 128 #define KEY_REPEAT 130 #define KEY_STEP 16 My_RAM1 udata Table_Header1 res Table_Size/2 KeyBoard_Table_Header res KEYBOARD_TABLE_SIZE My_RAM0 udata Table_Header0 res Table_Size/2 I2C_Addr res 1 Delay_Counter res 1 Delay_Counter1 res 1 W_Temp res 1 Status_Temp res 1 Pclath_Temp res 1 Temp_Scan_Code res 1 Temp_Scan_Out res 1 Temp_Portd res 1 Temp_Scan_In res 1 Temp_Clear_Update_Table res 1 STARTUP code 0x00 nop end 還是看到 Table_Header1 的address 為 0x20 (bank0) 並不是我指的 bank1(0xa0-0xef) 謝謝
發表於: 2008/4/16 11:39
|
|||
|
Re: re-locatable ASM
|
||||
---|---|---|---|---|
版主
|
My_RAM1 udata
發表於: 2008/4/16 11:12
|
|||
|
re-locatable ASM
|
||||
---|---|---|---|---|
新會員
|
Dear 版主,
在下面的sample code 中,我發現 Table_Header1並不在gpr1的範圍內(用debug SIM watch看的) , 請幫我看一下我哪里寫錯,謝謝。 list p=16f887 #include "p16f887.inc" #define SCAN_IN0 Temp_Portd,0 #define SCAN_IN1 Temp_Portd,1 #define SCAN_IN2 Temp_Portd,2 #define SCAN_IN3 Temp_Portd,3 #define SCAN_IN4 Temp_Portd,4 #define SCAN_IN5 Temp_Portd,5 #define SCAN_IN6 Temp_Portd,6 #define SCAN_IN7 Temp_Portd,7 #define SCAN_DEC_EN porta,7 #define SCAN_DEC_OUT0 porte,0 #define SCAN_DEC_OUT1 porte,1 #define SCAN_DEC_OUT2 porte,2 #define IN_CODE0 0 #define IN_CODE1 1 #define IN_CODE2 2 #define IN_CODE3 3 #define IN_CODE4 4 #define IN_CODE5 5 #define IN_CODE6 6 #define IN_CODE7 7 #define TABLE_SIZE 128 #define KEYBOARD_TABLE_SIZE 16 #define KEY_BREAK 0 #define KEY_MAKE 128 #define KEY_REPEAT 130 #define KEY_STEP 16 gpr1 udata Table_Header1 res Table_Size/2 KeyBoard_Table_Header res KEYBOARD_TABLE_SIZE gpr0 udata Table_Header0 res Table_Size/2 I2C_Addr res 1 Delay_Counter res 1 Delay_Counter1 res 1 W_Temp res 1 Status_Temp res 1 Pclath_Temp res 1 Temp_Scan_Code res 1 Temp_Scan_Out res 1 Temp_Portd res 1 Temp_Scan_In res 1 Temp_Clear_Update_Table res 1 STARTUP code 0x00 nop end
發表於: 2008/4/16 10:54
|
|||
|