' russ compile test 1 ( this is line 1 )
'
' DebugVal does not climb from
' 0 to 7 ( left shifted twice ) and repeat
' change line 28 on left to tempb
' and the rest ( from the next line to end of file ) of the temp's to tempb
' as indicated by the comments, and behavior is ok
' line 28 seems to be the problem, look at the assembler code for it
' using temp on right and left may be confusing the compiler
'Chip model
#chip 16F819, 8
#config _INTRC_CLKOUT, MCLR_ON
led_ix = 0
CountLoop:
led_ix += 1
if led_ix > 7 then
led_ix = 0
end if
temp_ix = led_ix
ROTATE temp_ix left
ROTATE temp_ix left
Temp = PortA and LED_port_mask
Temp = Temp or temp_ix ' Tempb = Temp or temp_ix
SetPort:
PORTA = temp ' PORTA = tempb
DebugVal = temp ' DebugVal = tempb
GoTo CountLoop
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
' russ compile test 1 ( this is line 1 )
'
' DebugVal does not climb from
' 0 to 7 ( left shifted twice ) and repeat
' change line 28 on left to tempb
' and the rest ( from the next line to end of file ) of the temp's to tempb
' as indicated by the comments, and behavior is ok
' line 28 seems to be the problem, look at the assembler code for it
' using temp on right and left may be confusing the compiler
'Chip model
#chip 16F819, 8
#config _INTRC_CLKOUT, MCLR_ON
led_ix = 0
CountLoop:
led_ix += 1
if led_ix > 7 then
led_ix = 0
end if
temp_ix = led_ix
ROTATE temp_ix left
ROTATE temp_ix left
Temp = PortA and LED_port_mask
Temp = Temp or temp_ix ' Tempb = Temp or temp_ix
SetPort:
PORTA = temp ' PORTA = tempb
DebugVal = temp ' DebugVal = tempb
GoTo CountLoop