Ok, so all of you know, I am a noob with pics. I am trying to figure out exactly what does what in .asm files. I am using MPLAB IDE, and am coming up with a few errors.
First Question: How does mplab determine line #s? Are blank lines included in the numbering sequence? Are comment lines included as well?
Second Question: Does anyone know where to find a listing and explanation of the error codes?
Here is the code, basically copied from the tut with my own comments to ensure that I am understanding what I am doing:
Here are the errors that are being generated:
Error[113] E:\1STPROGWINPIC\BLINKLED.ASM 22 : Symbol not previously defined (b)
Error[112] E:\1STPROGWINPIC\BLINKLED.ASM 22 : Missing operator
Message[302] E:\1STPROGWINPIC\BLINKLED.ASM 23 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\1STPROGWINPIC\BLINKLED.ASM 24 : Register in operand not in bank 0. Ensure that bank bits are correct
Any help is appreciated!
First Question: How does mplab determine line #s? Are blank lines included in the numbering sequence? Are comment lines included as well?
Second Question: Does anyone know where to find a listing and explanation of the error codes?
Here is the code, basically copied from the tut with my own comments to ensure that I am understanding what I am doing:
Code:
;*******************************************************************************
;Tutorial 1.1 - Nigel Goodwin 2002
;First try at writing code, basically copying nigels code, with my own
;understanding of what is being done
title "blink led"
list p=16F628A
#include "p16F628A.inc"
;************************** config bits *****************************************
__config 0x2118
;************************** the program setup info ******************************
org 0x0000 ;sets the program origin, where it starts from
movlw 0x07 ;puts Literal value in Working register
movwf CMCON ;moves value in W register to CoMparator CONtrol
;turning off comparators
bsf STATUS, RP0 ;Bit Set File selecting bank 1
movlw b 00000000 ;moves Binary number to Working Register
movwf TRISB ;sets port b to outputs-TRIState port B
movwf TRISA ;sets port a to outputs
bcf STATUS, RP0 ;Bit Clear File clears the status register,
;resetting to bank0
;************************* the actual program ***********************************
loop ;program section name
movlw 0xff ;sets value of (b)'11111111' into Working register
movwf PORTA ;copies W value to porta and portb turning all pins
movwf PORTB ;setting the pins logic high
nop ;No OPeration, basically telling the controller to
nop ;go on to the next step, taking up the extra clock
;cycles that the goto command needs
movlw 0x00 ;sets value of (b)'00000000' into the Working register
movwf PORTA ;copies W value to ports, turning them off again
movwf PORTB ;
goto loop ;tells it to return to the top,note: this is a never
;ending cycle killed only by removing power
end ;needed for proper parsing, even if it does nothing
Here are the errors that are being generated:
Error[113] E:\1STPROGWINPIC\BLINKLED.ASM 22 : Symbol not previously defined (b)
Error[112] E:\1STPROGWINPIC\BLINKLED.ASM 22 : Missing operator
Message[302] E:\1STPROGWINPIC\BLINKLED.ASM 23 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\1STPROGWINPIC\BLINKLED.ASM 24 : Register in operand not in bank 0. Ensure that bank bits are correct
Any help is appreciated!