jmbanales21485
- 29th May 2008, 00:24
I have a question on interrupt and GOTO lables
How can I go from an interrupt routine to another label in the code? i know this is a wierd question but let me try to explain.
if i have nested subroutines, subroutines that call other subroutines, and i have an interrupt set up so that if a button gets pressed then the interrupt will be called, then from the interrupt i want to go to another state, or another label in the software. a semi lame example is below of what i'm trying to do. please let me know what i can do to accomplish this wierd task. thank you all.
main:
GOSUB subroutine1
'code here
GOTO label1
subroutine1:
'code here
GOSUB subroutine2
RETURN
subroutine2:
'code here
GOSUB subroutine3
RETURN
subroutine3:
'code here
RETURN
label1:
'get in here from interrupt
GOTO label1
label2:
'get in here from interrupt
goto label2
DISABLE
myINT:
'IF interrupt then i want to go to label1
'IF something else i want to go to label 2
RESUME
ENABLE
How can I go from an interrupt routine to another label in the code? i know this is a wierd question but let me try to explain.
if i have nested subroutines, subroutines that call other subroutines, and i have an interrupt set up so that if a button gets pressed then the interrupt will be called, then from the interrupt i want to go to another state, or another label in the software. a semi lame example is below of what i'm trying to do. please let me know what i can do to accomplish this wierd task. thank you all.
main:
GOSUB subroutine1
'code here
GOTO label1
subroutine1:
'code here
GOSUB subroutine2
RETURN
subroutine2:
'code here
GOSUB subroutine3
RETURN
subroutine3:
'code here
RETURN
label1:
'get in here from interrupt
GOTO label1
label2:
'get in here from interrupt
goto label2
DISABLE
myINT:
'IF interrupt then i want to go to label1
'IF something else i want to go to label 2
RESUME
ENABLE