Joepage2008x2
Member
Hi,
My chip reads a parallel input, 8 bit, input ranging from 80 to 255. My circuit reads this and places it in a temporary file register.
Now what I want it to do is compare it to a decimal, if they match then it goes elsewhere and places a value into another file register in which the chip does other things with. I want the kind of process below
temp1 ; value read from input port.
does temp1 = 255 then goto elsewhere
if not then
does temp1 = 254 then goto elswhere2
if not then
etc, etc..
I'm not quite sure how I would do it, I thought somewhere along these lines but this seems to be long and drawn out,
movlw temp1
xorlw 255,W
btfsc STATUS,Z
goto nextbranch
goto elsewhere
nextbranch
movlw temp1
xorlw 254,W
btfsc STATUS,Z
goto next branch2
goto elswhere2
etc.. etc...
elsewhere
movlw d'104'
movwf delay
goto start
elsewhere2
movlw d'109'
movwf delay
goto start
Help would be appreciated,
Thanks
My chip reads a parallel input, 8 bit, input ranging from 80 to 255. My circuit reads this and places it in a temporary file register.
Now what I want it to do is compare it to a decimal, if they match then it goes elsewhere and places a value into another file register in which the chip does other things with. I want the kind of process below
temp1 ; value read from input port.
does temp1 = 255 then goto elsewhere
if not then
does temp1 = 254 then goto elswhere2
if not then
etc, etc..
I'm not quite sure how I would do it, I thought somewhere along these lines but this seems to be long and drawn out,
movlw temp1
xorlw 255,W
btfsc STATUS,Z
goto nextbranch
goto elsewhere
nextbranch
movlw temp1
xorlw 254,W
btfsc STATUS,Z
goto next branch2
goto elswhere2
etc.. etc...
elsewhere
movlw d'104'
movwf delay
goto start
elsewhere2
movlw d'109'
movwf delay
goto start
Help would be appreciated,
Thanks