Reply by nirajsuthar July 12, 20022002-07-12
hi,
i've written a simple timer0 interrupt prpgram in asm. language.
timer counter is working alright but i'm not getting any timer
interrupt.
below is my program and vector file.

********************************************
TIMER.ASM
********************************************
.mmregs
.global x,go,_c_int00,timer
.data
x .word 00ff
.text
_c_int00
rsbx INTM ;intm=0
ld #x,DP
stm 0x0410,TCR
stm 0x2710,PRD
stm 0x0420,TCR
stm 0x0008,IFR
stm 0x0008,IMR
ssbx INTM

go b go

_c_int01
ld #x,DP
ld x,T
RETE ***************************************************
VECTORS.ASM
***************************************************
.sect ".vectors"
.ref _c_int00,_c_int01 ; entry point
.align 0x80 ; must be aligned on page boundary

RESET: ; reset vector
BD _c_int00 ; branch to C entry point
STM #200,SP ; stack size of 200
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: RETE
NOP
NOP
NOP
int2: RETE
NOP
NOP
NOP
tint: BD timer
NOP
NOP

rint0: RETE
NOP
NOP
NOP
xint0: RETE
NOP
NOP
NOP
rint1: RETE
NOP
NOP
NOP
xint1: RETE
NOP
NOP
NOP
int3: RETE
NOP
NOP
NOP
.end
***************************************************

.text starts at address 1400.
my ISR (i.e. timer labal) is on memory address 140f.

Timer0 resides at address FFCC where the instructions are
FFCC LD 73h,A
FFCD FBACC A
FFCE NOP
FFCF NOP
The DP points to page "1"
So my interrupt vector points to address 0000 0000 1111 0011 b
i.e. 00f3h

When I write 140F at address 00F3, i do get timer interrupt.

NOW ANYONE WOULD PLEASE HELP ME THAT HOW CAN I GET TIMER INTERRUPT
WITHOUT GOING ON SUCH A MANUAL MANIPULATION AS I'M NOT GETTING IT
WITHOUT DOING IT?

I would be highly obliged getting a positive answer.
Thanks.
Niraj.