Jump to content
IGNORED

Help with installing dasm


Jamesapp

Recommended Posts

Hello,

 

I could use some help with dasm i went to the main site and downloaded the latest version.

 

My question is how do i set up the assembler? Can i use it in dos, i tried to load dasm onto freedos which is a dos emulator on my mac. But when i type make i get an error message.

 

I have tried testing dasm where the directory that contained dasm.exe is, but when i go to test it i get an error this cant be run in dos mode.

 

Does anyone know if dasm can be installed for dos? Or what i am doing wrong? Or a link to a tutorial of how to install and set up dasm?

Link to comment
Share on other sites

There's not really anything to install, just put the dasm.exe file in whatever directory you want to keep it in.

 

You can't just "run" dasm by itself per se. What I mean is, you must give it command line parameters to tell it what you want it to assemble.

 

For example, suppose you have a text file named "mygame.asm" containing assembly code for a game you've written. To keep this simple, let's assume you've put dasm.exe and your mygame.asm file in the same folder. To assemble it with dasm you could open a command prompt window, change directories so you're in the folder where you've got dasm.exe and mygame.asm, then enter a command something like the following:

 

dasm mygame.asm -f3 -omygame.bin

 

The first command line parameter after "dasm" is the name of the file you want to assemble.

 

The remaining command line parameters can be in any order, as the letter after the dash tells dasm what the parameter is.

 

The -o parameter tells dasm what you want the output file (resulting object file) to be named.

 

The -f parameter tells dasm what format to use for the output file. For an Atari 2600 or Atari 7800 game you'll want to use -f3, which is the "raw" format-- no file header, and the object file will be a single chunk of contiguous code.

 

You can include full file paths with the file names if you need to (if everything isn't going to be in the same folder as the dasm.exe program), but if there are any spaces in the file paths or file names then you'll need to enclose them in quotes, as in the following example:

 

"c:\dasm folder\dasm.exe" "c:\my programming stuff\my game.asm" -f3 -o"c:\my programming stuff\my game.bin"

 

Since dasm can assemble different types of assembly code, your assembly program will need to start with a "processor" instruction to tell it which processor (type of assembly language) you're assembling for, such as

 

  processor 6502

 

This should be the first line of your program, before any other code.

 

Since dasm is just an assembler, not an editor, and since you have to use a command line with parameters to "run" dasm (i.e., to assemble something with it), you may want to get an IDE to do your programming in, then set up a user-defined tool in the IDE that will call dasm with the appropriate parameters. I like to use Crimson Editor because it's free and is fairly full-featured as free IDEs go, but other people like to use other IDEs or editors. You can set up one tool for calling dasm to assemble your programs, and another tool for calling an emulator to run your assembled programs.

 

All you really need is a text editor-- for instance, Notepad in Windows would work fine. Then you can either open a command prompt and type a suitable command line to assemble your code, or make a batch file to help simplify it for you.

 

Before anyone tries to give you more specific guidance, you might want to decide on what sort of environment or setup you want to use-- for example, a particular IDE, or Notepad and some batch files, or whatever.

Link to comment
Share on other sites

Hello,

Thanks for the reply.

 

I now am using dasm on my mac with the terminal program.

 

I tried to assemble a sample program, clock.asm. I was following a small tutorial on installing and testing dasm on a mac.

 

I have dasm-2.20.11. And i also have stella as an emulator on my mac.

 

The tutorial suggested trying to assemble a clock program. I found the program and copied it into text edit on my mac and called it clock.asm. I ran:

 

dasm clock.asm -f3 -oclock.bin

 

When i ran that command in terminal on my mac. I got like 5 errors one error is:

 

clock.asm (21): error: Processor '6502\' not supported.

Aborting assembly

 

Terminal did create a .bin file, but when i go to open the .bin in stella i geat an error:

 

Error creating console (check ROM file/bankswitch scheme)

 

I am trying to test dasm and stella. The clock program i cant get to run though? Any idea what i am doing wrong?

Link to comment
Share on other sites

If your going to try 7800 programming on the Mac, go get yourself Mads and Eclipse. They are in the 8-bit/5200 programming section. It will save you a lot of time. It was actually easier to get a sample program working than using DASM with OS X's terminal program. Watch the Youtube videos on how to use Eclipse with Mads. It's amazing.

 

For example, when you compile a program with Eclipse, it compiles the program and runs it in the emulator all in one click. Try it. You will not be disappointed.

 

Allan

Link to comment
Share on other sites

The tutorial suggested trying to assemble a clock program. I found the program and copied it into text edit on my mac and called it clock.asm. I ran:

 

dasm clock.asm -f3 -oclock.bin

 

When i ran that command in terminal on my mac. I got like 5 errors one error is:

 

clock.asm (21): error: Processor '6502\' not supported.

Aborting assembly

The error is saying that the "processor 6502" line has an error in it-- there's a backslash at the end ("processor 6502\"). Remove the backslash and try assembling again.

 

Note that different computer operating systems (Windows, Unix, Mac, etc.) may use different line termination characters. If you take a text file that was created in one operating system and try to use it in another operating system, you may need to use some kind of conversion program to change the line termination characters. For example, DOS and Windows use a carriage return-line feed (CR-LF) combination, hex characters $0D and $0A. Unix and Linux use line feed (hex $0A) by itself. I think Mac uses carriage return (hex $0D) by itself. When you try to use a text file from one operating system and try to use it in a different operating system, the extra (or missing) characters can create problems, such as lines that run together rather than being separated properly, or extra characters that show up at the end of each line. I don't know if this is part of why you're having trouble, but if you open the clock.asm file and it doesn't look right (it should be just a simple text file), try converting it to use the Mac's line termination characters. There are lots of little utility programs out there for that.

 

Also, make sure you're using the Mac version of dasm.

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