Need help fitting long command line

General information and assistance with DOSBox.

Need help fitting long command line

Postby Scorpion Illuminati » 2017-11-02 @ 16:46

I am using the following batch file to assemble my game:
Code: Select all
@echo off
rem save the old path
@echo on
SET oldpath=%path%

@echo off
rem set the path to the working folder, otherwise compilation will fail
@echo on
path c:\;%path%

@echo off
rem delete old assembled binary if it exists
@echo on
if exist ..\..\bin\emu\rom.bin del ..\..\bin\emu\rom.bin

@echo off
rem /j set include search directory
rem /p pure binary
rem /k enable if assembler directives
rem /o enable optimisations
rem ow+ optimise absolute long addressing
@echo on
..\..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k /o op+,os+,ow+,oz+,oaq+,osq+,omq+ ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom > ..\..\logs\emu.log

@echo off
rem restore the old path
@echo on
path %oldpath%
pause

However when i check emu.log i get:
SNASM68K, version 2.02Ex, Mar 24 1995, 15:22:35
(c) 1993-95 Cross Products Ltd. All Rights Reserved
Warning : Could not open list file '..\..\bin\'
*********************
* Binary Statistics *
*********************

*********************
* Rom Usage *
*********************
43554 bytes used
4150238 bytes left

*********************
* Ram Usage *
*********************
772 bytes of ram used
64763 bytes of ram left

This refers to the last path before the < redirect for the log file. However when I remove the
Code: Select all
/o op+,os+,ow+,oz+,oaq+,osq+,omq+

portion it seems to no longer cut off the path to the list file. I tried concatinating the string using & like so:
Code: Select all
@echo off
rem save the old path
@echo on
SET oldpath=%path%

@echo off
rem set the path to the working folder, otherwise compilation will fail
@echo on
path c:\;%path%

@echo off
rem delete old assembled binary if it exists
@echo on
if exist ..\..\bin\emu\rom.bin del ..\..\bin\emu\rom.bin

@echo off
rem /j set include search directory
rem /p pure binary
rem /k enable if assembler directives
rem /o enable optimisations
rem ow+ optimise absolute long addressing
@echo on
..\..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k /o op+,os+,ow+,oz+,oaq+,osq+,omq+ &
..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom > ..\..\logs\emu.log

@echo off
rem restore the old path
@echo on
path %oldpath%
pause

but it seems to just ignore the second part altogether and treat the & as the source file. Any assistance in this matter would be greatly appreciated.

Sincerely,

Scorpion Illuminati
Scorpion Illuminati
Newbie
 
Posts: 5
Joined: 2017-11-02 @ 16:33

Re: Need help fitting long command line

Postby Osprey » 2017-11-02 @ 17:44

You have commas in the "/o op+,os+,ow+,oz+,oaq+,osq+,omq+" portion. Could those be interfering with the parsing, since snasm68k.exe uses commas to separate the paths that follow? If so, perhaps doing...

Code: Select all
set var1=/o op+,os+,ow+,oz+,oaq+,osq+,omq+
..\..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k %var1% ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom > ..\..\logs\emu.log

...would work. I think that you'll have to use DOSBox SVN Daum, though, since this doesn't work in official DOSBox and even recent vanilla SVN builds ("echo %var1%" echoes "%var1%", not the contents of the variable). It seems ironic that, for as much as the devs say that SVN Daum is "broken," it gets right a basic DOS feature that their own builds don't. If you don't want to use SVN Daum, using 4DOS inside DOSBox might work, instead.

If commas in that portion isn't the problem, maybe simply using DOSBox SVN Daum or 4DOS in DOSBox would make your existing batch file work, since your problem could be related to the same incomplete DOS support in official/vanilla DOSBox that I just gave an example of.
Osprey
Member
 
Posts: 244
Joined: 2017-7-27 @ 21:32

Re: Need help fitting long command line

Postby Scorpion Illuminati » 2017-11-02 @ 18:05

