The code you found was probably the worst example of PIC assembly language I've ever seen!
As Pulsetronics stated, MPASM (the assembler part of MPLABX) is strict about the presentation of each line. The rules are:
1. A label (a named place that you can use as a target for a jump instruction) MUST be in the first column of a line,
2. An instruction must NOT be in the first column of a line. Common practice is to add a tab or a few spaces to line the instructions up and make it look neat.
In the code itself, the instruction 'tris' gave a warning because it is no longer needed and a more consistent way of addressing the TRIS registers exists. Historically, the first PIC processors needed the instruction but you can achieve the same result by writing directly to the TRIS register in the same way you write to any of the other ones. The other bad example in the code is the use of register and bit numbers instead of using their names. It makes for very confusing code, the names of all the registers and the bits inside them are defined in the 16F877A header file which should be included automatically when you started the project.
For example:
Code:
movwf 6 ;move the value in W to file register 6
is more clear if written like this
Code:
movwf PORTB ;move the value in W to PORT B
Note that the code won't work anyway! The TRIS and PORT registers are wrong, you need to select bank 1 to access the TRIS registers and bank 0 to select the ports. It's easy to do, just add
before you access the register. 'x' is the bank number or to make it even easier, you can use the register name itself like this:
.
Brian.