SN8P1700
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 180
Revision 1.93
;-------------------------------------------------------------------------------
;
Code
section
;-------------------------------------------------------------------------------
.CODE
ORG
0
;Code
section
start
jmp
Reset
;Reset
vector
;Address
4
to
7
are
reserved
ORG
8
jmp
Isr
;Interrupt
vector
ORG
10h
;-------------------------------------------------------------------------------
;
Program reset section
;-------------------------------------------------------------------------------
Reset:
mov
A,#07Fh
;Initial stack pointer and
b0mov
STKP,A
;disable global interrupt
b0mov
PFLAG,#00h
;pflag = x,x,x,x,x,c,dc,z
b0mov
RBANK,#00h
;Set initial RAM bank in bank 0
mov
A,#40h
;Clear watchdog timer and initial system mode
b0mov OSCM,A
call
ClrRAM
;Clear RAM
call
SysInit
;System initial
b0bset FGIE ;Enable
global
interrupt
;-------------------------------------------------------------------------------
; Main
routine
;-------------------------------------------------------------------------------
Main:
b0bset
FWDRST
;Clear
watchdog
timer
call MnApp
jmp
Main
;-------------------------------------------------------------------------------
; Main
application
;-------------------------------------------------------------------------------
MnApp:
; Put your main program here
ret
;-----------------------------------
;
Jump table routine
;-----------------------------------
ORG
0x0100
;The jump table should start from the head
;of
boundary.
b0mov
A,Wk00
and
A,#3
ADD PCL,A
jmp JmpSub0
jmp JmpSub1
jmp JmpSub2
;-----------------------------------