Osprey wrote:You have commas in the "/o op+,os+,ow+,oz+,oaq+,osq+,omq+" portion. Could those be interfering with the parsing, since snasm68k.exe uses commas to separate the paths that follow? If so, perhaps doing...

Code: Select all
set var1=/o op+,os+,ow+,oz+,oaq+,osq+,omq+
..\..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k %var1% ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom > ..\..\logs\emu.log

...would work. I think that you'll have to use DOSBox SVN Daum, though, since this doesn't work in official DOSBox and even recent vanilla SVN builds ("echo %var1%" echoes "%var1%", not the contents of the variable). It seems ironic that, for as much as the devs say that SVN Daum is "broken," it gets right a basic DOS feature that their own builds don't. If you don't want to use SVN Daum, using 4DOS inside DOSBox might work, instead.

If commas in that portion isn't the problem, maybe simply using DOSBox SVN Daum or 4DOS in DOSBox would make your existing batch file work, since your problem could be related to the same incomplete DOS support in official/vanilla DOSBox that I just gave an example of.

Ok,

1) Where do i go to get DOSBox SVN Daum?
2) Where do i get 4DOS, it's website and how do i install it?

Sincerely,

Scorpion Illuminati
Scorpion Illuminati
Newbie
 
Posts: 5
Joined: 2017-11-02 @ 16:33

Re: Need help fitting long command line

Postby Osprey » 2017-11-02 @ 18:18

Scorpion Illuminati wrote:1) Where do i go to get DOSBox SVN Daum?
2) Where do i get 4DOS, it's website and how do i install it?

Well, you could just google them ;), but I'm feeling nice, so...

SVN Daum is available at http://ykhwong.x-y.net/

For 4DOS, my post here has a link and some instructions that may be useful: viewtopic.php?f=31&t=55390

Rather than running 4DOS.com /c, followed by each command that you want, though, you may prefer to simply run it once and do all of your work in its environment.

I would try SVN Daum first, if it wasn't clear, as I've tested that the variable use that I gave above works in it. I mentioned 4DOS only if you really prefer the DOSBox build that you're on or if you end up having any further problems that 4DOS might solve.
Osprey
Member
 
Posts: 244
Joined: 2017-7-27 @ 21:32

Re: Need help fitting long command line

Postby Scorpion Illuminati » 2017-11-02 @ 18:37

Code: Select all
@echo off
rem save the old path
@echo on
SET oldpath=%path%

@echo off
rem set the path to the working folder, otherwise compilation will fail
@echo on
path c:\;%path%

@echo off
rem delete old assembled binary if it exists
@echo on
if exist ..\..\bin\emu\rom.bin del ..\..\bin\emu\rom.bin

@echo off
rem /j set include search directory
rem /p pure binary
rem /k enable if assembler directives
rem /o enable optimisations
rem ow+ optimise absolute long addressing
@echo on
set flags=/o op+,os+,ow+,oz+,oaq+,osq+,omq+
rem ..\..\util\4dos.com /c ..\..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k %flags% ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom
rem ..\..\util\4dos.com /c ..\..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k %flags% ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom > ..\..\logs\emu.log
..\..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k %flags% ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom > ..\..\logs\emu.log

@echo off
rem restore the old path
@echo on
path %oldpath%
pause

SNASM68K, version 2.02Ex, Mar 24 1995, 15:22:35
(c) 1993-95 Cross Products Ltd. All Rights Reserved
Warning : Could not open list file '..\..\bin\'
*********************
* Binary Statistics *
*********************

*********************
* Rom Usage *
*********************
43554 bytes used
4150238 bytes left

*********************
* Ram Usage *
*********************
772 bytes of ram used
64763 bytes of ram left

Image
No Dice unfortunately, even though it looks like it's being concatenated correctly. Trying your suggestion to use 4DOS:
Code: Select all
@echo off
rem save the old path
@echo on
SET oldpath=%path%

