this code give error!:
Code: Select all
program test_structure
' Declarations section
sub procedure program_init()
dim kj as byte
dim lkj as byte
'if you delete the "rem" by
'lkj=0, the nop and clrwdt after give error, else all work well.....
'''''lkj=0
'theese 3 commands give error, after a dim declaration, all seems give error.
''''''''''''''''''''''''''''''''''''''
nop
clrwdt
'''''''''''''''''''''''''''''''''''''''
for kj=0 to 100
lkj=lkj+1
next kj
'while after a for/next loop, or only: lkj=0 theese 2 commands work ok!
''''''''''''''''''''''''''''''''''''''
nop
clrwdt
'''''''''''''''''''''''''''''''''''''''
end sub
main:
' Main program
program_init()
nop
clrwdt
end.
Code: Select all
program test_structure
' Declarations section
sub procedure program_init()
dim kj as byte
dim lkj as byte
'if you delete the "rem" by
'lkj=0, the nop and clrwdt after give error, else all work well.....
lkj=0
'theese 3 commands give error, after a dim declaration, all seems give error.
''''''''''''''''''''''''''''''''''''''
nop
clrwdt
'''''''''''''''''''''''''''''''''''''''
for kj=0 to 100
lkj=lkj+1
next kj
'while after a for/next loop, or only: lkj=0 theese 2 commands work ok!
''''''''''''''''''''''''''''''''''''''
nop
clrwdt
'''''''''''''''''''''''''''''''''''''''
end sub
main:
' Main program
program_init()
nop
clrwdt
end.
in sub procedure program_init()
I only changed:
'''''lkj=0
with
lkj=0
after variables declaration.......
while in mb 3.8 both code work well.
config is:
pic 16F876 a 8Mhz on windows 7 32bits.