Due to time limitation, what is the fastest way to clear an array without using "For ...next" loop?
Any idea?
Printable View
Due to time limitation, what is the fastest way to clear an array without using "For ...next" loop?
Any idea?
Quote:
Originally Posted by Pic2008
But then, that clears everything.Code:CLEAR
The fastest way really depends on the PIC, and the array size.
Using FSR's will always be fastest.
But this one's really easy with PBP 2.60 (fast too).
Code:ArraySize CON 64
MyArray VAR BYTE[ArraySize]
ARRAYWRITE MyArray,[REP 0\ArraySize]
"Clear" means clear all variables in the RAM, or does it clear the register to the default state also eg TRISA, PORTB etc?
Only the GP RAM, and all of it.
<br>