@echo off
rem set the path to the working folder, otherwise compilation will fail
@echo on
path c:\;%path%

@echo off
rem delete old assembled binary if it exists
@echo on
if exist ..\..\bin\emu\rom.bin del ..\..\bin\emu\rom.bin

@echo off
rem /j set include search directory
rem /p pure binary
rem /k enable if assembler directives
rem /o enable optimisations
rem ow+ optimise absolute long addressing
@echo on
rem ..\..\util\4dos.com /c ..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k %flags% ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom
..\..\util\4dos.com /c ..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k %flags% ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom > ..\..\logs\emu.log

@echo off
rem restore the old path
@echo on
path %oldpath%
pause

Unknown Command ..\asm\dosbox\snasm68k.exe

Removing the 4DOS part reverts it back to the truncated path. Any ideas?

Sincerely,

Scorpion Illuminati
Scorpion Illuminati
Newbie
 
Posts: 5
Joined: 2017-11-02 @ 16:33

Re: Need help fitting long command line

Postby collector » 2017-11-02 @ 21:40

Note that Daum is broken and getting old. Also, if this starts dealing more with DOSBox you should be posting in the DOSBox part of the forum.
User avatar
collector
l33t
 
Posts: 4101
Joined: 2003-1-15 @ 10:39

Re: Need help fitting long command line

Postby ripsaw8080 » 2017-11-02 @ 22:56

Osprey wrote:I think that you'll have to use DOSBox SVN Daum, though, since this doesn't work in official DOSBox and even recent vanilla SVN builds ("echo %var1%" echoes "%var1%", not the contents of the variable). It seems ironic that, for as much as the devs say that SVN Daum is "broken," it gets right a basic DOS feature that their own builds don't.

Contrary to your criticism, inserting environment variables in commands does not work from the prompt in real DOS; it only works in batch files. So in terms of compatibility with DOS, official DOSBox gets it right and Daum does not.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4162
Joined: 2006-4-25 @ 23:24

Re: Need help fitting long command line

Postby BitWrangler » 2017-11-03 @ 00:31

Can't you just CD up the tree a bit before that line, reduce total length?

ripsaw8080 wrote:Contrary to your criticism, inserting environment variables in commands does not work from the prompt in real DOS; it only works in batch files. So in terms of compatibility with DOS, official DOSBox gets it right and Daum does not.


Huh? Swear I did it all the time in 6.0 through 6.22
Basement full of ancient PC stuff, starting to go through it. Most recently toyed with DOS era stuff 15 years ago, so memory might be rusty. So what's this BitWrangler guy's deal ??? >>> http://www.vogons.org/viewtopic.php?f=25&t=56382
User avatar
BitWrangler
Member
 
Posts: 429
Joined: 2017-10-11 @ 00:55

Re: Need help fitting long command line

Postby Osprey » 2017-11-03 @ 00:39

ripsaw8080 wrote:Contrary to your criticism, inserting environment variables in commands does not work from the prompt in real DOS; it only works in batch files. So in terms of compatibility with DOS, official DOSBox gets it right and Daum does not.

That's a bit surprising and I don't have real DOS to confirm, but I was wrong about official DOSBox not supporting it in batch files. I was testing only at the prompt and not in a batch file. I just tested with a batch file and official DOSBox does handle the variables correctly there, which is a big relief.

Scorpion, sorry to lead you off in a wrong direction. You can probably put the Daum version and 4DOS aside, at least for now.

BitWrangler wrote:Can't you just CD up the tree a bit before that line, reduce total length?

I was about to suggest the same thing. All of those "..\.." are taking up length and could be removed if he just changes his working directory.
Last edited by Osprey on 2017-11-03 @ 00:56, edited 1 time in total.
Osprey
Member
 
Posts: 244
Joined: 2017-7-27 @ 21:32

Re: Need help fitting long command line

