Debug directives

Debug directives and assertions


PRINT 'string',variable

This directive allows you to write text, variables or expressions to the console during assembly. Variables must exist at assembly time to be displayed. The default output format of the values is floating with decimals. It is possible to prefix variables with the following tags to change their display format:

  • {hex} Display the value in hexadecimal. If the value is less than #FF then the display will be forced to two digits; if it is less than #FFFF then the display will be forced to 4 digits. There will be no extra zeros with higher values.
  • {hex2}, {hex4], {hex8} Force the hexadecimal display to 2, 4 or 8 digits
  • {bin} Display the value in binary. There is an automatic adjustment to 8 or 16 bits in a similar way to the prefix {hex}
  • {bin8}, {bin16}, {bin32} to force the binary display on 8, 16 or 32 bits
  • {int} Round and display an integer++ DELAYED_PRINT
DELAYED_PRINT 'string',variable

This directive works in a similar way to the PRINT directive except that the display is done at the end of the assembly, when all the variables are known. It therefore allows to use variables not yet declared. On the other hand, its use is not relevant inside a loop because all DELAYED_PRINT would then use the last value of the variables used.



This directive stops the assembly and produces no output file.

FAIL 'string',variable

FAIL 'string',variable

This directive is a meta-directive combining PRINT and STOP. A message is thus displayed and the assembly stopped.


NOEXPORT label1, label2, label3
ENOEXPORT label1, label2, label3

The NOEXPORT directive inhibits the export of symbols. By default all the following symbols (labels, variables and aliases) are no longer exported but it is possible to specify which symbols should not be exported. Export of symbols can be re-enabled with ENOEXPORT.


BRK ; équivalent à DEFB #ED,#FF

Produce a "hard" breakpoint in the produced binary code. This type of breakpoint is not handled by all emulators.



Adds an internal exportable breakpoint. The binary is not changed, you have to export these breakpoints to use them. Either as a file or inside a snapshot, see command line options.


NAMEBANK numero,'oh la jolie bank!'

Assigns a label to a non-temporary memory BANK.

NAMEBANK 1,'Serval screen'
NAMEBANK 2,'Rubber code + Rastamix'

will produce in the output log of a cartridge the labels in brackets

WriteCPR bank  0 of 14775 bytes start at #0000 (ROM Init)
WriteCPR bank  1 of 14590 bytes start at #0000 (Serval screen)
WriteCPR bank  2 of 10875 bytes start at #0000 (Rubber code + Rastamix)
Sauf mention contraire, le contenu de cette page est protégé par la licence Creative Commons Attribution-ShareAlike 3.0 License