Hi folks,
when I try to toggle a bit in a byte inside a SUB, it doesn't work.
Not in simulator and not in real hardware.
[code:1:5dc53c3bf2]
$regfile = "m32def.dat" 'ATMEGA32: 32k Flash, 2k RAM, 1k EEPROM
$framesize = 200
$swstack = 200
$hwstack = 200
$crystal = 16000000 '16 MHz Quarz
Dim Toggle_byte As Byte
Declare Sub Input_yes_no(case_sub As Byte)
Call Input_yes_no(toggle_byte)
Do
Loop
Sub Input_yes_no(byval Case_sub As Byte)
Local Case_new2 As Byte
Toggle Case_sub.0 'does not toggle bit 0
' If Case_sub = 1 Then Case_sub = 0 Else Case_sub = 1'only this way it works!
End Sub
End
[/code:1:5dc53c3bf2]
I tried it also with the BYVAL statement.
Same result.
Am I missing something or is this a bug?
Kind regards
Roger
[b:5dc53c3bf2][color=red:5dc53c3bf2](BASCOM-AVR version : 2.0.7.6 )[/b:5dc53c3bf2][/color:5dc53c3bf2]
↧