INCDIR in Sjasm

By Metalion

Paragon (1625)

Metalion's picture

05-04-2021, 12:36

Hello everyone,

Does someone know how to use the INCDIR directive in Sjasm ?
I can't seem to make it work properly.

I've tried :

incdir  full_path
incdir  "full_path"
incdir  ..\relative_path
incdir  "..\relative_path"

but none of them seem to work.

Login or register to post comments

By sjoerd

Hero (609)

sjoerd's picture

05-04-2021, 13:23

Good question! I never use it myself, but I would not be surprised if it works. Maybe just not as expected.

What do you think it should do? As far as I know it just add a path to the paths Sjasm searches for include files.

So instead of 'include path/ai.asm' you could use:
incdir path
include ai.asm

By santiontanon

Paragon (1810)

santiontanon's picture

05-04-2021, 16:26

It works exactly like sjoerd described. It will not include anything, just add the folder you specify to the search path for future includes.

By Metalion

Paragon (1625)

Metalion's picture

05-04-2021, 18:38

First of all, Sjoerd, let me thank you for Sjasm Smile
Very nice work and a lot of flexibility, the perfect tool for me.

Regarding INCDIR, I know that it only add a path and not a file, but I can't make it work !
My question was rather about the syntax, not the way it works.

Precisely, I have a source file that I include with :

; data
include "..\GFX\patterns.bin"

But if I try this:

;data
incdir  "..\GFX"
include "patterns.bin"

I have an error, sjasm does not find the file.
As I've said, I tried all the syntax possibilities (relative or full), but I have the same result.

So, what is the exact syntax ?

By santiontanon

Paragon (1810)

santiontanon's picture

05-04-2021, 18:42

Could it be that incdir considers paths relative to the working directory instead of relative to the current assembler file? (not in front of my MSX-development computer right now, so, just speculating) So, in your case, I'm assuming it'll have to be "incdir "GFX", instead of "incdir "../GFX" if the working directory from where you are calling sjasm is one up from the source file.

By Metalion

Paragon (1625)

Metalion's picture

05-04-2021, 18:50

No, I'm calling sjasm from the directory of the source file.
The directories are:

   GFX
   sources

And I'm calling sjasm within the "sources" directory:

c:\sources>
c:\sources>sjasm game.asm

By santiontanon

Paragon (1810)

santiontanon's picture

05-04-2021, 19:01

Strange! Then I'll let sjoerd answer, who might know better. But incdir has always worked fine for me all the times I used it. So, this error is puzzling! That being said, I don't think I ever used it with a ".." in the path, so, I wonder if that's what's making it confused.

By sjoerd

Hero (609)

sjoerd's picture

05-04-2021, 21:08

Could you try it like this?

;data
incdir  ../GFX
include patterns.bin

I think the backslash is the problem. The handling of the slashes and quote signs is the real problem of course, but OK. It should indeed work the way you're using it. But it doesn't. Tongue

By Metalion

Paragon (1625)

Metalion's picture

06-04-2021, 08:29

Hello Sjoerd,
I tried your syntax, and it works this time !
Thanks.