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.

[SOLVED] '.org_2' can not fit the absolute section.

Status
Not open for further replies.
Joined
Feb 22, 2012
Messages
82
Helped
25
Reputation
50
Reaction score
25
Trophy points
1,298
Activity points
0
hi friends,

i am using picf4550 and handling 3 interrupt. my program is given below.
Code:
#include<P18F4550.INC>


R1 EQU 0X10
R2 EQU 0X11
R3 EQU 0X12
R4 EQU 0X13

	
ORG 0000h
 GOTO MAIN

ORG 0008h

	BTFSS INTCON3,INT1IF
	GOTO H1
	GOTO HighInt
H1  BTFSS INTCON,INT0IF
    RETFIE
    GOTO LOWINT
   



ORG 0018h
BRA  ANOTHER   



MAIN

ORG 900h

   SETF TRISB
   CLRF PORTB
   CLRF TRISD
   CLRF PORTD

   BSF TRISB,1 ;INT1 I/P PIN  ENABLE
   BSF TRISB,0
   BSF TRISD,2

     
     BSF INTCON, PEIE      ; ENABLE PERIPHERAL INTERRUPT ENABALE
     BSF INTCON,GIE
     BCF INTCON3,INT1IF
     BCF INTCON,INT0IF
     BCF INTCON3,INT2IF
 
      BSF INTCON3,INT1IE
      BSF INTCON,INT0IE
      BSF INTCON3,INT2IE
     
      BSF INTCON2,INTEDG1 
      BSF INTCON2,INTEDG0
      BSF INTCON3,INTEDG2
	  BSF INTCON2,RBPU
      BCF INTCON3,INT2IP
	
      
      MOVLW 0FH
      MOVWF ADCON1
 
      BSF RCON,IPEN
   
     CLRF R1
     CLRF R2
     CLRF R3




h1
   goto h1

HighInt:
ORG 800h
    
    CLRF PORTD
    MOVLW 02H
    MOVWF PORTD 
    ;CALL DELAY
    ;CLRF PORTD
    BCF INTCON3,INT1IF
    BCF PORTB,1
    RETFIE 
  

LOWINT

ORG 700h

MOVLW 04H
MOVWF PORTD
BCF INTCON,INT0IF
BCF PORTB,0
RETFIE


ANOTHER

ORG 600h

MOVLW 01H
MOVWF PORTD
BCF INTCON3,INT2IF
BCF PORTB,2
RETFIE



END




but i get the error given below.


Code:
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Bhuved\Desktop\HIREN DAVE\pic\programs\F 45 programs\3 INPUT INT\3 INPUT INT.mcp' started.
Language tool versions: mpasmwin.exe v5.42, mplink.exe v4.40, mcc18.exe v3.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Thu May 10 16:56:35 2012
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Documents and Settings\Bhuved\Desktop\HIREN DAVE\pic\programs\F 45 programs\3 INPUT INT\3 INPUT INT.o".
Clean: Deleted file "C:\Documents and Settings\Bhuved\Desktop\HIREN DAVE\pic\programs\F 45 programs\3 INPUT INT\3 INPUT INT.err".
Clean: Deleted file "C:\Documents and Settings\Bhuved\Desktop\HIREN DAVE\pic\programs\F 45 programs\3 INPUT INT\3 INPUT INT.lst".
Clean: Done.
Executing: "C:\Program Files\Microchip\mplabc18\v3.40\mpasm\mpasmwin.exe" /q /p18F4550 "3 INPUT INT.ASM" /l"3 INPUT INT.lst" /e"3 INPUT INT.err" /o"3 INPUT INT.o" /d__DEBUG=1
Warning[205] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 10 : Found directive in column 1. (ORG)
Warning[205] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 13 : Found directive in column 1. (ORG)
Warning[205] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 25 : Found directive in column 1. (ORG)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 26 : Found opcode in column 1. (BRA)
Warning[205] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 32 : Found directive in column 1. (ORG)
Warning[205] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 77 : Found directive in column 1. (ORG)
Warning[205] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 91 : Found directive in column 1. (ORG)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 93 : Found opcode in column 1. (MOVLW)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 94 : Found opcode in column 1. (MOVWF)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 95 : Found opcode in column 1. (BCF)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 96 : Found opcode in column 1. (BCF)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 97 : Found opcode in column 1. (RETFIE)
Warning[205] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 102 : Found directive in column 1. (ORG)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 104 : Found opcode in column 1. (MOVLW)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 105 : Found opcode in column 1. (MOVWF)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 106 : Found opcode in column 1. (BCF)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 107 : Found opcode in column 1. (BCF)
Warning[203] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 108 : Found opcode in column 1. (RETFIE)
Warning[205] C:\DOCUMENTS AND SETTINGS\BHUVED\DESKTOP\HIREN DAVE\PIC\PROGRAMS\F 45 PROGRAMS\3 INPUT INT\3 INPUT INT.ASM 112 : Found directive in column 1. (END)
Executing: "C:\Program Files\Microchip\mplabc18\v3.40\bin\mplink.exe" /p18F4550 /l"C:\Program Files\Microchip\mplabc18\v3.40\lib" "..\..\..\..\..\..\..\..\MCC18\bin\LKR\18f4550_g.lkr" "3 INPUT INT.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"3 INPUT INT.cof" /M"3 INPUT INT.map" /W
MPLINK 4.40, Linker
Device Database Version 1.3
Copyright (c) 1998-2011 Microchip Technology Inc.
Error - section '.org_2' can not fit the absolute section. Section '.org_2' start=0x00000018, length=0x00000002
Errors    : 1

Link step failed.
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Bhuved\Desktop\HIREN DAVE\pic\programs\F 45 programs\3 INPUT INT\3 INPUT INT.mcp' failed.
Language tool versions: mpasmwin.exe v5.42, mplink.exe v4.40, mcc18.exe v3.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Thu May 10 16:56:37 2012
----------------------------------------------------------------------
BUILD FAILED

Please direct me to solve this error....
 

I think it's saying that there is not enough space between 0x08 and 0x18 to fit the code!
Reduce the code between the addresses.

You have a lot of ORG's?

Don't you just need the reset and the interrupt vectors and then just use labels for the rest, let the assembler sort it out.
 
All your other warnings would be fixed by not putting anything other than labels and comments in the first column. Add a space or tab to all instructions and assembler directives.

Keith.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top