johnon Posted March 30, 2010 Share Posted March 30, 2010 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. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted March 30, 2010 Share Posted March 30, 2010 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? Quote Link to comment Share on other sites More sharing options...
johnon Posted March 30, 2010 Author Share Posted March 30, 2010 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: Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted March 30, 2010 Share Posted March 30, 2010 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 Quote Link to comment Share on other sites More sharing options...
johnon Posted March 30, 2010 Author Share Posted March 30, 2010 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* Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted March 30, 2010 Share Posted March 30, 2010 Most likely you didn't indent PROCESSOR and INCLUDE. If they start in column 1 then DASM thinks they're labels. Quote Link to comment Share on other sites More sharing options...
+batari Posted March 30, 2010 Share Posted March 30, 2010 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. Quote Link to comment Share on other sites More sharing options...
johnon Posted March 31, 2010 Author Share Posted March 31, 2010 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. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted March 31, 2010 Share Posted March 31, 2010 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. Quote Link to comment Share on other sites More sharing options...
johnon Posted March 31, 2010 Author Share Posted March 31, 2010 (edited) 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 March 31, 2010 by johnon Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted March 31, 2010 Share Posted March 31, 2010 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. Quote Link to comment Share on other sites More sharing options...
johnon Posted March 31, 2010 Author Share Posted March 31, 2010 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". Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted March 31, 2010 Share Posted March 31, 2010 What verbose level are you assembling at? I didn't have a -v# when I built the demo. Quote Link to comment Share on other sites More sharing options...
johnon Posted March 31, 2010 Author Share Posted March 31, 2010 What verbose level are you assembling at? I didn't have a -v# when I built the demo. Level 5. -v5, as instructed. Quote Link to comment Share on other sites More sharing options...
johnon Posted March 31, 2010 Author Share Posted March 31, 2010 I'm noticing now that verboseness is only supposed to go 0-4...did I miss something? Quote Link to comment Share on other sites More sharing options...
+batari Posted March 31, 2010 Share Posted March 31, 2010 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. Quote Link to comment Share on other sites More sharing options...
johnon Posted March 31, 2010 Author Share Posted March 31, 2010 Here ya go. kernel.txt Quote Link to comment Share on other sites More sharing options...
+batari Posted March 31, 2010 Share Posted March 31, 2010 Here ya go. Your output looks perfect. Whatever "errors" may be produced are bogus and I wouldn't worry about them. Quote Link to comment Share on other sites More sharing options...
johnon Posted March 31, 2010 Author Share Posted March 31, 2010 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. ^^ Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted March 31, 2010 Share Posted March 31, 2010 I agree it looks like it compiled right. Don't forgot to add in your clean start macro (in between Reset and StartOfFrame). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.