Jump to content



0

DASM issues


19 replies to this topic

#1 johnon OFFLINE  

johnon

    Chopper Commander

  • 241 posts
  • Aspiring 2600 Developer
  • Location:South Carolina, US

Posted Tue Mar 30, 2010 5:07 PM

So, I've been posting in the general Atari 2600 Programming forum recently, but I figured this would be more appropriate here.

Alright, so I've been going along with Andrew Davie's tutorial (as recommended) for the past few days, taking it piece by piece and today I sat down and I've been at it for...a good 6 hours today, I'd say.

The problem I've been having is that, with any of the code used in the tutorial, even with vcs.h and macro.h specifically placed with the DASM.exe binary, I've been having issues with getting a lot of undefined variables during compilation.

By contrast, I'm noticing that Adventure's source code (which lists all of the Atari 2600 constants at the top of the source file), compiles happily and spits out no errors.

I could easily just copy and paste all of the constants every time I go to assemble something, but out of practice, I figure it's a good idea to find out what's going on.

#2 GroovyBee OFFLINE  

GroovyBee

    7800 Developer

  • 5,781 posts
  • Busy bee!
  • Location:North, England

Posted Tue Mar 30, 2010 5:11 PM

View Postjohnon, on Tue Mar 30, 2010 5:07 PM, said:

The problem I've been having is that, with any of the code used in the tutorial, even with vcs.h and macro.h specifically placed with the DASM.exe binary, I've been having issues with getting a lot of undefined variables during compilation.

How are you including the files? Is DASM.EXE and your source and the *.h files all in the same directory? Have you got an ORG statement? Are you using "=" or "EQU" as label assignments?

#3 johnon OFFLINE  

johnon

    Chopper Commander

  • 241 posts
  • Aspiring 2600 Developer
  • Location:South Carolina, US

Posted Tue Mar 30, 2010 5:23 PM

View PostGroovyBee, on Tue Mar 30, 2010 5:11 PM, said:

View Postjohnon, on Tue Mar 30, 2010 5:07 PM, said:

The problem I've been having is that, with any of the code used in the tutorial, even with vcs.h and macro.h specifically placed with the DASM.exe binary, I've been having issues with getting a lot of undefined variables during compilation.

How are you including the files? Is DASM.EXE and your source and the *.h files all in the same directory? Have you got an ORG statement? Are you using "=" or "EQU" as label assignments?
Same way Andrew teaches:
processor 6502

include "vcs.h"

include "macro.h"

Yes, my source, DASM.exe, and the .h files are all in the same directory.

Picture: Posted Image

#4 GroovyBee OFFLINE  

GroovyBee

    7800 Developer

  • 5,781 posts
  • Busy bee!
  • Location:North, England

Posted Tue Mar 30, 2010 5:38 PM

Have you put an ORG statement in? E.g.

    org $F000

Start

.. Your stuff goes here.

    org $FFFA
    .word Start ; NMI
    .word Start ; RESET
    .word Start ; IRQ


#5 johnon OFFLINE  

johnon

    Chopper Commander

  • 241 posts
  • Aspiring 2600 Developer
  • Location:South Carolina, US

Posted Tue Mar 30, 2010 5:45 PM

View PostGroovyBee, on Tue Mar 30, 2010 5:38 PM, said:

Have you put an ORG statement in? E.g.

    org $F000

Start

.. Your stuff goes here.

    org $FFFA
    .word Start ; NMI
    .word Start ; RESET
    .word Start ; IRQ
Yeah. In fact, once I tried copying the code straight out of the tutorial for the basic kernel. I figured it would be simple enough that nothing would go wrong, unlike some of the later sessions. Guess I was wrong. *shrugs*

#6 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 5,989 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Tue Mar 30, 2010 5:47 PM

Most likely you didn't indent PROCESSOR and INCLUDE. If they start in column 1 then DASM thinks they're labels.

#7 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,236 posts
  • begin 644 contest

Posted Tue Mar 30, 2010 5:48 PM

vcs.h and macro.h need to be placed in the current directory, not necessarily the same place as dasm.exe. If the header files are somewhere else, put them in the current directory or at least specify the directory where the header files are with the -I switch.

If nothing works, post the sample files you are using, as that will help us pinpoint the problem.

#8 johnon OFFLINE  

johnon

    Chopper Commander

  • 241 posts
  • Aspiring 2600 Developer
  • Location:South Carolina, US

Posted Tue Mar 30, 2010 6:02 PM

Just for example, I copied and pasted the code seen here exactly after I'd had issues with about 3 iterations of my own code and I still am having issues.

Also, as the image above shows, I have the source, DASM.exe and the headers all in one folder for assembly.

#9 GroovyBee OFFLINE  

GroovyBee

    7800 Developer

  • 5,781 posts
  • Busy bee!
  • Location:North, England

