Hi!
movlw .50 ;you want to repeat 50 times
movwf WHATEVER ;store this number somewheare
step1 BCF porta, 01
CALL pulse
BSF porta, 01
CALL farve_1
decfsz WHATEVER,f ;decrement WHATEVER every time you pass through loop, skip
goto step1 ;next instruction when TEMP=0 (50th pass)
Regards, Samo
-----Original Message-----
From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On
Behalf Of Lasse Madsen
Sent: Sunday, September 23, 2001 5:23 PM
To: PICLIST@MITVMA.MIT.EDU
Subject: [PIC]: How to repeat a loop in assembler ?
Hi all
Im new to the list and im relatively new to assembler.
I woud like to know how i can "repeat" a loop X times
heres my code which i would like to have repeated for instance 50 times:
step1 BCF porta, 01
CALL pulse
BSF porta, 01
CALL farve_1
goto step1
How can i repeat the above 50 times insted of forever ?
Thanks to all who reads this and especially to those who answer this.
Best regards
Lasse Madsen
--
http://www.piclist.com hint: To leave the PICList
mailto:piclist-unsubscribe-request@mitvma.mit.edu
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads