Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
unsigned char dig1;
unsigned char dig2;
unsigned char dig3;
unsigned char dig4;
unsigned char dig5;
unsigned char dig6;
unsigned int bcdval1 = (100 * dig1) + (10 * dig2) + dig3;
unsigned int bcdval2 = (100 * dig4) + (10 * dig5) + dig6;
if(bcdval1 == bcdval2)
{
doThis();
}
else
{
doThat();
}
Sorry, I am a bit drunk because It is my birthday, but still, this does not make much sense.. Do you mean converting the BCD value to ASCII hex? .. yes that is inefficient. Actually not very inefficient, but you would not gain anything.I could convert to hex, but that wouldnt be very efficient.
;
fon movf fastens,w
subwf tens,w
skpnc
goto nx10
goto laps1
;
nx10 movf fasones,w
subwf ones,w
skpnc
goto nx20
goto laps1
;
nx20 movf fastenths,w
subwf tenths,w
skpnc
return
;
... if the outcome is = or < then test 10's and then 1's.
faslap movf fastens,w
subwf tens,w
btfsc status,z
goto nx10 ;tens are = so goto check ones
;
movf fastens,w
subwf tens,w
skpnc
return ;current laptime > fastest lap bomb out
goto laps1 ;current laptime < fastest lap beep & rec
;
nx10 movf fasones,w
subwf ones,w
btfsc status,z
goto nx20 ;ones are = so goto check tenths
;
movf fasones,w
subwf ones,w
skpnc
return ;current laptime > fastest lap bomb out
goto laps1 ;current laptime < fastest lap beep & rec
;
nx20 movf fastenths,w
subwf tenths,w
skpnc
return ;current laptime > fastest lap bomb out
;
laps1 movlw d'3' ;beep for 5 1/10's of a sec on new record
movwf beeptime
bsf porta,1
;
faslap movf fastens,w
subwf tens,w
skpnz
goto nx10 ;tens are = so goto check ones
;
skpnc
return ;current laptime > fastest lap bomb out
goto laps1 ;current laptime < fastest lap beep & rec
;
nx10 movf fasones,w
subwf ones,w
skpnz
goto nx20 ;ones are = so goto check tenths
;
skpnc
return ;current laptime > fastest lap bomb out
goto laps1 ;current laptime < fastest lap beep & rec
;
nx20 movf fastenths,w
subwf tenths,w
skpnc
return ;current laptime > fastest lap bomb out
;
laps1 movlw d'3' ;beep for 5 1/10's of a sec on new record
movwf beeptime
bsf porta,1
;