VOGONS

Common searches


First post, by Scorpion Illuminati

User metadata
Rank Newbie
Rank
Newbie

I am using the following batch file to assemble my game:

@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 lis […]
Show full quote

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

/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:

@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

Reply 1 of 17, by Osprey

User metadata
Rank Member
Rank
Member

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...

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.

Reply 2 of 17, by Scorpion Illuminati

User metadata
Rank Newbie
Rank
Newbie
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. […]
Show full quote

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...

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

Reply 3 of 17, by Osprey

User metadata
Rank Member
Rank
Member
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: HOW-TO Use the FOR command (+ other missing DOS commands) & automate ISO mounting

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.

Reply 4 of 17, by Scorpion Illuminati

User metadata
Rank Newbie
Rank
Newbie
@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 lis […]
Show full quote

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

r5YrpxL.png
No Dice unfortunately, even though it looks like it's being concatenated correctly. Trying your suggestion to use 4DOS:

@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

Reply 5 of 17, by collector

User metadata
Rank l33t
Rank
l33t

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.

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 6 of 17, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
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.

Reply 7 of 17, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++

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

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.

Reply 8 of 17, by Osprey

User metadata
Rank Member
Rank
Member
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.

Reply 9 of 17, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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
Filename
insert_variable.png
File size
3.85 KiB
Views
1935 views
File license
Fair use/fair dealing exception

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.

Reply 10 of 17, by Scorpion Illuminati

User metadata
Rank Newbie
Rank
Newbie
Osprey wrote:
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 f […]
Show full quote
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

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.

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

Reply 11 of 17, by Osprey

User metadata
Rank Member
Rank
Member

What about simply changing to the root folder?

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.)

Reply 12 of 17, by Scorpion Illuminati

User metadata
Rank Newbie
Rank
Newbie
Osprey wrote:
What about simply changing to the root folder? […]
Show full quote

What about simply changing to the root folder?

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

@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

FUwo46s.png

Sincerely,

Scorpion Illuminati

Reply 13 of 17, by Osprey

User metadata
Rank Member
Rank
Member

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:

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

Reply 14 of 17, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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

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!

Reply 15 of 17, by Joey_sw

User metadata
Rank Oldbie
Rank
Oldbie

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

Reply 16 of 17, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

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.