1

a small portion of my code

swi  r6,r0,LCD_ CONT  
addi r10,r0,6  

firstdelay:  
addi r10,r10,-1  
bnei r10,firstdelay  
swi  r0,r0,LCD_ CONT  
addi r10,r0,30

seconddelay:  
addi r10,r10,-1  
bnei r10,seconddelay  
swi  r5,r0,LCD_DATA  

i have to delay multiple times throughout the program but want to keep it small. id like to write something along the lines of:

swi  r6,r0,LCD_ CONT  
addi r10,r0,[delayamount]  
bri  Delay  
swi  r0,r0,LCD_ CONT  
addi r10,r0,[newdelayamount]  
bri  Delay

Delay:  
addi r10,r10,-1  
bnei r10,Delay  
[return to where I was previously in the code]

so my issue is: how do i get back to where i was in the code without having to create multiple delays and just run through the code straight. thanks everyone!

4

1 回答 1

1

也许这会有所帮助:使用函数(注意“操作码rtsd然后用于返回调用函数”)。

于 2009-10-06T16:08:37.053 回答