Jump to content
IGNORED

A Problem With DASM


The Cheeto

Recommended Posts

I was following one of the tutorials on the site to basic steps for programing Atari 2600 games, and hit a bit of a snag. I try to open the DASM File and the command prompt opens for a second and closes back down, so then I tried to open command prompt and then run it from there, but when I ran it, it just showed the menu, but I couldn't figure where to go from there. I tried to put in the line "dasm clock003.asm -f3 -oclock.bin" as per instructions(and I made sure to put the clock003.asm file in the same one the dasm program is in), but it didn't work. I've been looking all over the site for how to use the DASM program, but I haven't found it, does anyone know what I could be doing wrong?

Link to comment
Share on other sites

I was following one of the tutorials on the site to basic steps for programing Atari 2600 games, and hit a bit of a snag. I try to open the DASM File and the command prompt opens for a second and closes back down, so then I tried to open command prompt and then run it from there, but when I ran it, it just showed the menu, but I couldn't figure where to go from there. I tried to put in the line "dasm clock003.asm -f3 -oclock.bin" as per instructions(and I made sure to put the clock003.asm file in the same one the dasm program is in), but it didn't work. I've been looking all over the site for how to use the DASM program, but I haven't found it, does anyone know what I could be doing wrong?

Make sure vcs.h and macro.h are also in the same directory. It's also possible there's a problem with the source file. What error message are you getting?

Link to comment
Share on other sites

I try to open the DASM File and the command prompt opens for a second and closes back down, so then I tried to open command prompt and then run it from there, but when I ran it, it just showed the menu, but I couldn't figure where to go from there.

DASM isn't a Windows program. The Windows version does *run* under Windows, but it can't be run all by itself, using just a "dasm.exe" command. It needs command line switches and parameters to tell it what source code file to assemble, what format to output, where to put the resulting object code, etc.

 

DASM doesn't have a Windows GUI or front end, so you can't just double-click on it to "open" it or run it; if you do, Windows just opens a command prompt window for a fraction of a second-- long enough to try to run DASM, and for DASM to display an error-- and then closes the command prompt window so quickly that you don't even have a chance to read what was in it.

 

Alternately, if you manually open a command prompt window and enter "dasm" (or "dasm.exe"), the command prompt window stays open until you manually close it, so you'll be able to see what happens when you enter the command. One of two things will happen:

 

(1) Windows will display the following message:

'dasm' is not recognized as an internal or external command,
operable program or batch file.

That's a true statement, but it's also potentially misleading if you aren't familiar with these sorts of error messages. Yes, Windows doesn't recognize "dasm" (or "dasm.exe"). But DASM definitely *is* an operable program! The key word in the error message is "recognized." This is just Windows' way of saying, "What you talkin' 'bout, user?" In other words, Windows can't find "dasm" (or "dasm.exe"). You can correct that problem in one of three ways:

 

[a] Include the file path for DASM with the "dasm" (or "dasm.exe") command.

 

Change to the drive and directory where DASM is installed before entering the "dasm" command.

 

[c] Add DASM's file path to the "path" environment variable, so Windows will always look there (in addition to everywhere else that it looks) whenever it's trying to locate a program or file that it's been told to "open" or "run" (unless it was told the file path along with the name of the program or file, in which case it will check only in the specified directory).

 

I won't get into adding a directory to the "path" environment variable right now.

 

(2) The other possibility is that DASM will display the following message:

redistributable for non-profit only

DASM sourcefile [options]
-f#	  output format
-oname   output file
-lname   list file
-Lname   list file, containing all passes
-sname   symbol dump
-v#	  verboseness
-t#	  Symbol Table sorting preference (#1 = by address.  default #0 = alphab
etic)
-Dname=exp   define label
-Mname=exp   define label as in EQM
-Idir	search directory for include and incbin
-p#	  max number of passes
-P#	  max number of passes, with less checks
Fatal assembly error: Check command-line format.

In this case, Windows found DASM and ran it, but DASM is telling you that the command to run it wasn't entered properly, and it's showing you what the correct format and available options are.

 

