Hi All
Having problems with the clearbit command within this code section
the set and clear bit update setting and clearing dirsD as they should
The problem is that outpinsD=dirsD is not occuring
It does at start up but after being set outpinsD to %11110000
but once the outpinsD are set to 1 by the sub routine they do not clear back to 0
the dirsD set to 1 and clear to 0 as expected
regards
john
Having problems with the clearbit command within this code section
the set and clear bit update setting and clearing dirsD as they should
The problem is that outpinsD=dirsD is not occuring
It does at start up but after being set outpinsD to %11110000
but once the outpinsD are set to 1 by the sub routine they do not clear back to 0
the dirsD set to 1 and clear to 0 as expected
Code:
symbol pointer=b5
symbol marker=b6
symbol N=34
hsersetup B9600_8, %001
inti:
hserflag=0
dirsD=%11110000
outpinsD=dirsD
pause 500
main:
do
if hserflag <>0 then:get 0,pointer:get 1,marker:endif
if pointer="L" or pointer="M" or pointer="N"or pointer="O" or pointer="P" then:gosub but_on:endif
loop
but_on:
select pointer
case "L"
if dirD.0=0 then
setbit dirsD,0
outpinsD=dirsD
hserout 0, ("cf.pic0=",N,"10")
elseif dirD.0=1 then
clearbit dirsD,0
outpinsD=dirsD
hserout 0, ("cf.pic1=",N,"9")
endif
case "M"
if dirD.1=0 then
setbit dirsD,1
outpinsD=dirsD
hserout 0, ("th.pic0=",N,"18")
elseif dirD.1=1 then
clearbit dirsD,1
outpinsD=dirsD
hserout 0, ("th.pic1=",N,"17")
endif
case "N"
if dirD.2=0 then
setbit dirsD,2
outpinsD=dirsD
hserout 0, ("tde.pic0=",N,"16")
elseif dirD.2=1 then
clearbit dirsD,2
outpinsD=dirsD
hserout 0, ("tde.pic1=",N,"15")
endif
case "O"
if dirD.3=0 then
setbit dirsD,3
outpinsD=dirsD
hserout 0, ("thu.pic0=",N,"14")
elseif dirD.3=1 then
clearbit dirsD,3
outpinsD=dirsD
hserout 0, ("thu.PIC1=",N,"13")
endif
endselect
gosub NF
gosub HP
return
NF:
hserout 0,(N,$ff,$ff,$ff)
return
HP:
pointer=0
marker=0
hserflag=0
hserptr=0
return
john