I am trying to write a boostrap code for the XC164 but it doesn't seem to start up right. As I understand from the datasheet the bootstrap section starts at 0xE00000 and the start of the bootstrap code at 0xE00024. Is that right??
$MODV2 $CASE ; Case Sensitive Symbols $INCLUDE (REG164.INC) ; Addresses for XC16x/Super10 Devices ADR_BOOTSTART EQU 0E00000H ;******** Boot Loader Part ************************************************** ; Historic Parameter for old CPU's ; BOOT960 = 0: C167 CPU with 32 Byte Bootstrap loader is used ; BOOT960 = 1: C167 CPU with 960 Byte Bootstrap loader is used $SET (BOOT960 = 0) ASSUME DPP3:SYSTEM FlashOSCode SECTION CODE AT ADR_BOOTSTART FlashOS PROC NEAR $IF NOT (BOOT960) START: MOV R0,#0024H ; Start of bootstrap code LAB1: JNB S0RIC.7,LAB1 ; when CPU expects 32 Bytes EXTS #0E0H,#1 MOVB [R0],S0RBUF BCLR S0RIC.7 CMPI1 R0,#SOF(ENDBOOT)-1 JMPR CC_NZ,LAB1 $ENDIF DISWDT ; Start of bootstrap code MOV STKOV,#0FA00H MOV STKUN,#0FC00H MOV CP,#0FA00H ; Register Bank at 0FA00H MOV DPP3,#3H MOV DPP2,#3H MOV DPP1,#3H EINIT RESTART: MOV SP,#0FBF0H ; System Stack Pointer MOV R0,#0FA40H ; User Stack Pointer MOV TFR,ZEROS MOV PSW,ZEROS ;******** Command Processor ************************************************** ; CALL ERASE_FLASH CMD_LOOP: MOV RL4,#'E' ; FLASH ERASED CALL PUTCHAR ; PUTCHAR MOV R7,#0030H ; STATUS OK