View All Articles
Programming

Modula-2 Compilers on CP/M

Modula-2 is a great language in general and is a good choice for programming on CP/M. There are three good compilers available for CP/M which all require a Z80 processor and we'll compare each in turn...   Read More

Is SUBLEQ the Right Choice for a VM?

SUBLEQ is an interesting architecture because of its simplicity, adaptability and power. It is therefore an attractive choice for a simple virtual machine. However, this comes at a cost which we will...   Read More

80 Columns in Software on the Commodore VIC-20

If you have good eyesight, a well-tuned display and patience it is possible to use 80 columns in software on the VIC-20. This is really just an experiment but considering the limitations of the Vic I ...   Read More

64 Column Text Mode on the Commodore VIC-20

With a little lateral thinking and by putting the television on its side we can create a 64 column sideways text mode on the VIC-20. This article will demonstrate this and show how it is done. Previo...   Read More

Getting the Address of BASIC Variables on the VIC-20

Getting the address of a BASIC variable can be useful if you want to pass data to a machine code routine or want to access the bytes of a variable directly to improve speed and reduce garbage collectio...   Read More

Saving and Loading Memory on the VIC-20

Saving and loading memory is quite easy on the VIC-20 once you know how. However, it isn't obvious how to do this and therefore this article will present a few simple ways of doing it from BASIC and A...   Read More

Basic Line Storage on the VIC-20

BASIC programs are stored in memory using a simple structure that we can investigate and manipulate. This article will show how they are stored and contains a BASIC program to go through each line of ...   Read More

Programming in Assembly with VICMON on the VIC-20

VICMON is a machine language monitor released by Commodore in 1982 and is great for programming the VIC-20. Its interactive nature means that it can often be quicker to develop via this rather than us...   Read More

Storing Machine Code in REM Statements on the VIC-20

BASIC programs often contain machine code routines but they take up quite a lot of space in BASIC. An interesting way to reduce the amount of space that they take is to store the machine code in REM s...   Read More

Visualizing Zero Page on the Commodore VIC-20

The VIC-20 is a very flexible little machine and allows us to choose which area of memory represents the screen map. One interesting thing we can do is use this to visualize a section of memory such ...   Read More

Code and Data in Display Memory on the VIC-20

The unexpanded Commodore VIC-20 only had 5K of RAM and therefore creative ways had to be found to maximize the available RAM. The display memory would use some of this memory and therefore one option ...   Read More

Double-Width C64 Style Font on the Commodore VIC-20

The C64 used a fatter double-width font because the video quality of early VIC-IIs wasn't very good. Therefore they had to make the C64's font fatter than the VIC-20's. However, this fatter font look...   Read More

The Pilot Programming Language on CP/M

Pilot was created by John A. Starkweather in the early 1960s as a programming language for Computer Assisted Instruction. It has often been compared to Logo because of its use with children. However,...   Read More

SUBLEQ on the Commodore VIC-20

I have created a SUBLEQ Virtual Machine for the Commodore VIC-20. SUBLEQ is a computer architecture that has only one instruction: SUBLEQ. The instruction stands for SUbtract and Branch if Less than ...   Read More

SUBLEQ - A One Instruction Set Computer (OISC)

SUBLEQ has to be one of the easiest architectures to implement in either software or hardware and this is the main reason for its design as a teaching aid. It has only one instruction, hence why it is...   Read More

The Mouse Programming Language on CP/M

Mouse is an interpreted stack orientated language designed by Peter Grogono around 1975. It was designed to be a small but powerful language for microcomputers, similar to Forth, but much simpler. On...   Read More

Sweet 16 (The 6502 Dream Machine) Ported to the VIC-20

Sweet 16 was created by Steve Wozniak to reduce code size and make it easier to handle 16-bit pointers and arithmetic for his Apple Integer BASIC. He wrote it around 1977 and referred to it in an arti...   Read More

Position Independent Code (6502) on the Commodore VIC-20

If we are writing 6502 machine code and want to to create a routine or program that can be placed in any location then we have to create Position Independent Code (PIC) or make the code relocatable. H...   Read More

Adding Basic Stubs to Assembly Language on the Commodore VIC-20

To make machine language programs more friendly it's nice to add a Basic stub which contains a line with a SYS statement to start the code. This is easy to do on the VIC-20 and the process gives you a...   Read More

Hand Assembling to Machine Code on the Commodore VIC-20

I quite enjoy designing machine language routines on paper and then hand assembling them. For many people this would have been their only option until they got a more advanced machine language monitor...   Read More

6502 Machine Language Tables and Aids

When programming using machine code there are a few useful aids that can make it easier to do. I have created a couple of tables for the 6502 that can make the process easier. They are based on table...   Read More

Tokenize/De-tokenize Commodore Basic Programs Using petcat

petcat is a utility provided with the VICE Commodore emulator that you can use to convert Basic source code contained in ASCII text files to .PRG files or vice versa. It is also able to convert ASCII ...   Read More

Changing Screen Dimensions on the Commodore VIC-20

To make the most of the limited amount of memory on the VIC-20, we can increase and decrease the screen size depending on our program's priorities and what we want to achieve. If we increase the size ...   Read More

Moving the Picture Origin on the Commodore VIC-20

The VIC-20's VIC chip provides a simple yet flexible video display and one of the features that can be quite useful is the ability to alter the picture origin on the screen. This feature allows us to ...   Read More

40 Columns in Basic on the Commodore VIC-20

There are a number of programs that allow you to use 40 columns of text from Basic on a Commodore VIC-20. This can be useful as by default the Vic's screen is 22 columns by 23 rows. They are supplied...   Read More