Postby ripsaw8080 » 2017-11-03 @ 00:53

Well, if you actually have a use for the feature when typing commands at the prompt, it apparently didn't occur to Microsoft.

insert_variable.png
insert_variable.png (3.85 KiB) Viewed 1171 times

BTW, since the OP seems to be compiling something, perhaps adding to the PATH environment variable would remove the need to specify some files on the command line.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4162
Joined: 2006-4-25 @ 23:24

Re: Need help fitting long command line

Postby Scorpion Illuminati » 2017-11-03 @ 02:53

Osprey wrote:
ripsaw8080 wrote:Contrary to your criticism, inserting environment variables in commands does not work from the prompt in real DOS; it only works in batch files. So in terms of compatibility with DOS, official DOSBox gets it right and Daum does not.

That's a bit surprising and I don't have real DOS to confirm, but I was wrong about official DOSBox not supporting it in batch files. I was testing only at the prompt and not in a batch file. I just tested with a batch file and official DOSBox does handle the variables correctly there, which is a big relief.

Scorpion, sorry to lead you off in a wrong direction. You can probably put the Daum version and 4DOS aside, at least for now.

BitWrangler wrote:Can't you just CD up the tree a bit before that line, reduce total length?

I was about to suggest the same thing. All of those "..\.." are taking up length and could be removed if he just changes his working directory.

No worries, was worth a try.

Directory Tree
Code: Select all
c:\foo(root)
 |
asm
|_dosbox
|_win32
|
build
|_dosbox
|_win32
|
src
|_assets
|_framework
...

Trying to keep everything separate and orderly.

I add the mounted drive to the path at compile-time, so it should technically be available but without the ../../ the assembler complains about not finding the files.
Code: Select all
rem ******************************************************************************************************************************************************************************************
rem  add to path here
rem ******************************************************************************************************************************************************************************************
@echo off
rem save the old path
@echo on
SET oldpath=%path%

@echo off
rem set the path to the working folder, otherwise compilation will fail
@echo on
path c:\;%path%

@echo off
rem delete old assembled binary if it exists
@echo on
if exist ..\..\bin\emu\rom.bin del ..\..\bin\emu\rom.bin

@echo off
rem /j set include search directory
rem /p pure binary
rem /k enable if assembler directives
rem /o enable optimisations
rem ow+ optimise absolute long addressing
@echo on
set flags=/o op+,os+,ow+,oz+,oaq+,osq+,omq+
rem ..\..\util\4dos.com /c ..\..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k %flags% ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom
rem ..\..\util\4dos.com /c ..\..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k %flags% ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom > ..\..\logs\emu.log
..\..\asm\dosbox\snasm68k.exe /j ..\..\src\ /p /k %flags% ..\..\src\source.asm,..\..\bin\emu\rom.bin,..\..\bin\emu\rom,..\..\bin\emu\rom > ..\..\logs\emu.log
rem ******************************************************************************************************************************************************************************************
rem remove from path here
rem ******************************************************************************************************************************************************************************************
@echo off
rem restore the old path
@echo on
path %oldpath%
pause


Sincerely,

Scorpion Illuminati
Scorpion Illuminati
Newbie
 
Posts: 5
Joined: 2017-11-02 @ 16:33

Re: Need help fitting long command line

Postby Osprey » 2017-11-03 @ 04:03

What about simply changing to the root folder?

Code: Select all
c:
asm\dosbox\snasm68k.exe /j src\ /p /k %flags% src\source.asm,bin\emu\rom.bin,bin\emu\rom,bin\emu\rom > logs\emu.log

...assuming that the folders are also accessible as c:\asm, c:\bin, etc. (not c:\foo\asm, c:\bin\foo, etc.)
Osprey
Member
 
Posts: 244
Joined: 2017-7-27 @ 21:32

Re: Need help fitting long command line

Postby Scorpion Illuminati » 2017-11-04 @ 05:16

