Asm6 compiling the project

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Asm6 compiling the project
by on (#232382)
According to asm6's readme, the command (run from a .bat file?) the command should be formatted as:

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


The command I'm using:

Code:
asm6 main.asm main.bin main.lst


This however only outputs the list file. I didn't see a -option that lets you keep the window open to see if there were any problems either, so i can't know what is wrong.

This is a very unfortunate problem with a lot of assemblers that they don't have a very comprehensible manual for beginners if they have one at all.
Re: Asm6 compiling the project
by on (#232383)
Hmmm. Instead of clicking directly the batch file from a GUI of the O/S, just launch a command/console window, move to the appropriate folder and run the batch file there?
Re: Asm6 compiling the project
by on (#232391)
I'm guessing that assembler authors doubt that it's the job of every assembler author to teach every beginner the basics of using every operating system's command prompt. A tutorial for (say) Linux might not apply perfectly to Windows.

Practical options:

  1. Put pause on its own line at the end of the batch file.
  2. Find a tutorial for Command Prompt or PowerShell elsewhere. (Try DuckDuckGo or some other general web search engine.) Then run the batch file from within an already open prompt, as Gilbert mentioned.
  3. Run the batch file from within a text editor or integrated development environment (IDE) that can launch external programs, collect their output and error output, and display it in a window. One example is the "External Tools" plug-in for Gedit. Another is NppExec for Notepad++.
Re: Asm6 compiling the project
by on (#232402)
SusiKette wrote:
Code:
asm6 main.asm main.bin main.lst


This however only outputs the list file.

You probably have to request the creation of the list file using the appropriate option for this to work as intended:

Code:
asm6 -l main.asm main.bin main.lst


Quote:
I didn't see a -option that lets you keep the window open to see if there were any problems either, so i can't know what is wrong.

Keeping the window open is not a job for the assembler. Windows will invariably close the command line window after all commands in a .bat file have been executed. To keep the window open, put a "pause" command at the end of your .bat file.

Quote:
This is a very unfortunate problem with a lot of assemblers that they don't have a very comprehensible manual for beginners if they have one at all.

What you want is a tutorial, not a comprehensible manual, and that's generally beyond the scope of what the creator of a program is expected to deliver.

How to use command line applications is its own topic, and it's generally assumed that people involved with programming have a notion of how that works, but if you don't, you can research that topic separately.
Re: Asm6 compiling the project
by on (#232421)
ASM6 at least has a proper manual which can't be said about NESASM for example. When I started out I didn't understand half of it though so I learned from looking at other people's projects.

I also recommend to use NppExec if you use Notepad++ in Windows.
Just make a new NppExec script "Run build.bat" (or whatever you like):
Code:
NPP_SAVE
cd "$(CURRENT_DIRECTORY)"
cmd /c build.bat
This script saves the project and runs the batch file "build.bat" (or change to whatever you call it) at a hit on F6. Super quick assembling and works for everything you use a batch file to assemble or compile for.