Skip to content

Assembler

WacKEDmaN edited this page Oct 31, 2026 · 3 revisions

Assembler

The assembler window (Tools → Assembler) uses RASM by Edouard BERGE, included in the program. Every RASM directive, macro, cruncher and expression works as from RASM's command line; the difference is that the code goes into the memory of the running machine.

Files and programs

  • New: a new program in a tab of its own, with a short sample.
  • Open...: opens a source file as a program, in a tab beside the programs that are open. If the program is open already, it is read again from the disc (if one of its tabs has changes that are not saved, it is only shown).
  • Save, Save as....
  • File → Open → Assembler source... also opens a program.

Programs and their linked files

  • Each program has a main file (its tab name is in orange) and the files it links: INCLUDE "file" and READ "file". The linked files open in tabs after the main file, by themselves.
  • F9 builds the program of the tab on show: from a linked file's tab, F9 builds that file's program. Only that program's edited files are saved before the build (RASM reads the linked files from the disc).
  • Each tab has a close button. Closing a main file closes its linked files too. A linked file that you close opens again at the next build. A tab with changes that are not saved asks before it closes.
  • The open programs open again at the next start.

Assemble and run

Button Key What it does
Assemble F9 Assembles into the machine's memory
Assemble + run Ctrl+F9 Assembles, then starts the program at its run address (RUN directive), or at its start
Run to cursor Ctrl+F10 Runs until the code of the cursor's line, past every breakpoint on the way, and pauses there
  • The ROMs over the program's memory are paged out before it runs.
  • The messages list shows the errors and warnings. Click one to go to its line (in its file's tab). The gutter marks the lines with errors.
  • The summary line shows the start, the length and the run address.
  • The symbols list shows the labels and their values. Type in the filter to find one.

Syntax

The syntax list sets RASM's compatibility mode:

Mode What it is
RASM RASM's own syntax
Maxam (-m) Maxam's left-to-right expressions
AS80 (-ass) AS80 syntax
UZ80 (-uz) UZ80 syntax
DAMS (-dams) DAMS syntax
Pasmo (-pasmo) Pasmo syntax
WinAPE WinAPE's assembler (below)

WinAPE syntax

For source written for WinAPE's assembler:

  • & is a hex prefix (&4000), as well as # and $. % is binary. Expressions work as in Maxam.
  • Data: db, defb, byte, text, defm, dm, dw, defw, word, ds, defs (with several size,fill regions), rmem, str (the last character with bit 7 set), charset, align boundary,fill.
  • Symbols: label equ value, label defl value, let symbol=value.
  • Conditions: if, ifnot, ifdef, ifndef, elseif, else, endif.
  • Loops and macros: repeat n ... rend, while condition ... wend (with @ local labels), macro name,param,... ... mend or endm. Macro parameters are used by their names, as in WinAPE.
  • Source: read "file", incbin "file",offset,size, end (the rest of the source is left out), stop (stops with an error), nocode and code, list and nolist.
  • Control: org address,output, limit address, print, run address,breakpoint (the second value becomes a debugger breakpoint), brk (makes RST &30 and sets a debugger breakpoint on it).
  • Relocation: relocate_start, relocate_end, relocate_table, and the symbols relocate_count and relocate_size after the table.
  • break, case, switch and default are labels, as in WinAPE.
  • pause, title and dump are accepted and do nothing (WinAPE does not implement them either).
  • write, write direct and close are accepted, but the code always goes into the machine's memory: no file is written, and a RAM bank or ROM setting is not used.
  • Not supported: checksum (it gives an error) and memory().

Breakpoints from the source

  • BRK labels: labels named BRK..., @BRK... or ....BRK become debugger breakpoints (as RASM's -eb option).
  • RASM's BREAKPOINT directive, and in WinAPE mode brk and run address,breakpoint, set breakpoints too.

The editor

  • Syntax colouring: Colours... switches it on or off, and sets a colour for each kind of word (text, mnemonic, register, directive, number, string, comment, label, symbol).
  • The gutter shows the line numbers and the errors.
  • Mouse-over: after a build, put the mouse on a label to see its address and what memory holds there. Put it on a register to see its value.
  • The right-click menu has Run to here for the line under the mouse.

Run to cursor

Run to cursor (Ctrl+F10, or the right-click menu) runs the machine to the first code of the cursor's line (or of the next line with code), past every breakpoint and watchpoint, and pauses there. If the program has not been started since the build, it starts it first. For assembly, it works in the program's main file tab.

C programs

A .c main file is built with SDCC instead of RASM. Refer to C programs.

Clone this wiki locally