The computer language “immediate C”

The programming language “immediate C” or iC is a declarative, event-driven extension of the procedural language C – useful for machine control, robotics and for dealing with events generated in a GUI.

iC utilizes the syntax of C to give meaning to statements that have no semantic support in C. In addition to standard variables, which are modified by the flow of instructions, iC provides so-called ‘immediate‘ variables, whose values are updated, whenever a change of input calls for an immediate change in output. An efficient Data Flow technique implements this strategy.

iC provides programmers with built-in operators, whose function is closely modelled on integrated circuits. The name iC is a reminder of this fact. Logical AND, OR, EXCLUSIVE-OR and NOT as well as D flip-flops, SR flip-flops, shift registers and many others are implemented in such a way, that their use in iC follows the same design rules, which apply to their hardware counterparts. These rules have led to a well-developed hardware technology, whose effectiveness is demonstrated by the success of today’s complex computer hardware. Particularly the concept of clocked functions plays an important role in the language iC. It gives the same protection against timing races in iC programs, as it provides for hardware IC designs. But iC is not a hardware description language nor a simulation language – it provides the functionality and some of the speed of field-programmable gate arrays with a language, which is pre-compiled into straight C code, which is portable and produces efficient machine code.

Continue reading “The computer language “immediate C””

BALAD (Beginners Assembly Language and Debugger)

BALAD is an assembly-level programming language for an emulated virtual computer with a 15-bit word length. It is combined with a comprehensive debugging system that allows online program assembly, execution of programs and the insertion of breakpoints to allow suspension of programs during execution.

Instructions are machine-oriented, using integer and logical operations only. As a concession to the beginner, extra input/output instructions are provided for automatic Decimal to Binary conversion and the printing of Text Strings. These facilities will enable students to obtain a reasonable printout of their results quickly while concentrating their efforts on developing algorithms.

The following tells the story of how BALAD was first developed in the ’70s for teaching computer technicians the basic workings of a computer and my recent efforts to re-write BALAD to run on a PC. To complete the story I reach back to my first contact with the English Electric Deuce vacuum tube computer UTECOM in which I was privileged to write my first computer program in 1957. I ported the higher-level language GEORGE, used on UTECOM to BALAD to show how little computer resources are needed for a very useful program.

Continue reading “BALAD (Beginners Assembly Language and Debugger)”

GIT correct $Id keyword expansion

This blog describes a set of hooks for GIT, which do real version number incrementing when a file that contains a well-formed $Id string is committed. These hooks have absolutely no effect on files not containing a $Id string. A major feature of these hooks is the fact that they are compatible with GIT branch names and store the branch name from which a file is committed in the $Id string.

The format of a clean well-formed $Id <version> string for these hooks is very similar to those used by RCS/CVS/SVN, namely full stop separated pairs of major and minor versions:

* the first string is the major version number in the master branch.
* even strings are consecutive version numbers in the branch.
* odd strings identify branches (branch names or numbers).

The following are a sequence if $Id strings for the file xx.c after a series of 3 edit/commits in the ‘master’ branch followed by 2 edit/commits in branch ‘bxx’ followed by an edit/commit in branch ‘byy’:

$Id: xx.c 1.1 $
$Id: xx.c 1.2 $
$Id: xx.c 1.3 $
$Id: xx.c 1.3.bxx.1 $
$Id: xx.c 1.3.bxx.2 $
$Id: xx.c 1.3.bxx.2.byy.1 $

This is how the $Id text is stored in the GIT archive after each commit. After ‘smudging’, which is applied to the file in the working directory after a git commit/fetch/checkout, the last $Id would look like this:

$Id: xx.c 1.3.bxx.2.byy.1 30e82ef 2016-04-03 14:48:24 +1000 Joe Blow $

This automatic method if $Id keyword expansion shows the current file name, the branch in which an instance of a file was edited and its individual version number within that branch.  This information is embedded in the text of a file in a manner, which is fully compatible with GIT. After smudging, the $Id also shows the commit SHA-1, the date and the author of the file instance. The $Id information in each file provides an independent file oriented view, which can be regarded as a belts and braces approach to handling files in GIT.

Continue reading “GIT correct $Id keyword expansion”