SN8P1700
8-bit micro-controller build-in 12-bit ADC
;
Code section
;-------------------------------------------------------------------------------
.CODE
ORG
jmp
0
;Code section start
;Reset vector
Reset
;Address 4 to 7 are reserved
ORG
jmp
8
Isr
;Interrupt vector
ORG
10h
;-------------------------------------------------------------------------------
Program reset section
;
;-------------------------------------------------------------------------------
Reset:
mov
A,#07Fh
STKP,A
PFLAG,#00h
RBANK,#00h
A,#40h
;Initial stack pointer and
;disable global interrupt
;pflag = x,x,x,x,x,c,dc,z
;Set initial RAM bank in bank 0
;Clear watchdog timer and initial system mode
b0mov
b0mov
b0mov
mov
b0mov
OSCM,A
call
call
b0bset
ClrRAM
SysInit
FGIE
;Clear RAM
;System initial
;Enable global interrupt
;-------------------------------------------------------------------------------
Main routine
;
;-------------------------------------------------------------------------------
Main:
b0bset
call
jmp
FWDRST
MnApp
Main
;Clear watchdog timer
;-------------------------------------------------------------------------------
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
and
A,Wk00
A,#3
ADD
PCL,A
jmp
jmp
jmp
JmpSub0
JmpSub1
JmpSub2
;-----------------------------------
SONiX TECHNOLOGY CO., LTD
Page 129
Revision 1.94