Benchmarking Basic on Vintage Computers

There are a few machines I'm quite interested in comparing so I decided to create a simple Basic benchmark to get an idea of their relative speed. The benchmark tests 7 aspects and is inspired by qsbb...   Read More

Introducing Ornament a Tcl Template Module

Ornament is a Tcl template module that allows you to define, parse and compile a template to produce a script which can then be run using a safe interpreter. The idea came from the Templates and subst...   Read More

Advent of Code 2018: 25 Days, 25 Languages

There are lots of different programming challenges, but this year one in particular has caught my attention and I have decided to take part. Advent of Code starts 1st December with daily programming p...   Read More

Beware of Immutable Lists for F# Parallel Processing

With F#, the list often feels like the default choice of data structure. It is immutable and hence easy to reason about, however its use can come at a great cost. If you are using lists to process la...   Read More

Creating a TTY Simulator in Assembly Language on the VIC-20

The Vicmon machine language cartridge is an excellent tool for exploring the Vic-20. This article and its associated video will show you how to use it to create a simple program that will change the n...   Read More

Beginning Assembly Programming on the Commodore VIC-20

The Commodore VIC-20 is a great machine to learn an assembly language on. It was released in 1981 and was the first computer to sell one million units, which contributes to its popularity today. The ...   Read More

If Only Borland Had Stuck With Turbo Modula-2 For CP/M

I have written previously about why Turbo Pascal is a Great Choice For Programming Under CP/M and now it is time to talk about what could have been. You probably haven't heard of Turbo Modula-2 for CP...   Read More

Turbo Pascal: A Great Choice For Programming Under CP/M

CP/M was blessed with many programming languages, each with their own strengths and weaknesses. I think that Turbo Pascal stands out from these and I'm not alone. When Turbo Pascal was released in 19...   Read More

xdgbasedir: A Tcl Module to Access the XDG Base Directory Specification

Unix has traditionally lacked a consistent way of storing user specific and system wide configuration and support files. This has lead to a mess of dot files in a user's home directory and other assoc...   Read More

Compiling a Tcl Script into an Executable

Locating Tcl scripts to load from an executable can be awkward if you want to make your program cross-platform. An easier way is to compile a Tcl script directly into the executable and let that scrip...   Read More

Using Dynamically Generated Header Files with CMake

Sometimes it can be useful to dynamically generate header files and include them from a C source file. However, it can be a little difficult getting CMake to recognize when to generate the files and w...   Read More

Embedding an SDL Surface in a Tk Window

Tk is great, but sometimes it just isn't fast enough. SDL is fast, but has no support for input dialogs and other GUI conventions. By embedding an SDL surface in a Tk window you get the best of both ...   Read More

Refactoring: Arm Yourself in the War Against Useless Comments

Comments, comments, everywhere, but are they making your code clearer or just distracting you? Comments are meant to be there to explain code and help you to understand it. However, they are often ou...   Read More

Dealing Sympathetically with Legacy Code

I have often noticed programmers getting worked up about the legacy code they are maintaining. I know it is annoying having to wade through poor code, or worrying about making changes for fear of unex...   Read More

Running 4K FORTRAN on a DEC PDP-8

4K FORTRAN was a subset of FORTRAN II and was the first high-level language available for the DEC PDP-8. It consisted of two parts: the 4K FORTRAN Compiler (nicknamed "Fivetran") and the 4K ...   Read More

Improving the Standard SUBLEQ OISC (One Instruction Set Computer) Architecture

When I first came across SUBLEQ, I really liked the beauty and simplicity of the design. However, I have now been experimenting with it for quite a while and have noticed one aspect of the standard im...   Read More

An Introduction to Corewar

I remember reading about Corewar roughly 20 years ago and thinking that I will have to have a go at that when I get the time. As often happens in life, things got in the way and I only recently manage...   Read More

The Smallest Communication Program in the World?

I was going through a backup of my dos machine, taken in 1998, and came across some source code which I haven't seen for a long time. It was great to see that old code, and I must set-up a machine so ...   Read More

An Introduction to Test-Driven Development

For the past 6 months I have been using Test-Driven Development (TDD) on a new project. It has made such a difference to the quality of my code, that I feel I just have to share it's benefits with tho...   Read More

The Mythical Man-Month: Essays on Software Engineering by Frederick P. Brooks, Jr.

This book, written in 1975, offers a fascinating insight into the software engineering process used at that time. The author draws from his experience as project manager for the IBM System/360 and OS/...   Read More

Writing my First Program to Toggle in to the IMSAI 8080

I have long been fascinated with entering programs into computers by methods not involving a standard keyboard and monitor. This interest was peeked by my last article: Using the latest z80pack, versi...   Read More

Installing the HI-TECH Z80 C Compiler for CP/M

My language of choice is C and I am currently getting more involved with the CP/M operating system. I have therefore decided that it would be nice to have a C compiler working under CP/M. There are a...   Read More

Installing ZDE 1.6, a programmers editor for CP/M

To do any serious programming under CP/M, the first thing you need is a good programmers editor. There aren't many in the archives, but I have tried most of them and found ZDE to be the best. It is s...   Read More

How to share an SSL certificate and still use cookies

Website hosting companies often provide a shared SSL certificate, but this presents the web designer with the problem of how to use it for a site that uses cookies. I have read many people say that th...   Read More

Is Cobol Really Understandable After 14 Years?

COBOL has been in the news quite a lot recently and I have been reading that there are still huge amounts of COBOL code running and being written. This led me to wonder why this language was still bei...   Read More

View All Articles