DerStrom8
Super Moderator
Hello, everyone.
I came across this tutorial that explains how to use Assembly to program a PIC16F84, but I am wondering about one of the pieces of the code.
For the delay, this is what the code says:
Delay
Loop1 decfsz Count1,1 ;
goto Loop1 ;
decfsz Count2,1 ;
goto Loop1 ;
return
END
My question is how this part works. I thought that by saying "goto Loop1" it would go back to "Loop1" and do the same thing over and over again, without ever getting to the "return" command. Could someone please explain why this is does not happen? If you need any more information, please see the link. It has the entire code, if it would help.
Many thanks!
Der Strom
I came across this tutorial that explains how to use Assembly to program a PIC16F84, but I am wondering about one of the pieces of the code.
For the delay, this is what the code says:
Delay
Loop1 decfsz Count1,1 ;
goto Loop1 ;
decfsz Count2,1 ;
goto Loop1 ;
return
END
My question is how this part works. I thought that by saying "goto Loop1" it would go back to "Loop1" and do the same thing over and over again, without ever getting to the "return" command. Could someone please explain why this is does not happen? If you need any more information, please see the link. It has the entire code, if it would help.
Many thanks!
Der Strom
Last edited: