beste mensen.

ik heb geprobeerd om een .inc file aan te maken maar helaas gaat dit niet goed.
het volgende heb ik gedaan:

na het openen van mijn project heb ik een nieuw file geopend.
hierin een stukje code neer gezet zoals:

test nop
nop
nop
return

deze vervolgens opgeslagen als "test.inc" en een vinkje gezet bij "add file to project"
in de sorce code heb ik staan: #include <test.inc>
en vervolgens staat er dan op een plek "call test"

als ik dan het project laat bouwen staat er een error:
Cannot open file (Include File "test.inc" not found)

wat doe ik verkeerd?

Probeer eens het volledige pad naar je include file te gebruiken in je programma, misschien help dat.

dat heb ik inderdaad ook al geprobeerd maar dan krijg ik de zelfde fout.

Weet je dat wel heel zeker? Als het path en filename kloppen moet 'ie gevonden worden...

Dubbele quotes gebruiken als de .inc file in dezelfde map staat als de .asm file:

#include "test.inc"

Bij gebruik van:

#include <test.inc>

wordt het include path gebruikt.

Er is geen verschil tussen quotes en angle brackets. Ze doen precies hetzelfde:


#INCLUDE

Syntax:
  #include include_file
  #include "include_file"
  #include <include_file>

Description 
The specified file is read in as source code. The effect is the same as if the entire text of the included file 
were inserted into the file at the location of the include statement. Upon end-of-file, source code assembly 
will resume from the original source file. Up to 5 levels of nesting are permitted. Up to 255 include files are allowed. 

If include_file contains any spaces, it must be enclosed in quotes or angle brackets. If a fully qualified path is 
specified, only that path will be searched. Otherwise, the search order is: 

    - current working directory
    - source file directory
    - MPASM assembler executable directory

Er is wel een verschil. Met "" kijkt hij in de map van het project en met <> in de library van MPLAB

Er is wel een verschil.

Hoe kom je daar bij??? Zie help-tekst bovenstaand... (Probeer het maar eens uit...)

[Bericht gewijzigd door Arco op (15%)]

Oops: er is soms verschil in MPLAB.

Bij MPASM maakt het dus niet uit, maar bij C18 (ook MPLAB) dus wel:

Source files included with #include <filename> are searched for in the path specified in the
MCC_INCLUDE environment variable and the directories specified via the -I command-line option. 
....stuk geknipt...
Source files included with #include "filename" are searched for in the directory containing
the including file.

Klopt, voor c18 werkt dat zo. Van Assembly weet ik dat niet. Dat gebruik ik al een tijdje niet meer.

Het gaat ook over assembly. (Zie startpost)
Het is trouwens wat onduidelijk om over MPLab te praten; MPLab is alleen een IDE/Text editor. Beter is MPAsm of MPAsm30...

het staat niet in de startpost dat het om assembly gaat. Ik had alleen direct de conclusie getrokken dat het over een c-compiler zou gaan. Beetje onduidelijk dus.

Het staat er niet met zoveel woorden, maar:



test    nop
        nop
        nop
        return

is toch echt een assembly subroutine. Ook gaat het om een .inc file, geen .c of .h...