Jump to content



0

Help on Session 8! Please!


9 replies to this topic

#1 Cassidy Nolen OFFLINE  

Cassidy Nolen

    River Patroller

  • 2,725 posts
  • Location:Virginia, Just south of DC

Posted Thu May 29, 2003 5:54 PM

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

#2 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Thu May 29, 2003 6:39 PM

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

#3 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Thu May 29, 2003 6:43 PM

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.

#4 Andrew Davie OFFLINE  

Andrew Davie

    Stargunner

  • 1,314 posts
  • Location:Tasmania

Posted Thu May 29, 2003 6:48 PM

Cassidy Nolen said:

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 





#5 Ranthulfr OFFLINE  

Ranthulfr

    Dragonstomper

  • 534 posts
  • Location:USA

Posted Thu May 29, 2003 9:15 PM

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:

Andrew Davie said:

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

Andrew Davie said:

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.

Andrew Davie said:

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.

#6 Happy_Dude OFFLINE  

Happy_Dude

    River Patroller

  • 4,208 posts
  • Forum Slacker
  • Location:Sydney, Australia

Posted Fri May 30, 2003 12:26 AM

Randy said:

Andrew Davie said:

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.

#7 wapchimp OFFLINE  

wapchimp

    Chopper Commander

  • 241 posts
  • Location:Sunny Old England

Posted Tue Jun 3, 2003 3:32 PM

@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 :roll:

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

#8 Cybergoth OFFLINE  

Cybergoth

    Quadrunner

  • 8,207 posts
  • This is Sparta!
  • Location:Bavaria

Posted Tue Jun 3, 2003 11:52 PM

Hi there!

Cassidy Nolen said:

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:

Posted Image
Posted Image

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.

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

#9 DensB68 OFFLINE  

DensB68

    Star Raider

  • 93 posts
  • Location:Shady Spring WV

Posted Sat Nov 15, 2003 6:20 PM

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

#10 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Sun Nov 16, 2003 2:08 AM

DBMB said:

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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users