typedef unsigned int unt;
ioport unt port10;
ioport unt port1;
unt keyvalue=2;
unt data[]={0x80fc,0x8060,0x80da,0x80f2,0x8066,0x80b6,0x80be,0x80e0};
void delay();
void main()
{
*(volatile unt *)SWWSR=0x7208;
*(volatile unt *)SWCR = 0x0000;
*(volatile unt *)BSCR= 0xf800;
*(volatile unt *)ST0 = 0x0000;
*(volatile unt *)ST1 = 0x2b00;
*(volatile unt *)PMST=0x2fe4;
*(volatile unt *)IFR=0xffff;
*(volatile unt *)IMR=0x0002;
*(volatile unt *)ST1=(*(volatile unt *)ST1)&0xf7ff;//start int1 global
while(1)// 等待中断来显示数字
{
port10=data[keyvalue];
}
}
interrupt void Get_KeyValue()
{
keyvalue=3;
*(volatile unt *)IFR=0x00ff;
*(volatile unt *)IMR=0x0002;
*(volatile unt *)ST1=(*(volatile unt *)ST1)&0xf7ff;//start int1 global
}
.sect ".vectors"
.ref _Get_KeyValue
.ref _c_int00 ; main progrom
;.ref timer0 ,hpisys,usb_read
.align 0x80 ; must be aligned on page boundary
RESET: ; reset vector
B _c_int00 ; branch to main progrom
NOP
NOP
nmi: RETE ; enable interrupts and return from one
NOP
NOP
NOP ;NMI~
; software interrupts
sint17 .space 4*16
sint18 .space 4*16
sint19 .space 4*16
sint20 .space 4*16
sint21 .space 4*16
sint22 .space 4*16
sint23 .space 4*16
sint24 .space 4*16
sint25 .space 4*16
sint26 .space 4*16
sint27 .space 4*16
sint28 .space 4*16
sint29 .space 4*16
sint30 .space 4*16
int0: RETE
NOP
NOP
NOP
int1:
NOP
B _Get_KeyValue
RETE
int2: RETE
NOP
NOP
NOP
tint: RETE
NOP
NOP
NOP
rint0: RETE
NOP
NOP
NOP
xint0: RETE
NOP
NOP
NOP
DMAC0: RETE
NOP
NOP
NOP
DMAC1: RETE ;tint1
NOP
NOP
NOP
int3: RETE
NOP
NOP
NOP
HPINT: RETE
NOP
NOP
NOP
DMAC2: RETE ;rint1
NOP
NOP
NOP
NOP
xint1: RETE
NOP
NOP
NOP
DMAC4: RETE
NOP
NOP
NOP
DMAC5: RETE
NOP
NOP
NOP
.end