small quistion

Status
Not open for further replies.

aoamb83

New Member
hi all
iam new in programing with assembly
my problem is that i want to check two i/p pins
that may have the following combinations
00 01 10 11
if i find 00 i will desplay some thing on LCD
01 i will desplay another thing
and so on
i know how to desplay my problem is to recognize the two digits that i will
desplay somthing according to them
it`s like if condition
if 00 call or goto (....)
if 01 call or goto (....)
and so on
note : i use pic16f84a

thanx at all
 
Code:
if     ((variable & 0x03) == 0x00) found_0() ;
else if((variable & 0x03) == 0x01) found_1() ;
else if((variable & 0x03) == 0x02) found_2() ;
else if((variable & 0x03) == 0x03) found_3() ;
else hole_in_STC() ;
Exactly one of the functions will be called each time the code is entered. STC is the Space Time Continueum. A good optimizing compiler will evaluate the expression once and test the result against the constants. A bad compiler will do the stupidly obvious thing and evaluate the expression four times.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…