GMS81C2012/GMS81C2020
HYUNDAI MicroElectronics
Example: The usage software example of Vector address for GMS81C2020.
ORG
0FFE0H
DW
DW
DW
DW
DW
DW
DW
DW
DW
DW
DW
DW
DW
DW
DW
DW
NOT_USED
NOT_USED
SIO
BIT_TIMER
WD_TIMER
ADC
NOT_USED
NOT_USED
NOT_USED
NOT_USED
TIMER1
TIMER0
INT1
; Serial Interface
; Basic Interval Timer
; Watchdog Timer
; ADC
; Timer-1
; Timer-0
; Int.1
; Int.0
; -
INT0
NOT_USED
RESET
; Reset
ORG
ORG
0B000H
0D000H
; GMS81C2020(20K)ROM Start address
; GMS81C2012(12K)ROM Start address
;
;*******************************************
;
MAIN
PROGRAM
*
;*******************************************
;
RESET: DI
CLRG
LDX
RAM_CLR:LDA
STA
;Disable All Interrupts
#0
#0
;RAM Clear(!0000H->!00BFH)
{X}+
CMPX #0C0H
BNE
RAM_CLR
;
;
LDX
#0FFH
;Stack Pointer Initialize
TXSP
LDM
LDM
:
:
:
LDM
LDM
LDM
LDM
LDM
LDM
LDM
LDM
R0, #0
R0IO,#82H
;Normal Port 0
;Normal Port Direction
TDR0,#125
TM0,#0FH
IRQH,#0
;8us x 125 = 1mS
;Start Timer0, 8us at 4MHz
IRQL,#0
IENH,#0E0H ;Enable Timer0, INT0, INT1
IENL,#0
IEDS,#05H
;Select falling edge detect on INT pin
R0FUNC,#03H;Set external interrupt pin(INT0, INT1)
EI
:
;Enable master interrupt
:
:
:
:
NOT_USED:NOP
RETI
30
MAR. 2000 Ver 1.00