Archive for the ‘ASM Software’ Category.

ASM Software Unittest Framework

(c) 2016 by Matthias Arndt

The MIT License applies to this project. Please refer to the file COPYING for details.

The software is available on GitHub at


This is a small framework to implement unittests for software written in C. There are existing projects that offer much more functionality, this one focuses on simple usability and textual output of statistics.

Main reason to implement this framework was that cunit was too complicated in usage and no other small free frameworks could be found.

System requirements

  • Cmake to build the example project
  • a C99 compliant C compiler but a C90 one will do if stdint.h and stdbool.h are supplied
  • any operating system of your choice

Using the test framework

A test should be a subfunction or the main function of an appropriate test executable.

Use the macros defined in unittest.h and link your project with unittest.c

Wrap the Test with UT_BEGIN() and UT_END() macros for proper structuring. Most commands should describe themselves.

It is allowed to start another test for entirely different content with the UT_BEGIN() macro if the last test finished with the UT_END() macro.

Start uIPTool utility for AUTO folder

uIPTool is great to allow easy access to Atari ST files via network without having to configure complete NFS or FTP setups.

As I ran into network problems and had to manually restart the tool from time to time, I wrote a small utility that allows to tweak the AUTO boot sequence to run uiptool either once or in a repeating fashion.

In the latter mode, the tool is restarted after crashing or undesired termination (e.q. I accidentally hit SPACE on the Falcon keyboard and the tool stopped amidst in a 50MB download)


This is a utility for the Atari ST AUTO folder.
It allows to run the uIPTool (
at system startup without having to manually click on the desktop.

Place it in AUTO folder before running MiNT/MagiC or any network stacks like STING.

System requirements

– Atari ST or compatible computer
– uIPTool and a compatible Atari NIC (Netusbee, Hydra)


1. copy uIPTool as UIP.TOS in the root of your boot drive
2. place STARTUIP.PRG in your AUTO folder (preferrably at the beginning)
3. reboot


– The tool waits until 5s timeout for keyboard input.
– If there is no keyboard input, the AUTO boot sequence is resumed.
– Press ‘U’ to activate uIPTool once. Boot continues after its termination.
– Press ‘R’ to activate uIPTool in repeating mode.

## Repeating mode

In repeating mode uIPTool is started.
When the tool crashes or terminates, the user can quit and resume the
system boot sequence if desired.
After a small timeout of 5s uIPTool will start again.

I had troubles on my LAN with lossing connection and it was tedious
to restart uIPTool by hand in these cases.


The source code and executable can be downloaded at

Finite State Machine Generator for C

For quite a long time I’m thinking about simple code generating tools. I don’t want to use a special XML syntax or descriptive language but a simple Excel or OpenOffice sheet instead.

The aim is to generated C source code for small microcontroller applications or retrocomputing systems.

For the start I made a simple generator for finite state machines (Wikipedia entry)

It is also my first script written in Python and thus not really as tidy and neat as I prefer. But it is working for now.

It takes the sheet from an OpenOffice .ods table like this:

@brief autofire button statemachine
State Event Next State

and generates a switch-case style state machine in C with callback functions for state and event handling.

A version with support for object oriented programming with pointers to statemachine objects is planned aswell. Check the github for functional updates.

The actual code can be found on Github:

Ebookkonvertierung mit Thunar

Mein Kindle unterstützt Ebooks im MOBI Format, aber leider nicht das stärker verbreitete Epubformat. Heute wollte ich ein paar EBooks mit .epub nach .mobi konvertieren und das natürlich gleich komfortabel per Mausklick erledigen.
Die Konvertierung selbst wird von Calibre und seinen Werkzeugen durchgeführt.

Für die Integration in XFCE und Thunar habe ich mir einfach eine “Benutzerdefinierte Aktion” alias Custom Action in Thunar definiert und Dateien mit Endung .epub zugeordnet. Da das Konvertierungstool Ausgaben erzeugt, wird diese in einem eigenen Terminalfenster angezeigt, welches man nach erledigter Konvertierung einfach schliessen kann. Dazu habe ich ein einfaches Shellskript geschrieben, dem man den Dateinamen samt Pfad zum *.epub übergibt. Die konvertierte Ausgabedatei bekommt automatisch die Endung .mobi zugeteilt.

Das Skript wird von der Custom Action mit Parameter %f aufgerufen und sieht so aus:

# Thunar helper to convert *.epub to *.mobi with Calibre
# Syntax:
# (c) 2016 by Matthias Arndt
# The GNU General Public License v2 applies.
# extract pathname and filename without extension
basename=$(basename "${1}")
xfce4-terminal -T "MOBI Conversion result" -H -x ebook-convert "${1}" "${filename}.mobi"

Guava Tools Backup

Years ago, I used a package called Guava Tools to generate the ASM Software website with templates.

As this nice set of software is not packaged for Ubuntu and its official page feels a bit  hidden, I decided to mirror the package.

Latest binary:
Website (still active as of 2016-05-12):

ClamAV in Thunar einbinden

Ab und an möchte man auch unter Linux Dateien nach Viren scannen. Da ich meistens doch über graphische Oberflächen arbeite, habe ich mir ClamAV im Thunar unter XFCE eingebunden. Dies geschieht als “Custom Action” aktiv für alle Dateien.

Ich habe mich grob an die Anleitung unter gehalten. Das Skript habe ich ein bißchen erweitert und für die Verwendung von zenity umgebaut.

Das Skript sieht dann bei mir so aus:

#!/bin/bash # # clamavscan 0.1, 05.10.2006 # # by Siegfried Neumann, # Zenity output and desktop notify by Matthias Arndt <> # # Used by Thunar with a custom action. # Custom action: clamavscan %f # TITLE="ClamAV Scan" SCANUSER=`whoami` LOGDATE=`date +"%Y-%m-%d %T"` LOGDATE_FNAME=`date +"%Y%m%d.%H%M%S"` LOGFILE="/tmp/clamavscan-$SCANUSER-$LOGDATE_FNAME.log" notify-send 'ClamAV Scan' "started" echo "ClamAV Scan Log $LOGDATE " > $LOGFILE echo "" >> $LOGFILE echo "Report location: $LOGFILE" >> $LOGFILE echo "" >> $LOGFILE echo "--------------------------------------------------------------------------" >> $LOGFILE echo "" >> $LOGFILE chmod 600 $LOGFILE clamscan -r "$1" >> $LOGFILE if [ $? -eq 0 ] then notify-send 'ClamAV Scan' "No virus found" else zenity --title "$TITLE $LOGDATE" --error --text="One or more virii found!" fi zenity --title "$TITLE $LOGDATE" --text-info --width 500 --height 400 --filename=$LOGFILE case $? in 0) echo "Finished.";; 1) xdg-open $LOGFILE;; 255) echo "Box closed.";; esac

Classic hexdump of files with the GNU Coreutils

Sometimes I’m in need of having a classic hexdump from a given binary file.
As there is no obvious command under Linux, all seem to require more or less long command line options to work, I have to note down the standard solution using the od tool provided by the GNU Coreutils.

od -w16 -A x -t x1z -v <filename>

This gives an output like this:
000000 00 00 00 05 00 00 aa 00 00 bb 00 00 cc 00 00 00  >................<
000010 00 00 ee ee dd ff 00 00 44 00 00 44 84 cd ab fe  >........D..D....<

I did not find out how to remove the final address without having to use grep or sed.

The tool has a manual page and I recommend having a simple alias in your .bashrc like this:

alias dump='od -w16 -A x -t x1z -v'

Helper scripts for Buffalo LinkStation

Buffalo LinkStation Mini (illustration only)

Buffalo LinkStation Mini (illustration only)

Some years ago I purchased a Buffalo LinkStation Mini, a small NAS device for backup purposes. This device works quite well but until today, I didn’t have access to the builtin Wake-on-LAN feature from Linux.

Under Windows, the NAS boots as soon as the PC side software issues a special start request. After a little internet search, I found the necessary information and a small bash script to achieve this under Linux. I have adapted the wakeup script a bit and added a feature to disable the wakeup request via a second script. A third script queries the status of the NAS, both on the network and the state of the local wakeup script.

The wakeup script is intended to be run from the user’s Autostart sequence. The helpers can be called when needed.

Some icons are included.

The script needs bash,. zenity, notify-send and wakeonlan. The latter is a Ubuntu package and should be available in your distro as well.

The MIT License applies to this software. It works for my Buffalo LinkStation Mini, maybe for others too  but I cannot guarantee this. You are on your own but, hey, the software is free for modification :)

