User Guide

Last revised

How to read the AsmLoop window, write code, build and run, debug, and use the shortcuts and settings. This is the same as the “Guide” pages of the Manual, in the panel at the right of the app. The Manual in the app also explains how to write 6502 assembly and what each sample does.

The window and the shortcuts are described for the Mac version. On Windows, read ⌘ as Ctrl and ⇧ as Shift. The other differences are listed in “Differences on Windows”.

The AsmLoop window

What each part of the window is, and how to create and open projects. The panels can be hidden, resized and moved into windows of their own.

The start window

While no project is open, the start window is shown.

Place What it does
Projects The projects opened recently. Click one to open it. The field at the top searches names and folders
Samples Choosing a sample creates a project of it and opens it
New Project Creates an empty project from a template (⌘N)
Open Opens the folder of an existing project (⌘O)

The “…” at the right of a project removes it from the list (its files stay).

The main window

Place What is there
Toolbar at the top The project name, the build, run and reload buttons, and the settings
Left The files of the project, and its symbols (labels, constants, macros)
Middle The editor. Open files are tabs
Right The game screen, the debugger and the manual
Bottom Problems (errors and warnings), Output (the build log) and References (where a symbol is used)
Very bottom The status bar: what saving or building did, and where the cursor is

Showing and arranging the panels

  • The icons along the left and right edges show and hide the panels. View > Tool Windows in the menu does too.
  • Drag the border between two panels to resize them. Double-click it to go back to the default size.
  • The game screen, the debugger and the manual move into a window of their own with the arrow button at the right of their header, or by dragging their header out of the window. Closing that window puts the panel back.

The panels are arranged the same way the next time.

Several projects

Each window shows one project. When you open another project, you choose whether it replaces the one in this window or gets a new window. The projects open when the app quits come back at the next launch (Settings > General can change that).

Writing code

Managing the files, and what the editor does for you. The code is assembled while you type, so errors, completion and jumps are always up to date.

Managing the files

Right-click the file list at the left for these:

  • New: a file, a folder, assembly (.s), an include file (.inc), a tile image (.png) or Markdown
  • Cut / Copy / Paste: move or duplicate files and folders
  • Rename / Delete

Click a file to open it in a tab. PNG and CHR files are shown as pictures.

Saving

  • ⌘S saves the file shown. ⇧⌘S copies the whole project under a new name.
  • A file with unsaved changes has a ● on its tab.
  • Building saves every unsaved file first.
  • Settings > Editor can make saving build, too.

Help while typing

  • Completion: instructions, directives and the symbols of the project are suggested.
  • Hints: point at an instruction, a register (PPUCTRL and the like) or a symbol to see what it is.
  • Errors: lines with a mistake are marked as you type. Click a line in Problems at the bottom to go there.
  • Addresses: right of the line numbers is the address each line was assembled to.

Jumping and searching

Action What it does
F12 / ⌘ + click Go to the definition of a symbol
⇧F12 List where a symbol is used, in References at the bottom
⇧F6 Rename a symbol in the whole project
⇧⌘O Search every file, in the symbols at the left
⌘F Find and replace in the file

The symbols at the left are the labels, constants and macros of the file shown. Click one to go to its line.

Building and running

How to make a ROM from the code and play it in the game screen. You can also swap the ROM without stopping the game, and save a state to come back to.

Build and run

Action What it does
Build (⌘B) Makes the ROM. Errors go to Problems at the bottom
Run (⌘R / F5) Builds, then starts the game from the beginning
Reload (⇧⌘R) Builds, then swaps only the ROM of the running game. RAM and the screen stay

Reload is handy for tuning data, graphics and constants bit by bit. When you change how the program flows, running it again is safer.

Playing the game

Click the game screen: the keyboard now plays the game. Press Esc or click outside the screen to go back to the editor.

Key Button
↑ ↓ ← → D-pad
Z B
X A
Shift SELECT
Enter START

Settings > Keyboard changes the keys. A game controller works too once it is connected (Settings > Game controller).

The buttons under the screen

Button What it does
Continue / Pause (F8) Stops or resumes the game
Advance one frame Runs a single frame while paused
Reset Resets the game
Rewind (F7) Goes back one second. Press again to go further back
Save state (F2) / Load state (F4) Remembers the state now, to come back to it later

For the step buttons, see “Debugging”.

Exporting the ROM

File > Export ROM… in the menu saves the ROM built as a .nes file.

Debugging

How to stop at a breakpoint and go one instruction at a time, and how to look into the CPU, the memory and the PPU. Where the game stopped is shown as a line of the code in the editor.

Breakpoints and stepping

Click left of a line number (or the line number) in the editor to set a breakpoint; click again to remove it. When the game reaches that line, it stops and the editor shows the line.

Action What it does
Continue / Pause (F8) Goes on from where it stopped / stops where it is
Step into (F11) Runs a single instruction
Step over (F10) Runs a JSR as one instruction, until the subroutine returns
Step out (⇧F11) Runs until the current subroutine returns

The tabs of the debugger

Tab What is there
CPU Registers, flags, PPU timing, the disassembly where it stopped, the stack
Memory CPU memory, PPU memory and OAM in hexadecimal
PPU Palettes, pattern tables, sprites (OAM) and name tables (the yellow frame is what is on screen)
Trace A log of the instructions run. It can be saved to a file
Events Where on the screen the writes to the PPU and APU registers happened
Profiler The cycles each function and each line take in a frame

When something does not work

  • Nothing on screen: look at the palettes and the name tables in the PPU tab.
  • Too slow: find the functions and lines that take the time in the Profiler.
  • Unsure about timing: check in Events that the writes happen inside VBlank.

Shortcuts and settings

The keys used most, and what the settings change. Open the settings with the gear in the toolbar, or ⌘,.

Shortcuts

Action Mac Windows
New project / Open a project ⌘N / ⌘O Ctrl+N / Ctrl+O
Save / Save the project as ⌘S / ⇧⌘S Ctrl+S / Ctrl+Shift+S
Close the project ⌘W Ctrl+W
Build ⌘B Ctrl+B
Build and run ⌘R / F5 Ctrl+R / F5
Reload (swap the ROM, keep the state) ⇧⌘R Ctrl+Shift+R
Continue / Pause F8 F8
Step into / Step over / Step out F11 / F10 / ⇧F11 F11 / F10 / Shift+F11
Rewind one second F7 F7
Save state / Load state F2 / F4 F2 / F4
Go to definition / Find references / Rename F12 / ⇧F12 / ⇧F6 F12 / Shift+F12 / Shift+F6
Search symbols ⇧⌘O Ctrl+Shift+O
Find in the file ⌘F Ctrl+F
Settings ⌘, Ctrl+,

Settings

Page What it changes
General The language, whether the last projects open at launch, resetting the settings
Editor Font size, indentation, line numbers, wrapping, the line at column 80, showing spaces, building on save
Game screen & sound How the screen is scaled, hiding the top and bottom 8 lines, the volume
Keyboard The keys that play the game
Game controller The buttons of the game controller

The settings reach every open window at once.

Differences on Windows

On Windows, some keys and menus follow Windows conventions. The features are the same as on Mac.

Item Mac Windows
Shortcut keys ⌘ / ⇧ Ctrl / Shift (e.g. ⇧⌘R → Ctrl+Shift+R)
Go to definition ⌘ + click Ctrl + click
Open the settings AsmLoop > Settings… in the menu File > Settings… in the menu