Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top