I tried to put in the line "dasm clock003.asm -f3 -oclock.bin" as per instructions(and I made sure to put the clock003.asm file in the same one the dasm program is in), but it didn't work. I've been looking all over the site for how to use the DASM program, but I haven't found it, does anyone know what I could be doing wrong?
What happens is when I run DASM, It shows the sourcefiles options menu and after that it goes back to the c:/Docume~1/HP_ADM~1> as if it wants to run another program, so I put in the line, but it keeps saying that dasm is not recognized as an internal or external command.

Okay, so you're getting the first possibility-- Windows can't find DASM. The easiest way to fix that is to change to the drive and directory where you installed DASM, and *then* enter the command line that you quoted above.

 

However, there's a better way to work with DASM in Windows. Download the free Crimson Editor IDE. Then you can use Crimson Editor to edit your 6502 assembly programs, and set it up to call DASM to assemble those programs. You can also set it up to call Stella or z26 to run the ROM image after the program has been assembled. :)

 

http://www.crimsoneditor.com/

 

To set up Crimson Editor to assemble a 6502 assembly source file using DASM, just start up Crimson Editor, click on the "Tools" menu, and select "Conf. User Tools..." In the scrolling list box, click on the entry you want to set up (you'll usually want to pick the first available line, but you can pick any line).

 

In the "Menu Text:" field, enter the description you want to see on the menu for the new tool (e.g., I used "Assemble 6502 Program" for mine).

 

In the "Command:" field, enter the command to run dasm.exe, including its drive and directory, but leave off the command switches and parameters-- or, better yet, just click the "..." button that's to the right of the "Command:" field, browse to wherever you installed DASM, and "open" it, which will return the correct command to the "Command:" field.

 

In the "Argument:" field, enter the command switches and paramters that DASM will need. This is a bit tricky, because you really want to set it up to assemble *any* source file, rather than a specific one. If you click the ">" button that's to the right of the "Argument:" field, it will display a menu of options that you can select from. The best one to use is "File Path," because that will tell Crimson Editor to send the full file path to DASM, along with the name of the source file you want DASM to assemble. Now click in the "Argument:" field, position the cursor at the very beginning of the "$(FilePath)" entry that Crimson Editor just put in for you, and type a quotation mark. Then position the cursor at the very end and type another quotation mark-- i.e., enclose "$(FilePath)" in quotes. This is so DASM won't get confused if the file path for the source file happens to have a space in it. Now type a space after the second quotation mark, and type in "-f3 -o," followed by another quotation mark. Then click the ">" button again and select "File Path" again. Then click at the end of the second "$(FilePath)" and type ".bin", followed by another quotation mark. When you're done, you should have the following (which, if you prefer, you can simply copy and paste into the "Argument:" field):

"$(FilePath)" -f3 -o"$(FilePath).bin"

 

In the "Initial Dir:" field, type in the file path where DASM is installed (you can copy and paste it from the "Command:" field)-- but do *not* include the "dasm.exe" command; all you want is the drive and directory where DASM is.

 

You can set a "Hot Key" for the new tool if you want, but you don't have to. (If you leave it at "None," the default will be the "Ctrl" key and the number of the list box entry (i.e., "Ctrl+1," or "Ctrl+2," etc.).

 

In the check boxes at the bottom, first *uncheck* "Close on exit" and "Use short filename (8.3)" (if they're checked), and then *check* "Capture output" and "Save before execute."

 

Finally, click "OK" to save the new tool setup. You should now see your new tool listed in the "Tools" menu. To use it, open up the source file that you want to assemble, so it's displayed in the editor. Then click the "Tools" menu and select your new tool.

 

Note that Crimson Editor will assemble whichever source file is being displayed in the active window, and you can have multiple files loaded at once-- so if you've got several files open, be sure to click on the tab for the one you want to assemble, and *then* use your new tool to assemble it.

 

To run the resulting ROM image in Stella or z26, you can either just run Stella or a Windows front end for z26, and select the desired ROM image from the list of available ROMs (browsing to the correct drive and directory if necessary)-- or better yet, you can set up another tool in Crimson Editor. Go through the same steps as before, selecting one of the other available lines in the list box, but this time you should browse to where Stella or z26 is installed, the "Argument:" should be "$(FilePath).bin" (in quotes, just in case there's a space in the directory path), and only the "Close on exit" box should be checked. Note that if you're using z26, there are several command switches for z26 that you might want to include in the "Argument:" field, depending on how you want z26 to run.

 

After you've set up and saved the new tool, just select it from the "Tools" menu, and Crimson Editor will call Stella or z26 to run the assembled ROM image.

 

Michael

Edited by SeaGtGruff
Link to comment
Share on other sites

Thanks a lot for the help, but when I use Crimson Editor, it seems to work by showing

> "C:\Documents and Settings\HP_Administrator\Desktop\Atari\dasm\dasm.exe" "C:\Documents and Settings\HP_Administrator\Desktop\Atari\dasm\clock003.asm" -f3 -o"C:\Documents and Settings\HP_Administrator\Desktop\Atari\dasm\clock003.asm.bin"
> Terminated with exit code 0.

But then after that, I cant find the resulting .bin file in the dasm folder. I made sure to configure the tool like you instruceted, I even copied and pasted the code you posted after it didn't seem to work the fist time just to be safe, but it still just gave me the same thing.

Link to comment
Share on other sites

Thanks a lot for the help, but when I use Crimson Editor, it seems to work by showing
> "C:\Documents and Settings\HP_Administrator\Desktop\Atari\dasm\dasm.exe"
"C:\Documents and Settings\HP_Administrator\Desktop\Atari\dasm\clock003.asm" -f3
-o"C:\Documents and Settings\HP_Administrator\Desktop\Atari\dasm\clock003.asm.bin"
> Terminated with exit code 0.

But then after that, I cant find the resulting .bin file in the dasm folder. I made sure to configure the tool like you instruceted, I even copied and pasted the code you posted after it didn't seem to work the fist time just to be safe, but it still just gave me the same thing.

I don't see any obvious problems with your command line, but when I assemble a source file with DASM, I get the following:

> "C:\Atari2600\bB\dasm.exe"
"C:\Atari2600\bB\Projects\Palette_Selection_Test_1.asm" -f3
-o"C:\Atari2600\bB\Projects\Palette_Selection_Test_1.asm.bin"
-l"C:\Atari2600\bB\Projects\Palette_Selection_Test_1.asm.lst"
DASM V2.20.07, Macro Assembler (C)1988-2003
Complete.

> Terminated with exit code 0.

You can ignore the part that begins with "-l," as that's an additional switch that I like to include to tell DASM to generate a program listing while it's doing the assembly.

 

The significant thing to notice here is that I get

DASM V2.20.07, Macro Assembler (C)1988-2003
Complete.

and you don't. That makes me wonder if DASM is being run at all. Is dasm.exe still in the folder, and is it the correct date/time/size? I'm wondering if it got corrupted somehow while you were trying to make it work before. Also, make sure you're running the DOS/Windows version of dasm.exe-- the zip file may contain versions for various operating systems, so look in the subdirectories to get the right version for your operating system-- and I suggest that you use version 2.20.07 if you aren't already, because the newer version(s) seem to have a quirk that can cause bogus error messages in certain situations.

 

Michael

Edited by SeaGtGruff
Link to comment
Share on other sites

That seemed to do the trick, I replaced the dasm files that I got off of the tutorial, and replaced them with the ver. 2.20.07 files, and it worked perfectly :)

 

As soon as I get ahold of the programming side of things, I gonna try to make a few basic games myself, I took a 2 week course in visual basic programing at my vocational school(they made us take all of the classes for a couple weeks before they let us go to the cass we signed up for, but I wasn't complaining :P ) and hopefully some of that will help out.

 

edit for great typo justice

Edited by The Cheeto
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...