Jump to content
IGNORED

10-25-08 bAtari Basic build?


yuppicide

Recommended Posts

OK. I already searched the .bas files, and it isn't in any of them. I just now tried to compile draw.bas, a sample program that comes with bB. Here is all that draw.bas.asm says:

 

Bad Command or File name

 

Here is what is in draw.bas.lst

 

------- FILE C:\PROGRA~1\ATARI2~1\bB\samples\draw.bas.asm LEVEL 1 PASS 1

C:\PROGRA~1\ATARI2~1\bB\samples\draw.bas.asm (1): error: Unknown Mnemonic 'Command'.

1 0000 Bad Command or file name

Sounds like the batch file isn't finding one or more of the executables.

 

Are your environment variables and path set properly?

Link to comment
Share on other sites

I played around with the environmental variables. Now I get this:

 

---------- Capture Output ----------

> "C:\Program Files\Atari2600\bB\2600bas.bat" C:\PROGRA~1\ATARI2~1\bB\samples\draw.bas

Files\Atari2600\bB was unexpected at this time.

 

> Terminated with exit code 255.

 

Edit: I see somebody else is having this problem. I'll follow the advice in that thread to try and fix it.

Edited by jbs30000
Link to comment
Share on other sites

Well crap. I don't know. I'll just give my computer info, and if anybody has any idea, great. If not, then I had fun writing bB programs.

 

I have Windows XP Pro.

I use Crimson Editor.

My bB files are in C:\Program Files\Atari2600\bB

I set the environmental variables through My Computer. I have tried both with quotes and without quotes.

I put quotes on $(FilePath) in the Crimson Editor user tool to compile programs.

 

Everything was working until recently. I don't know what could have changed.

Link to comment
Share on other sites

I think the problem is due to spaces in the directories. I would move your files out of "Program Files" and put them in a directory without spaces, since it seems the batch file doesn't like the space. It's not clear if the other member actually moved his files or if he just changed something in Crimson Editor.

Link to comment
Share on other sites

OK, I started over pretty much.

1) I re-downloaded the v1.0 from http://bataribasic.com/download.html

2) I put the files and folders in C:\bB

3) I set the Environment Variables as shown in the pic below.

4) My Crimson Editor User Tools settings are in the other pic.

5) Trying to compile the draw.bas file that comes with the bB download gets me:

---------- Capture Output ----------

> "C:\bB\2600bas.bat" C:\bB\samples\draw.bas

DASM V2.20.07, Macro Assembler ©1988-2003

C:\bB\samples\draw.bas.asm (1): error: Unknown Mnemonic 'Command'.

Complete.

 

> Terminated with exit code 0.

 

post-12524-1229550512_thumb.jpg post-12524-1229550524_thumb.jpg

Link to comment
Share on other sites

---------- Capture Output ----------

> "C:\bB\2600bas.bat" C:\bB\samples\draw.bas

DASM V2.20.07, Macro Assembler ©1988-2003

C:\bB\samples\draw.bas.asm (1): error: Unknown Mnemonic 'Command'.

Complete.

 

> Terminated with exit code 0.

I think we need to determine if it's Crimson Editor settings (which I can't help you with) or something else. Try editing the 2600bas.bat file and remove "echo off" so it spits out what it's doing.

 

You can also try to go to the command prompt, switch to the bB/samples folder, and type 2600bas draw.bas and see what you get. If it doesn't work, type "set" to see the environment variables to make sure they are set.

Link to comment
Share on other sites

You know, I got to thinking, I think there was a change or two I made to my last 2600bas.bat which made things work, which is why, when it got overwritten with a new 2600bas.bat, it quit working. Anyway, good idea about taking out the echo off. I'm pretty sure its with my bB setup, and not Crimson Editor.

 

OK, here's the output:

 

---------- Capture Output ----------

> "C:\bB\2600bas.bat" C:\bB\samples\draw.bas

 

C:\bB>if XC:\bB == X goto nobb

 

C:\bB>if exist sed.exe goto havesed

 

