;----------------------------------------------------------------------------- ; Assembly main line ;----------------------------------------------------------------------------- include "m8c.inc" ; part specific constants and macros include "memory.inc" ; Constants & macros for SMM/LMM and Compilera include "PSoCAPI.inc" ; PSoC API definitions for all User Modules export _main ; -------------------------------------------------------- ; --- work buffer ; -------------------------------------------------------- area bss(RAM) // inform assembler that variables follow cmd_ptr: blk 2 ; -------------------------------------------------------- ; --- program code ; -------------------------------------------------------- area text(ROM,REL) // inform assembler that program code follows _main: ; Insert your main assembly code here. lcall UART_1_EnableInt mov a, UART_PARITY_NONE lcall UART_1_Start M8C_EnableGInt mov a,(UART_1_ENABLE_RX_INT | UART_1_ENABLE_TX_INT) lcall UART_1_IntCntl .put_prompt: lcall UART_1_PutCRLF mov a, '>' lcall UART_1_PutChar lcall UART_1_CmdReset .wait_cmd: lcall UART_1_bCmdCheck cmp a, 0x00 jz .wait_cmd ; - get command lcall UART_1_szGetParam mov [cmd_ptr], a mov [cmd_ptr+1], x or a, [cmd_ptr+1] jz .goto_next ; - feed back mov a, [cmd_ptr] mov x, [cmd_ptr+1] lcall UART_1_PutString ; mov a, [cmd_ptr] mov x, [cmd_ptr+1] RAM_PROLOGUE RAM_USE_CLASS_3 RAM_SETPAGE_IDX A mov a, [x] RAM_EPILOGUE RAM_USE_CLASS_3 ; cmp a, '0' jnz .led_01 mov a, 0 mov reg[PRT0DR], a jmp .goto_next .led_01: cmp a, '1' jnz .led_02 mov a, 0x20 mov reg[PRT0DR], a jmp .goto_next .led_02: cmp a, '2' jnz .led_03 mov a, 0x40 mov reg[PRT0DR], a jmp .goto_next .led_03: cmp a, '3' jnz .goto_next mov a, 0x60 mov reg[PRT0DR], a ; .goto_next: jmp .put_prompt ; .terminate: jmp .terminate ; ------------------------------------- ; -- subroutine ; ------------------------------------- ; -------------------------------------------------------- ; --- ROM base table ; -------------------------------------------------------- area lit