Posted Tue Mar 30, 2010 6:09 PM

That source in that thread's number 1 post works fine for me. Just copy and pasted it. Attach the files you are working with and capture any errors.

#10 johnon OFFLINE  

johnon

    Chopper Commander

  • 241 posts
  • Aspiring 2600 Developer
  • Location:South Carolina, US

Posted Tue Mar 30, 2010 6:13 PM

Well, put bluntly, it works, but it was concerning that it has references to unknown symbols and that's what I was asking about. Is that usual? (the one I mentioned gives 3, but still works correctly...well, almost correctly. I get a green bar at the top, and I wondered if that had to do with the unknown symbols)

Guess I'm either more tired than I thought or really didn't pay attention to the output.

Edited by johnon, Tue Mar 30, 2010 6:13 PM.


#11 GroovyBee OFFLINE  

GroovyBee

    7800 Developer

  • 5,781 posts
  • Busy bee!
  • Location:North, England

Posted Tue Mar 30, 2010 6:17 PM

View Postjohnon, on Tue Mar 30, 2010 6:13 PM, said:

Well, put bluntly, it works, but it was concerning that it has references to unknown symbols and that's what I was asking about. Is that usual? (the one I mentioned gives 3, but still works correctly...well, almost correctly. I get a green bar at the top, and I wondered if that had to do with the unknown symbols)

What exactly are the errors? Can you also type DASM on its own and then tell us what version of the software it is.

#12 johnon OFFLINE  

johnon

    Chopper Commander

  • 241 posts
  • Aspiring 2600 Developer
  • Location:South Carolina, US

Posted Tue Mar 30, 2010 6:19 PM

View PostGroovyBee, on Tue Mar 30, 2010 6:17 PM, said:

View Postjohnon, on Tue Mar 30, 2010 6:13 PM, said:

Well, put bluntly, it works, but it was concerning that it has references to unknown symbols and that's what I was asking about. Is that usual? (the one I mentioned gives 3, but still works correctly...well, almost correctly. I get a green bar at the top, and I wondered if that had to do with the unknown symbols)

What exactly are the errors? Can you also type DASM on its own and then tell us what version of the software it is.

DASM v. 2.20.11

The error exactly is "3 references to unknown symbols".

#13 GroovyBee OFFLINE  

GroovyBee

    7800 Developer

  • 5,781 posts
  • Busy bee!
  • Location:North, England

Posted Tue Mar 30, 2010 6:22 PM

What verbose level are you assembling at? I didn't have a -v# when I built the demo.

#14 johnon OFFLINE  

johnon

    Chopper Commander

  • 241 posts
  • Aspiring 2600 Developer
  • Location:South Carolina, US

Posted Tue Mar 30, 2010 6:23 PM

View PostGroovyBee, on Tue Mar 30, 2010 6:22 PM, said:

What verbose level are you assembling at? I didn't have a -v# when I built the demo.
Level 5. -v5, as instructed.

#15 johnon OFFLINE  

johnon

    Chopper Commander

  • 241 posts
  • Aspiring 2600 Developer
  • Location:South Carolina, US

Posted Tue Mar 30, 2010 6:43 PM

I'm noticing now that verboseness is only supposed to go 0-4...did I miss something?

#16 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,236 posts
  • begin 644 contest

Posted Tue Mar 30, 2010 7:54 PM

Here's what you should do - build the files, and use -l to specify a list file, then post the list file. This will tell us exactly what is happening.

#17 johnon OFFLINE  

johnon

    Chopper Commander

  • 241 posts
  • Aspiring 2600 Developer
  • Location:South Carolina, US

Posted Tue Mar 30, 2010 8:02 PM

Here ya go.

Attached Files



#18 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,236 posts
  • begin 644 contest

Posted Tue Mar 30, 2010 8:58 PM

View Postjohnon, on Tue Mar 30, 2010 8:02 PM, said:

Here ya go.
Your output looks perfect.

Whatever "errors" may be produced are bogus and I wouldn't worry about them.

#19 johnon OFFLINE  

johnon

    Chopper Commander

  • 241 posts
  • Aspiring 2600 Developer
  • Location:South Carolina, US

Posted Tue Mar 30, 2010 9:12 PM

View Postbatari, on Tue Mar 30, 2010 8:58 PM, said:

View Postjohnon, on Tue Mar 30, 2010 8:02 PM, said:

Here ya go.
Your output looks perfect.

Whatever "errors" may be produced are bogus and I wouldn't worry about them.
Alright, batari, thanks! Just was curious as to what was wrong there. ^^

#20 Omegamatrix OFFLINE  

Omegamatrix

    River Patroller

  • 4,795 posts
  • Location:Oh, Canada

Posted Tue Mar 30, 2010 9:20 PM

I agree it looks like it compiled right. Don't forgot to add in your clean start macro (in between Reset and StartOfFrame).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users