If I want to keep a particular loop as fast as possible (fewest cycles), does it add more time to reference a value by it's variable name?
For example, do these two code blocks take the same number of cycles to execute....
Code:EXAMPLE 1: myVar = 273 EXAMPLE 2: (assuming SomeNum is already defined as a BYTE and loaded with the value "273") myVar = SomeNum
And more specifically, when loading the registers of a 16-bit timer... let's say I already have the value "%01010101" loaded into a BYTE variable named "HighTimes" and "%11110001" loaded into a BYTE variable named "LowTimes".....
Does this second example take longer to execute because it must go look up the value of the variable before the copy to the register?Code:EXAMPLE 1: TMR1H = %01010101 TMR1L = %11110001 EXAMPLE 2: TMR1H = HighTimes TMR1L = LowTimes
Bookmarks