SN8P1600
8-bit micro-controller
;-------------------------------------------------------------------------------
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
A,#40h
;Initial stack pointer and
;disable global interrupt
;pflag = x,x,x,x,x,c,dc,z
;Clear watchdog timer and initial system mode
b0mov
b0mov
mov
b0mov
OSCM,A
call
call
b0bset
ClrRAM
SysInit
FGIE
;Clear RAM
;System initial
;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
and
A,Wk00
A,#3
ADD
PCL,A
jmp
jmp
jmp
JmpSub0
JmpSub1
JmpSub2
;-----------------------------------
SONiX TECHNOLOGY CO., LTD
Page 80
Revision 1.94