Debug directives

Debug directives and assertions

PRINT

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.

STOP

STOP

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 / ENOEXPORT

NOEXPORT
NOEXPORT label1, label2, label3
ENOEXPORT
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

BRK ; équivalent à DEFB #ED,#FF

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

BREAKPOINT

BREAKPOINT
BREAKPOINT label

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.

Utilisation étendue de la directive pour exporter des points d'arrêt ACE-DL

BREAKPOINT [options|options|options|…]

A default ACE breakpoint will be initialised with type "Memory", current assembling address, address mask of 0xFFFF, read/write mode, size of 1 byte, value and mask value at zéro, execution mode to STOP, an empty condition and the name "imported"

Each parameter can be set :

- Breakpoint type with option EXEC, MEM ou IO or more explicitly, TYPE=EXEC, TYPE=MEM, TYPE=IO
- Access mode with option READ,WRITE,RW,READWRITE or more explicitly, ACCESS=READ, ACCESS=WRITE, ACCESS=RW, ACCESS=READWRITE
- Execution mode with option STOP,STOPPER,WATCH,WATCHER or more explicitly, RUNMODE=STOP, RUNMODE=STOPPER, RUNMODE=WATCH, RUNMODE=WATCHER
- Address with ADDR=address
- Address Mask with MASK=mask
- Size (for memory breakpoints) with SIZE=size
- Trigger value with VALUE=value
- Mask value with VALMASK=mask
- Condition with CONDITION='pretty condition'
- Name with NAME='pretty name'

The condition must follow rules described on ACE-DL emulator website => http://www.roudoudou.com/ACE-DL/breakpoints.html

NAMEBANK

NAMEBANK numero,'oh la jolie bank!'

Assign a label to a non temporary memory space. This may be a cartridge ROM or snapshot RAM, depending of rasm output mode.

NAMEBANK 0,'ROM Init'
NAMEBANK 1,'Serval screen'
NAMEBANK 2,'Rubber code + Rastamix'

; will output labels for each cartridge bank
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)

; or in a snapshot
Write snapshot v3 file rasmoutput.sna
WriteSNA bank  0,1,2,3 packed ('Engine prototype in RAM')

NAMEROM

NAMEROM numero,'Nice ROM!'

Assign a label to a ROM (snapshot output only)

NAMEROM 0,'ROM Init'

will output the label behind the ROM output log with snapshot

WriteSNA bank  0,1,2,3 packed
WriteSNA ROM 128 of  2601 bytes start at #0000 ('ROM Init')
Sauf mention contraire, le contenu de cette page est protégé par la licence Creative Commons Attribution-ShareAlike 3.0 License