Asm6 compiling the project

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
User avatar
SusiKette
Posts: 147
Joined: Fri Mar 16, 2018 1:52 pm
Location: Finland

Asm6 compiling the project

Post by SusiKette »

According to asm6's readme, the command (run from a .bat file?) the command should be formatted as:

Code: Select all

asm6 [-options] sourcefile [outputfile] [listfile] 
The command I'm using:

Code: Select all

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.
Avatar is pixel art of Noah Prime from Astral Chain
User avatar
Gilbert
Posts: 564
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Asm6 compiling the project

Post by Gilbert »

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?
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Asm6 compiling the project

Post by tepples »

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++.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Asm6 compiling the project

Post by tokumaru »

SusiKette wrote:

Code: Select all

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: Select all

asm6 -l main.asm main.bin main.lst
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.
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.
Pokun
Posts: 2675
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Asm6 compiling the project

Post by Pokun »

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: Select all

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.
Post Reply