It is currently Mon Oct 23, 2017 10:55 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 4:07 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 809
Location: Sweden
Should you eventually get interested in programming in assembly, there are always the Nerdy Nights tutorials. It also teaches you how to make batch files.
It uses NESASM instead of ASM6 (which I recommend over NESASM) though, but it shouldn't be too hard to switch assembler once you learned the basics (I did exactly that).

Also it teaches a few bad things, that you'll discover if you continue reading this forum, but it is really the best tutorial out there right now so that can't be helped.


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 10:51 am 
Offline
User avatar

Joined: Wed Mar 29, 2017 3:11 pm
Posts: 19
Pokun wrote:
Should you eventually get interested in programming in assembly, there are always the Nerdy Nights tutorials. It also teaches you how to make batch files.
It uses NESASM instead of ASM6 (which I recommend over NESASM) though, but it shouldn't be too hard to switch assembler once you learned the basics (I did exactly that).

Also it teaches a few bad things, that you'll discover if you continue reading this forum, but it is really the best tutorial out there right now so that can't be helped.


Thank you, I will check it out I have also heard of NESASM but never tried it out

asm6 just opens then closes :/


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 11:38 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 558
Do you know what a command-line tool is? They're executed from the command line, not clicked on.


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 11:42 am 
Offline
User avatar

Joined: Wed Mar 29, 2017 3:11 pm
Posts: 19
calima wrote:
Do you know what a command-line tool is? They're executed from the command line, not clicked on.


do you use cmd to open it from the programs directory using dir, like how dos uses it to play games?


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 12:06 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10068
Location: Rio de Janeiro - Brazil
As mentioned in the first reply of this thread, assemblers are command line tools, which have no graphical interface. Command line programs usually receive a number of input parameters (in the case of assemblers, one or more files containing the source code, plus options) based on which they generate output files (in this case, an NES ROM) or information. Double-clicking such programs doesn't work because this causes them to be called without any parameters, meaning they have nothing to so they immediately exit.