C:\bB>preprocess 0<C:\bB\samples\draw.bas | 2600basic.exe -i C:\bB 1>bB.asm

 

C:\bB>if errorlevel 1 goto bBerror

 

C:\bB>if X == X-O goto optimize

 

C:\bB>postprocess -i C:\bB 1>C:\bB\samples\draw.bas.asm

 

C:\bB>goto nooptimize

 

C:\bB>dasm C:\bB\samples\draw.bas.asm -IC:\bB/includes -f3 -oC:\bB\samples\draw.bas.bin | sed "/Label mismatch/d" | sed "/shakescreen/d;/rand16/d;/debugscore/d;/pfscore/d;/noscore/d;/vblank_bB_code/d;/PFcolorandheight/d;/pfrowheight/d;/pfres/d;/PFmaskvalue/d;/overscan_time/d;/vblank_time/d;/no_blank_lines/d;/superchip/d;/ROM2k/d;/NO_ILLEGAL_OPCODES/d;/minikernel/d;/debugcycles/d;/mincycles/d;/legacy/d;/PFcolors/d;/playercolors/d;/player1colors/d;/backgroundchange/d;/readpaddle/d;/multisprite/d;/PFheights/d;/bankswitch/d;/Unresolved Symbols/d" | sed "2,/-->/!{ /-->/,/-->/d; }" | sed "s/--> 0./Possible duplicate label: /"

DASM V2.20.07, Macro Assembler ©1988-2003

C:\bB\samples\draw.bas.asm (1): error: Unknown Mnemonic 'Command'.

Complete.

 

C:\bB>rem yes, I know :) This is the first attempt to make DASM's output more useful!

 

C:\bB>goto end

 

> Terminated with exit code 0.

Link to comment
Share on other sites

You know, I got to thinking, I think there was a change or two I made to my last 2600bas.bat which made things work, which is why, when it got overwritten with a new 2600bas.bat, it quit working. Anyway, good idea about taking out the echo off. I'm pretty sure its with my bB setup, and not Crimson Editor.

It's possible your version of Windows doesn't like the batch file, though I can't remember what changes were suggested.

 

Can you check the output of bB.asm to see if that built successfully? That will tell me which line or lines of the batch file are giving you problems.

Link to comment
Share on other sites

All it says is:

Bad Command or file name

 

I'll search the message board for any necessary changes that should be made, or any problems I've had before, or similar problems other people have had. It worked until a few months ago, so I'm sure there must be something I need to change either in 2600bas.bat, or something like that.

Link to comment
Share on other sites

All it says is:

Bad Command or file name

 

I'll search the message board for any necessary changes that should be made, or any problems I've had before, or similar problems other people have had. It worked until a few months ago, so I'm sure there must be something I need to change either in 2600bas.bat, or something like that.

I've been doing investigating, and it seems to be due to a "feature" added with XP Pro and later M$ stuff that was intended to allow one to capture stdout and stderr, but instead, Windows mucks everything up.

 

There are solutions that will fix XP Pro, but they break everything else. I'm looking for a universal solution.

Link to comment
Share on other sites

It looks like the only real fix would involve two separate files for DOS/older Windows and WinXP and later, or some way to detect the version of Windows within a batch file.

 

For now, why don't you try changing the line with:

preprocess <%1 | 2600basic.exe -i %bB%>bB.asm

 

To two lines:

preprocess <%1>pre.asm

2600basic.exe -i %bB%<pre.asm>bB.asm

 

I don't like this solution since it involves creating another file, but if it works, it works.

Link to comment
Share on other sites

It looks like the only real fix would involve two separate files for DOS/older Windows and WinXP and later, or some way to detect the version of Windows within a batch file.

 

For now, why don't you try changing the line with:

preprocess <%1 | 2600basic.exe -i %bB%>bB.asm

 

To two lines:

preprocess <%1>pre.asm

2600basic.exe -i %bB%<pre.asm>bB.asm

 