Osprey wrote:What about simply changing to the root folder?

Code: Select all
c:
asm\dosbox\snasm68k.exe /j src\ /p /k %flags% src\source.asm,bin\emu\rom.bin,bin\emu\rom,bin\emu\rom > logs\emu.log

...assuming that the folders are also accessible as c:\asm, c:\bin, etc. (not c:\foo\asm, c:\bin\foo, etc.)

Nope
Code: Select all
@echo off
rem save the old path
@echo on
SET oldpath=%path%

@echo off
rem set the path to the working folder, otherwise compilation will fail
@echo on
path c:\;%path%

@echo off
rem delete old assembled binary if it exists
@echo on
if exist ..\..\bin\emu\rom.bin del ..\..\bin\emu\rom.bin

rem go to root folder
c:

@echo off
rem /j set include search directory
rem /p pure binary
rem /k enable if assembler directives
rem /o enable optimisations
rem ow+ optimise absolute long addressing
@echo on
set flags=/o op+,os+,ow+,oz+,oaq+,osq+,omq+
asm\dos\snasm68k.exe /j src\ /p /k %flags% src\source.asm,bin\emu\rom.bin,bin\emu\rom,bin\emu\rom > logs\emu.log

@echo off
rem restore the old path
@echo on
path %oldpath%
pause

Image

Sincerely,

Scorpion Illuminati
Scorpion Illuminati
Newbie
 
Posts: 5
Joined: 2017-11-02 @ 16:33

Re: Need help fitting long command line

Postby Osprey » 2017-11-04 @ 05:47

I meant for you to run the snasm68k.exe line from the root of C:\. Since you're doing it in a batch file, do:

Code: Select all
cd c:\
asm\dosbox\snasm68k.exe /j src\ /p /k %flags% src\source.asm,bin\emu\rom.bin,bin\emu\rom,bin\emu\rom > logs\emu.log
Osprey
Member
 
Posts: 244
Joined: 2017-7-27 @ 21:32

Re: Need help fitting long command line

Postby Qbix » 2017-11-04 @ 08:03

in your errormessages, there appears to be mostly file not found messages (either the compiler itself, or the files used by it), are you certain that your mount commands are correct (and your includes for your compiler) ?


There is a known bug in dosbox which affects long locations, (in that we check the length before resolving the ..\ ) but then we are talking about a length of 1 element being over 120 characters or so. I doubt that that is happening here. The files not found are
Code: Select all
Warning : Could not open list file '..\..\bin\'

Are nowhere near that length, so my guess is that you might have setup the mounts/includes directories/paths incorrectly. Can you double check those ?
Alternatively, you can download the debug version of DOSBox and look which files are actually being opened (because the errormessage might be wrong)

Let me move the thread to the dosbox section
*moved*
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10522
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Need help fitting long command line

Postby Joey_sw » 2017-11-05 @ 09:17

isn't it ms-dos limiation on Program Segment Prefix, that it can only accept max 127 characters as parmeters?
So most decent compilers would usually work around it by using a text file as replacement for its lenghty parameters option?
-fffuuu
User avatar
Joey_sw
Oldbie
 
Posts: 547
Joined: 2011-8-17 @ 12:03

Re: Need help fitting long command line

Postby ripsaw8080 » 2017-11-05 @ 09:37

Yes, 127 characters is the DOS limit. Compilers can avoid lengthy command lines by setting up a PATH= environment variable that lists all directories containing files that compilation might need.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4162
Joined: 2006-4-25 @ 23:24

Re: Need help fitting long command line

Postby Azarien » 2017-11-19 @ 19:07

It seems that DJGPP environment has some hacks that allow passing long command lines from one DJGPP program to another.
http://www.delorie.com/djgpp/v2faq/faq16_4.html
Azarien
Member
 
Posts: 473
Joined: 2015-5-14 @ 07:14


Return to DOSBox General

Who is online

Users browsing this forum: No registered users and 1 guest