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.

List p=16f877a

Status
Not open for further replies.

micropad

Member
LIST P=16F877A

Dear All,

I sow lot of PIC programmers insert above text to there program. I never used it but program is working properly
Can any one please explain the important of this text

Thanks in advance
 
Hi,

LIST is an Assembly Directive, if you use MPlabs Assembler Help, Index and key in LIST it shows you all the options you can use it for.
 
This is the "List directive" to tell the compiler/ assembler what processor to compile for. It is usually seen along with an "Include" statement that would point to a processor specific include file containing variable definitions and memory mappings etc that are specific to the processor being compiled for.

For example:

List p=16F877A
#Include <16F877A.inc>

Read the documentation for MPLab which is available free of charge from Microchip's Web site. There is a wealth of useful information in Datasheet's and Application Notes too, so grab the ones specifically for the devices that you are using and also the general ones for the family of devices.
 
I use multiple arguments with the list directive -

p= Processor Type
r = Default Radix (i.e. binary, decimal or hex)
w = Assembler Error Level

Typically my code header would look like this -

Code:
		list		p=16F887, r=dec, w=-302
		include		<P16F887.INC>

In my example, I'm assembling code for a PIC 16F887, telling the assembler to use decimal radix as the default radix (so that I can use decimal values in my code without having to use a radix identifier), and tell it to suppress error message 302, which is the redundant bank select message it generates everytime it encounters code that addresses the RP1 and RP0 bits.
 
Micropad, the include file is a list of registers and bits, instead of having to remember the address of a register and put its value such as 06 which is portb for some chips, you can just put 'portb', the assembler replaces the text string 'portb' with the value 06 which is defined (or equated for purists) in the include file.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top