hi
i am new in pic programming,i wrote one small addition program ,and successfuly builded.I want to add the file register called 'A1'to my watch
window. But the 'Add Symbol' feature is greyed out.
pls help me
in this program first i didnt write 'org 0x05 and goto start'.code.
with org 0x00 when compile my code i keep getting the following error code
MPLINK 4.16, Linker
Copyright (c) 2008 Microchip Technology Inc.
Error - section '.org_0' can not fit the absolute section. Section '.org_0' start=0x00000000, length=0x00000016
Errors : 1
after adding the org 0x05 code,build succeeded why?
this is the program
;add 0x58& 0xA4,display the result in PORTB
;File name add3.asm
;PICSTART plus
processor 16f84
#include <p16f84.inc>
__config _XT_OSC & _WDT_OFF & _PWRTE_ON
A1 equ 0X20
org 0x00
GOTO start
org 0x05
clrw
clrf A1
clrf STATUS
start movlw 0x00
tris PORTB
movlw 0xA4
MOVWF A1
movlw 0x58
ADDWF A1,0
MOVWF PORTB
fin: GOTO fin
end
You need to build your project first. Click "Project" and then "Build All" from the MPLAB menu.
Or, if you are using the Quick build option, put the asm file in focus and click "Project" and then "QuickBuild add3.asm"
You need to build your project first. Click "Project" and then "Build All" from the MPLAB menu.
Or, if you are using the Quick build option, put the asm file in focus and click "Project" and then "QuickBuild add3.asm"
You have the wrong processor selected! Click "Configure" and then click "Select Device". Choose the "PIC16F84" from the drop down list and click "OK". Then rebuild your project. This may or may not fix your problem.
You are compiling with Debug code enabled. Which debugger are you using with MPLAB?
I just tried to reproduce your problem and it is exactly as you state. Edit, I forgot, you can't use equ for variables with relocatable code. The variables have to be in a data section.
I found a work around. You need to delete the linker script (16f84.lkr) and force a rebuild by editing your asm file and the 'Add Symbol" feature will appear.
The linker script is only needed for relocatable code and not really required until quite complex programs are being produced. I never use the linker with 16 series chips when working in assembler.