I don't like this solution since it involves creating another file, but if it works, it works.

That's exactly what I had to do when I want to parse compilation errors for VisualbB. I couldn't get it to work any other way.

 

-Jeff

Link to comment
Share on other sites

Thanks, but that didn't work either.

Two questions:

  1. Which program, or programs, is having a problem with XP Pro?
  2. Does bB work under DOS 6.22?

Yes, though lack of long filenames is a pain. bB works under Win2k and older, and probably XP Home as well.

 

I know there are Vista users as well so it's possible that it's all XP Pro.

 

Why don't you try one last thing - put "set" in your batch file so you can see what environment variables the batch file actually sees.

 

Last resort, I have a hacked Win2k cmd.exe shell that will run under other versions of Windows. It's just a matter of finding it.

Link to comment
Share on other sites

This will be my last post on this topic for a while. I'll do some investigating on my own to see if it's me, or XP Pro that is the problem. Oh, and I tried 2600bas from a command prompt and got the same problem, so it's not Crimson Editor.

 

I don't remember when I switched from XP Home to XP Pro, so I don't remember if the last time bB worked, which version I had. I know for a fact it works with the Home edition, so if it is XP that's the problem, then it's the Pro edition, and not the Home.

 

My memory is usually crap, and I'm not really coming up with anything in my searches, but I want to do a quick review on downloading and setting up.

 

1. Download the zip file.

2. Unzip it in a directory of your choosing.

3. Set the bB variable as the path to the directory, and add that directory to the path variable.

4. Copy sed.exe from its own directory to the main bB directory.

5. You're ready to go.

 

Now, is there anything I missed?

Link to comment
Share on other sites

This will be my last post on this topic for a while. I'll do some investigating on my own to see if it's me, or XP Pro that is the problem. Oh, and I tried 2600bas from a command prompt and got the same problem, so it's not Crimson Editor.

 

I don't remember when I switched from XP Home to XP Pro, so I don't remember if the last time bB worked, which version I had. I know for a fact it works with the Home edition, so if it is XP that's the problem, then it's the Pro edition, and not the Home.

 

My memory is usually crap, and I'm not really coming up with anything in my searches, but I want to do a quick review on downloading and setting up.

 

1. Download the zip file.

2. Unzip it in a directory of your choosing.

3. Set the bB variable as the path to the directory, and add that directory to the path variable.

4. Copy sed.exe from its own directory to the main bB directory.

5. You're ready to go.

 

Now, is there anything I missed?

Yes, that's basically it. I need to try this out on a computer with XP Pro to figure out the proper way to solve this. Are you using regular XP Pro, or XP Pro x64?

 

I'm pretty sure it's a problem with batch file processing in XP Pro. I found a page where someone was having exactly the same problem with batch files, but nobody posted a solution. Still, it would be good to rule out a path or environment issue. If you go to the command prompt and type "set," do you see "bB" and "path" set properly? If not, I suppose you could add set bB=c:\bB and set path=%path%;%bB% to the batch file for now.

Link to comment
Share on other sites

Yes, I tried the set, and the bB directory is in there. I also tried putting c:\bB\ in front of any references to .exe files (I.E. preprocess becomes c:\bB\preprocess) but that didn't work either.

 

If you found a similar problem then I guess it's the Pro version of Windows that's the problem, as I know for a fact that I had no problems when I was using the Home edition.

 

I have a couple of Ideas I'll try, and if either one works, I'll let you know.

Link to comment
Share on other sites

OK, for whatever reason, even after making a copy of 2600bas.bat changing all the program names to their 8.3 equivalents and putting the cwsdpmi files in the bB directory, it turns out that you can't compile a bB program under DosBox.

 

Before that, I thought I'd manually go through the compiling process to see which program was the sticking point. Turns out that right off the bat that preprocess doesn't work.

 

