Tool ticks
Ticks is a command line CPU emulator that can be used for testing and debugging algorithms and code. The classic library can compile binaries that run on ticks using the +test target.
In it's simplest case, launch ticks with:
z88dk-ticks [binary file]
It will run for around 10,000,000 ticks which may not be sufficient, to increase the time it will run use the -w
option:
z88dk-ticks -w X [binary file]
Where X counts the number of 400,000,000 cycles to wait before exiting.
To specify command line options (which are picked up main in the argc
and argv
parameters invoke ticks as follows:
z88dk-ticks [binary file] -- [argv0] [argv1]
Ticks supports emulating the z80 (default), 8080 (-m8080
), 8085 (-m8085
), gbz80 (-gbz80
), z180 (-mz180
), ZX Next z80 extensions (-mz80-zxn
), R800 (-mr800
), KC160 (-mkc160
) and Rabbit processors (-mr2k
, -mr4k
), reporting accurate timing information for each target. Note: Not all Rabbit or KC160 instructions are emulated.
When emulating the ZX Next cpu, ZX Next style MMU paging is available.
Ticks supports a limit number of BDOS calls launching it to run a .COM file will enable this mode and can allow some CP/M programs to run.
Ticks provides a command line debugger, this can be launched as follows:
z88dk-ticks -d -x [map file] [binary file]
Specify -x [map file]
is optional, however specifying it allows symbolic debugging. Ticks will then sit at address 0 waiting for an input from you. Type help
to view the available commands.
Ticks can also report hotspots for code execution, launch the debugger, type hotspot on
and then cont
, on exiting a file called hotspots
will be written in the current directory. This file reports the number of times an address has been executed along with a disassembly of that line. To order this in terms of frequency you can use the standard sort tool. For example:
sort -nr hotspots
Will show the commonest hit addresses first of all.
sort -nr -k2 hotspots
Will show the number of clock cycles spent at each address.
Ticks provides a full stdio that will output to the console, alongside this, file I/O is supported as well.
- Ticks provides an ACIA emulation that is accessed using ports 0x80 (Ctrl/status) and 0x81 (in/out) that can be used to simulate the serial port on an RC2014 board.
- An emulated AM9511 maths co-processor is available on ports 0x42 and 0x43
- Overview
- Platform List
- Unsupported Platforms
- i8080/5 Support
- Homebrew hardware quickstart
- Retargetting
- Building the libraries
- Clang support
- Pragmas
- Adding to Classic
- Introduction
- Library Configuration
- CRT
- Header Files
- Assembly Language
- Library in Depth
- Embedded Platform
- Adding to NewLib
- Benchmarks
- Datatypes
- Debugging
- Decompression
- More than 64k
- Deficiencies
- Compiling Larger Applications
- Importing routines written in 8080 assembly mnemonics
- Using CP/M libraries in REL format with z88dk
- Writing optimal code
- Speeding up Compilation
- CMake usage