Tixy's Source Code

C++ and Forth source code.

All code is distributed under the terms of the MIT License which means that you can use and modify it for any purpose.

The code has only been tested on 32bit little-endian targets but has been designed to be word size and endian agnostic; please let me know if it doesn't work on your system.

C++ source is commented using Doxygen style comments and is formatted with tab stops every four characters.

If you have any comments, please feel free to contact me.

Contents

Common

All C++ code below requires this header file which provides type definitions and helper macros which aren't part of standard C++.

Utilities

String Formatting

Extensible classes for producing formated C strings. This also contains implementation of the C standard library functions: vsprintf, sprintf, vsnprintf and snprintf.

Bit Vector

Classes for constructing and manipluating a bit-vector (array of bits).

Maths

This code is targeted at CPUs without hardware support for division or floating point. It has been optimised for ARM CPUs but should be suitable for other RISC architectures.

Fixed-Point Maths

32 bit fixed-point maths implementation, including multiplication, division, square-root, trigonometric and logarithm functions.

3D Vectors

Routines for handling 3 dimensional points, vectors and matrices. This uses the Fixed-Point Maths routines above.

Audio Codecs

G711

An implementation of ITU-T (formerly CCITT) Recommendation G711 "Pulse Code Modulation (PCM) of Voice Frequencies"

G726

An implementation of ITU-T (formerly CCITT) Recommendation G726 "40, 32, 24, 16 kbit/s Adaptive Differential Pulse Code Modulation (ADPCM)"

This code optionally contains two deliberate bugs in the COMPRESS function which were added so the code passes the G726 test sequences. It seems that the standard implementation in G191 also contains these bugs.

Also requires source for G711

IMA ADPCM

An implementation of the IMA ADPCM audio coding algorithm.

Communications

Serial Port

Simple class for using serial ports.

Y-Modem

Y-Modem (and X-Modem) file transfer protocol. The receive and transmit code is separated into two classes which reduces memory size when only one of these functions is required. The code uses the Serial Port routines above.

Below is source for a command-line program for Y-Modem file transfer. This acts as a test program for the Y-Modem implementation and is a useful utility in its own right. It also supports receiving a 'log' after transmitting files; this can be used when sending a file to a development board and receiving instrumentation output which comes back on same port.

Forth

Forth VM

ANS Forth virtual machine written in C++. This is a token threaded implementation which contains the ANS Core words plus a few extra words from other wordsets. It doesn't make use of any C library functions, and so should compile to stand-alone code suitable for embedding in other programs.

Forth source code is also available to implement additional ANS wordsets...

Test code for all implemented wordsets...

ARM Assembler and Disassembler

ARM Assembler and Disassembler written in Forth. These support all ARM architectures up to and including Version 6.

The assembler syntax closely follows standard ARM format and includes support for labels.

Changes

2009-12-30

2009-10-09

2009-10-02

2007-08-18

2007-05-28

2007-01-13

2006-11-09

2006-09-02

2006-06-04

2006-05-31

2006-05-20

2006-04-14

2005-12-27

2005-12-26

2005-08-20

2005-03-02

2005-03-01

2005-02-27

2005-02-26

2005-02-18

2005-02-13

2005-02-08

2005-02-07