I looked at the source code of preprocess, but I've never used lex (or yacc either), and I'm not quiet sure what the program is supposed to do. I'm sure it's pretty obvious, but not to me :(. Would you mind explaining it for me? Thanks.

Link to comment
Share on other sites

OK, for whatever reason, even after making a copy of 2600bas.bat changing all the program names to their 8.3 equivalents and putting the cwsdpmi files in the bB directory, it turns out that you can't compile a bB program under DosBox.

 

Before that, I thought I'd manually go through the compiling process to see which program was the sticking point. Turns out that right off the bat that preprocess doesn't work.

 

I looked at the source code of preprocess, but I've never used lex (or yacc either), and I'm not quiet sure what the program is supposed to do. I'm sure it's pretty obvious, but not to me :(. Would you mind explaining it for me? Thanks.

Are you using the 2600bas.bat file that I recently (re)posted in another thread? It has some minor spacing changes, and a few other changes (notably changing forward-slashes to back-slashes where appropriate), that apparently are needed for certain versions of MS-DOS and/or MS-Windows. The command line that runs preprocess.exe was one of the lines I had to make minor spacing changes to.

 

Michael

Link to comment
Share on other sites

If you're talking about This, then yes. But I typed in the preprocessor part by itself

preprocess.exe < .\samples\draw.bas | 2600basic.exe -i %bB% > bB.asm

 

bB.asm only contains: Bad Command or file name

Yep, that's what I meant.

 

Which OS are you using? Why are you using DOSBox?

 

I happen to have DOSBox (0.72) on this computer, although I haven't been using it. I'll try compiling something myself in DOSBox and see what happens. But what is the command line you're entering, so I can try using the same one?

 

Michael

Link to comment
Share on other sites

OK, for whatever reason, even after making a copy of 2600bas.bat changing all the program names to their 8.3 equivalents and putting the cwsdpmi files in the bB directory, it turns out that you can't compile a bB program under DosBox.

 

Before that, I thought I'd manually go through the compiling process to see which program was the sticking point. Turns out that right off the bat that preprocess doesn't work.

 

I looked at the source code of preprocess, but I've never used lex (or yacc either), and I'm not quiet sure what the program is supposed to do. I'm sure it's pretty obvious, but not to me :(. Would you mind explaining it for me? Thanks.

DOSBox worked the last time I tried it. You need to do more than just rename source files and use cwsdpmi.exe. This is from the bB Command Reference:

Although batari Basic is a command-line program, you are expected to run it under Windows 95 or later because it requires a DPMI (DOS protected mode interface) and uses long filenames. If you wish to run under pure DOS, however, you can, but you will need to:

 

* obtain a DPMI program, such as cwsdpmi.exe, and run this before running batari Basic.

* rename all filenames to 8.3 format

* edit includes files to point to renamed files above

* use the command-line parameter -r to specify an alternate variable redefinition file that conforms to 8.3.

I thought it is also interesting to note that DOSBox 0.72 can run Windows 95 (though the pre-built disk image was a little hard to find) so I suppose one could do that instead :)

 

Did you try the Win2k command prompt I PM'ed you?

 

Anyway, preprocess.lex takes the raw code as an input stream, tokenizes it and outputs formatted code that the compiler can understand. It doesn't open any files. I think the error is from the batch file itself, not in any bB programs. The batch is apparently not running preprocess, 2600basic, or postprocess at all because it somehow can't find the files, and simply passing the DOS error message to bB.asm.

Link to comment
Share on other sites

Well, I found a way to work around the problem. I put a virtual Windows 98 machine on my computer. bB on that machine works great. :cool:

 

Crimson Editor on the other hand....The CEDT.EXE file is linked to missing export MFC42.DLL-6877

Even downloading the MFC42.DLL file doesn't make a difference. But no biggie, there are other editors I can use, and I finally got bB working again. :)

Edited by jbs30000
Link to comment
Share on other sites

But no biggie, there are other editors I can use, and I finally got bB working again. :)

Have you tried Visual batari Basic:

 

http://www.atariage.com/forums/index.php?showtopic=123849

 

http://www.randomterrain.com/atari-2600-me...-basic-vbb.html

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...