Kurt is correct. That return is definitely a problem. However there is another problem. Your code also tries to execute the handler routine as if it was regular code. You need to put something before your handler label so you main code doesn't try to exeucte the handler code except as an interrupt.
Code:
;------------------
;varable declarations and so on
;...
;-------------------
;-------------------
;the timer set up, based on what can be found in the basic micro syntax manual
;calculates the number of interrupts per 1/100th of a second
;as a floating point constant.
interval fcon MHZ/100/256/128
counter var float
counter = 0.0
milliseconds var long
milliseconds = 0
TCRV0 = 0x03 ;Sets Timer V to count once every 128 OSC clocks
'TCRV1 = 0x01
;Tells the processor where to jump to when the timer V
;overflow interrupt triggers.
ONINTERRUPT TIMERVINT_OVF,handler
ENABLE TIMERVINT_OVF ;enables the timer V overflow interrupt
ENABLE ;enables interrupts in general
main
goto main
handler
;this interrupt is executed once per 256*128 clock cycles
counter = counter + 1.0
if(counter>interval)then
counter=counter-interval
milliseconds = milliseconds + 10
;this is what it does in my program - increments xw everytime milliseconds equals pauza
;and sends some data to a screen
if menu = 1 then
if milliseconds = pauza then
milliseconds = 0
xw = xw + 1
if xw >220 then
SEROUT p2, i9600, ["r", 0,21, 0,40, 0,220, 0,199, $00,$00]
GOSUB GetACK
PAUSE 1
xw = 20
endif
endif
endif
resume
Also this code:
Code:
SEROUT p2, i9600, ["r", 0,21, 0,40, 0,220, 0,199, $00,$00]
GOSUB GetACK
PAUSE 1
should not be in your interrupt handler. Never do anything in an interrupt handler that takes a significant amount of time. You should set a flag and then process that code in your main loop instead.