Download scripts and icons (86K)

Original script and information:

Quadromania Sourcecode now at Google Code

The sources for my opensource game Quadromania are now hosted at Google code:

Included is the complete history of my sofar local Subversion repository starting with the first public 2009 release.

KDE1 Iconset for the Atari Falcon 030

package and RSC work (c) 2012 by
Matthias Arndt <>
The original KDE1 artwork is assumed to
be available under a free license.
Please keep me informed if this is not
the case.
Imported set of icons from KDE1, scaled
down to 16 colors and converted to GEM
icons for use with the Atari FALCON 030.
The files for Teradesk are usable right
away. Backup your old files and replace
the files CICONS.RSC and ICONS.RSC

package and RSC work (c) 2012 by Matthias Arndt <>

The original KDE1 artwork is assumed to be available under a free license.

Please keep me informed if this is not the case.

Preview of the KDE 1 iconset ported to the Atari Falcon 030

Preview of the KDE 1 iconset ported to the Atari Falcon 030

This is an imported set of icons from KDE1, scaled down to 16 colors and converted to GEM icons for use with the Atari FALCON 030. The final resource files have not been tested on the Atari TT and not with graphic cards or any other resolution than 640x480x4bpp

The files for Teradesk are usable right away. Backup your old files and simply replace the files CICONS.RSC and ICONS.RSC

Update 22.7.2012:

I reworked the monochrome icons a bit and added the lines for NEWDESK.INF to add icon associations in one go. A DESKICON.RSC with only monochrome icons for use with TOS 2.x (Atari ST and Atari STE) is now also included.

Download: KDE1ICONS.ZIP (70K)