For programs that take only one file as a parameter, you can usually drag and drop this file over the .exe and this file will automatically be passed on as a parameter for the program, which could actually be enough to get simple assemblers like NESASM or ASM6 to work (I haven't checked, though!), but you don't get to select any options, like the name of the output binary file or the creation of listing files, and you also don't get to see any feedback the program might have for you, such as error messages, because the window will close before you have a chance to read anything.

If you look at ASM6's README.TXT, you'll find this:

Code:
Usage:

   asm6 [-options] sourcefile [outputfile] [listfile]

Options:

   -?         Show some help
   -l         Create listing
   -L         Create verbose listing (expand REPT, MACRO)
   -d<name>:  Define a symbol and make it equal to 1
   -q         Quiet mode (suppress all output unless there's an error)
   Default output is <sourcefile>.bin
   Default listing is <sourcefile>.lst

Any command line tool will have its usage documented somewhere (very often, the program itself will give you this information if you call it without any parameters). Based on this information, you can use the command prompt to explicitly type any parameters necessary, but typing long command strings all the time is boring and unproductive, so you can type it all only once in a batch file (.bat) and double click that to assemble your project. Here's what a simple batch file for compiling an ASM6 project might contain:

Code:
..\tools\asm6.exe -L main.asm game.nes game.lst
pause

The path to ASM6 is relative to the project's folder, where the batch file is run from. The "pause" at the end prevents the window from closing until you press any key, this is so you can read the output of the program.


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 12:41 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1308
AlterAnubis wrote:
calima wrote:
Do you know what a command-line tool is? They're executed from the command line, not clicked on.


do you use cmd to open it from the programs directory using dir, like how dos uses it to play games?

You should read tokumaru's in-depth post, but in short, yes - you are on the right track.


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 1:13 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 800
Location: cypress, texas
tokumaru suggested asm6 to me and that was a great suggestion! The most important part of using asm6 is adding the -L so that it gives you a listing file. tepples let me know that listing files existed. Those .lst files are super helpful with addresses listed at the beginning of each line. When you have compiled a program in C++ and Java it translated the code you wrote into assembly hex codes that ran on the processor of your computer. Using an assembler like asm6 allows you to translate the assembly code you wrote into the assembly hexidecimal equivalent that runs on the 6502 processor of the NES. This .nes file can be run with an emulator like FCEUX on your computer or it can be run with a POWERPAK (from retrozone ~$95.00 if I`m remembering correctly) on a real NES. :)


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 1:55 pm 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 910
Location: Gothenburg, Sweden
Actually, you don't necessarily need command line to assemble your text files into binaries. Even though that gives you more control and is very good advise.

You can drag and drop your text file to asm6. If it is written correctly (meaning no syntax errors or asking to do something impossible), it will produce a .bin in the same folder as asm6.exe - rename its extension to .nes and you can run it in an emulator. If there's an error, nothing will be produced. This way you'll know if your text was correctly written or not.

Asm6 will "open and close" this way, nearly not enough time to review the process log to detect errors (and where they are). This is why you should learn to write batch (.bat) files or use cmd.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 2:22 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 809
Location: Sweden
Normally you would want to make a batch file though, like mentioned several times before in the thread. It's just a text file where you can specify all your assembly options and stuff, and can then be double clicked. No need to mess with the command line anymore.

unregistered wrote:
Using an assembler like asm6 allows you to translate the assembly code you wrote into the assembly hexidecimal equivalent that runs on the 6502 processor of the NES. This .nes file can be run with an emulator like FCEUX on your computer or it can be run with a POWERPAK (from retrozone ~$95.00 if I`m remembering correctly) on a real NES. :)

Yes or you could even make your own cartridge. As long as it was coded properly it will work on real hardware. Easiest way to run on real hardware is to use a flashcart like a Powerpak or Everdrive though. I'd recommend the Everdrive, it's much cheaper and probably even slightly better (both have pros and cons though).


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 3:55 pm 
Offline
User avatar

Joined: Wed Mar 29, 2017 3:11 pm
Posts: 19
None of the assemblers seem to work for me :/


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 4:34 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19122
Location: NE Indiana, USA (NTSC)
What error message do you get? Or what do you see that interferes with your ability to read the error message?


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 4:55 pm 
Offline
User avatar

Joined: Wed Mar 29, 2017 3:11 pm
Posts: 19
It would open then close that is all I had, I don't know if the person who made it included return 0; or not but either way I don't know why it closed out I also tried running it as admin but no luck there.


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 5:09 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10068
Location: Rio de Janeiro - Brazil
How are you trying to run them?


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 5:28 pm 
Offline
User avatar

Joined: Wed Mar 29, 2017 3:11 pm
Posts: 19
Clicking it open, still trying to find out how to make a .bat that will open it


Top
 Profile  
 
 Post subject: Re: Out of date tools?
PostPosted: Thu Mar 30, 2017 5:49 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1787
Location: DIGDUG
With the command box open (for asm6)...

Assuming you have asm6.exe and an assembly file called test.asm, in the same folder...

Simply typing "asm6 test.asm test.nes" would be all you do. If no errors, it would say something like...

Quote:
pass 1..
pass 2..
test.nes written (16400 bytes).


Then, if you looked in the folder, you will see the output file "test.nes"

EDIT - actual output inserted.

EDIT 2 - if I wanted to make a .bat file do exactly this, I would write a text file (with Notepad++) that said...

Quote:
asm6 test.asm test.nes
pause


That's it. Save this text file as 'compile.bat'

Or, if you want to get fancy...

Quote:
set name="test"
asm6 %name%.asm %name%.nes -l
pause
%name%.nes


This would create a listing (-l), and the screen will pause, and wait for a keypress, at which point, it will try to open 'test.nes'...assuming you have .nes files associated with an emulator.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group