Cassidy Nolen Posted May 29, 2003 Share Posted May 29, 2003 Ok, I have reread this a thousand times, and I am not sure what to "do" with the source code. I can get the binary to work in my emulator, but I don't know what I'm supposed to be doing. Basically, can someone walk me once through how to turn the source code (and where it is supposed to be) into a .bin? I have TextPad for an editor, and just assume I have no idea what I am doing with it. DASM makes .bin files, out of sourcecode, right? Where should I be putting/entering the source code. I know I can get this, I am just confused where to put what, and what program I should be using. Can I write the sourcecode right into DASM? If so, do I need a text editor at all? Forgive my newbie question...I promise I understand what the commands for the 6502 are, and I understand a good bit of what has been stated here. Thanks, I really appreciate the help. Great stuff on this board! Andrew, you are the man. Cassidy Link to comment Share on other sites More sharing options...
Nukey Shay Posted May 30, 2003 Share Posted May 30, 2003 dasm source.s -f3 -osource.bin That is what the command line looks like. It will create a binary file (called source.bin in this example) that is compatable with Z26 from the source code (called source.s in this example). The source code is just a text file with NO formatting...just a plain old EDIT or Notepad file. The reason for using source files opposed to debug files is that it makes things easier for you, the human. With a souce file, you can easily make alterations to the program (otherwise you'd spend ages updating all the changed addresses "by hand"), insert comments in plain English for lines explaining what they do, and more easily transport routines from one 6502 system to another (though this is still difficult to pull off when the tricky 2600 is involved). Link to comment Share on other sites More sharing options...
Nukey Shay Posted May 30, 2003 Share Posted May 30, 2003 Oh...using the above example, it assumes that your source file is in the same folder as Dasm's files. And it will create a .bin in that folder as well. Link to comment Share on other sites More sharing options...
+Andrew Davie Posted May 30, 2003 Share Posted May 30, 2003 Ok, I have reread this a thousand times, and I am not sure what to "do" with the source code. I can get the binary to work in my emulator, but I don't know what I'm supposed to be doing. Basically, can someone walk me once through how to turn the source code (and where it is supposed to be) into a .bin? I have TextPad for an editor, and just assume I have no idea what I am doing with it. DASM makes .bin files, out of sourcecode, right? Where should I be putting/entering the source code. I know I can get this, I am just confused where to put what, and what program I should be using. Can I write the sourcecode right into DASM? If so, do I need a text editor at all? Forgive my newbie question...I promise I understand what the commands for the 6502 are, and I understand a good bit of what has been stated here. Thanks, I really appreciate the help. Great stuff on this board! Andrew, you are the man. Cassidy Let's make it as easy as possible. Unzip the DASM files into one directory. Also place the companion '2600 support files (from the DASM page at http://www.atari2600.org/dasm) in the same directory. Now use a text editor to create a new file. Enter the latest source code in there (a cut/paste from your browser is fine). Now save the file as "test.asm". Exit the text editor. Now go to a DOS command-line (or Mac equivalent). Type "dasm test.asm -f3 -v5 -otest.bin" without the quotes. This should cause DASM to assemble your file. If there are no errors, it will create a file called "test.bin" you can view in your emulator. Then you repeat the process. Edit the text file "test.asm". Save it. Run DASM by typing that line again. Test the binary on the emulator. Repeat. Much of this can be automated, by integration into an IDE like Microsoft Developer Studio. There's also a sample IDE to download/test on the DASM page. Good luck! PS: Here's the latest source code. Cut this, paste to "test.asm"... processor 6502 include "vcs.h" include "macro.h" ;------------------------------------------------------------ SEG ORG $F000 Reset ; Clear RAM and all TIA registers ldx #0 lda #0 Clear sta 0,x inx bne Clear StartOfFrame ; Start of vertical blank processing lda #0 sta VBLANK lda #2 sta VSYNC sta WSYNC sta WSYNC sta WSYNC ; 3 scanlines of VSYNC signal lda #0 sta VSYNC ; 37 scanlines of vertical blank... ldx #0 VerticalBlank sta WSYNC inx cpx #37 bne VerticalBlank ; 192 scanlines of picture... ldx #0 Picture SLEEP 20 ; adjust as required! inx stx COLUBK SLEEP 2 ; adjust as required! txa eor #$FF sta COLUBK sta WSYNC cpx #192 bne Picture lda #%01000010 sta VBLANK ; end of screen - enter blanking ; 30 scanlines of overscan... ldx #0 Overscan sta WSYNC inx cpx #30 bne Overscan jmp StartOfFrame ;------------------------------------------------------------ ORG $FFFA InterruptVectors .word Reset ; NMI .word Reset ; RESET .word Reset ; IRQ END Link to comment Share on other sites More sharing options...
Ranthulfr Posted May 30, 2003 Share Posted May 30, 2003 Andrew, your tutorials are excellent. Please keep up the good work. Cassidy, you asked a good question which others may be struggling with. I only figured out how to get DASM going a couple of days ago myself. Here are some extra notes that would have helped me: Unzip the DASM files into one directory. Also place the companion '2600 support files (from the DASM page at http://www.atari2600.org/dasm) in the same directory. Now use a text editor to create a new file. Enter the latest source code in there (a cut/paste from your browser is fine). Now save the file as "test.asm". Exit the text editor. You can do all those things in Windows. Let's say you put everything in a directory (folder) called "Atari"... Now go to a DOS command-line (or Mac equivalent). In windows, go to Programs then select MS-DOS Prompt. At the command line type "cd Atari" to enter the directory containing DASM and the other files. Type "dasm test.asm -f3 -v5 -otest.bin" without the quotes. dasm - tells the computer to run DASM test.asm - tells DASM which file to start with -otest.bin - tells DASM the file to output Type "exit" to quit MS-DOS. The bin file you just compiled should be in the Atari folder you created. Anyone, feel free to correct me on any of this. Link to comment Share on other sites More sharing options...
Happy_Dude Posted May 30, 2003 Share Posted May 30, 2003 Type "dasm test.asm -f3 -v5 -otest.bin" without the quotes. dasm - tells the computer to run DASM test.asm - tells DASM which file to start with -otest.bin - tells DASM the file to output -f3 - tells DASM how to compile the code (All I know is it makes the .bin work ) -v5 - DASM lists all macros in your source and tells you which where referenced. Link to comment Share on other sites More sharing options...
wapchimp Posted June 3, 2003 Share Posted June 3, 2003 @Randy - yeh hey - I followed your instructions (after 10mins trying to work out DOS prompts - I aint got a clue) & it worked - got a a.out file - whatever that is I also now have test.bin & kernel.bin files - if I drop the kernel file onto the emualtor I get a black screen I'm no good at this Link to comment Share on other sites More sharing options...
Cybergoth Posted June 4, 2003 Share Posted June 4, 2003 Hi there! I have TextPad for an editor, and just assume I have no idea what I am doing with it. DASM makes .bin files, out of sourcecode, right? Where should I be putting/entering the source code. Since you're using textpad to read and study the sources, try customizing it! It's easy! Go to Configuration / Preferences / Extras And add commands for DASM and Z26 like this: Hope it is understandable evem with all the German text. Well, if you did that, you can compile with CTRL-1 and launch the binary with CTRL-2. If you're also using Andrews latest DASM, double clicking on an error in the results page will even jump you to the according line in the source file. Greetings, Manuel Link to comment Share on other sites More sharing options...
DensB68 Posted November 16, 2003 Share Posted November 16, 2003 Hi everyone! Please help me. I'm trying to run dasm 22007 on windows XP. I have downloaded dasm and support files (vcs.h and macro.h) onto my harddrive. I am using textpad for an editor. I have put the latest source code in the dasm files as test.asm. When I use the command prompt to run dasm, it does not work. So my question is there anyone who could explain to me how to get to get this to work? Is it a problem with windows xp? I have read the post by Andrew to Cassidy earlier and tried doing it that way with no avail. Does anyone know how I can test dasm? Thanks!! Dennis Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted November 16, 2003 Share Posted November 16, 2003 Does anyone know how I can test dasm?Thanks!! There must be some output on the console screen. Please post that too, it would help a lot identifying your problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.