Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Assembly Language on PIC 16F872

Status
Not open for further replies.

scdoro

Member level 5
Joined
Jan 12, 2005
Messages
87
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,040
instruction set for 16f872

Hi, would like to know if i can use code like below in my assembly language.

circle if count == 1
btfss portb,5 ;check is led5 is lighted?
goto circle
else
goto circle
endif

can i use syntax like count == 1 ?? is setting a flag this way is workable in assembly ?

thanks
 

You cannot use that, read your datasheet so that you will know the instruction set supported.

Read your assembler manual for assembler directives.
 

Hi, scodoro
In assembly you cannot use if, else, ==, endif as code instructions.
These keywords are assembler directives, i.e. they are used for conditional assembly
(like preprocessor in C language), or in macro definitions. In other words they don't generate
machine code but they control this generation. Please take a look at MPLAB assembler help.
And the instruction set of your PICmicro is listed in its datasheet.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top