Calling a .asm file into another .asm file

Discussion in 'Embedded Systems and Microcontrollers' started by Sri_, Sep 18, 2013.

  1. Sri_

    Thread Starter New Member

    Sep 18, 2013
    2
    0
    Could anyone say whether there is any possibility of calling a .asm file into anther .asm file of other project in MPLAB.
    If possilble could u please state the requuired Directive or Instruction.
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,553
    2,375
    Doesn't the Include File work for you?
    Max.
     
  3. Sri_

    Thread Starter New Member

    Sep 18, 2013
    2
    0
    Hi Max,
    Am a beginner in Mplab. I wrote an assembly prog to clear all the RAM locations and my intention is to use or import this entire code in to the programe of a new project, instead of repeating the same code once again.

    Thanks
     
  4. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,553
    2,375
    Put it in an (.INC) include file and add it to the Header file list is one way.
    Then use the #include <filename.inc> in the main program.
    Max.
     
    Sri_ likes this.
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    It is also necessary for the project to be able to either see this other code so include the dot-asm file in your project. That's the easiest way to let the linker know it is there.
     
Loading...