Skip to content
Tech News
← Back to articles

The Mouse Programming Language on CP/M (2020)

read original more articles
Why This Matters

The Mouse programming language, developed in the 1970s for microcomputers like CP/M, exemplifies how high-level language features can be implemented efficiently on resource-constrained systems. Its design emphasizes simplicity and power, making it relevant for understanding the evolution of programming languages tailored for early microcomputers and embedded systems. This highlights the ongoing importance of lightweight, versatile languages in modern computing environments.

Key Takeaways

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. One obvious difference to Forth is that Mouse interprets a stream of characters most of which are only a single character and it relies more on variables rather than rearranging the stack as much. The version for CP/M on the Walnut Creek CD is quite small at only 2k.

Peter Grogono says in Byte Magazine Volume 04 Number 07 - July 1979:

The justification for Mouse is that it incorporates many features of high level languages, yet it can be implemented without the resources needed by most high level languages. More specifically, Mouse programs demonstrate the use and implementation of arrays, functions, procedures, nested control structures, local variables, recursion and several methods of passing parameters from one procedure to another.

Hello, World! Example

As a first example to show what Mouse code looks like, here is a program to output "Hello, Word!" ten times to the screen.

~ Output 'Hello, World' ten times 10 c: ( c. ^ "Hello, World!" c. 1 - c: ) $

The first line beginning with ~ is a comment indicated by the ~ character.

Next we have 10 c: This pushes 10 onto the stack, then c: pops it off the stack and stores it in the c variable. c is being used as a counter.

We now have a loop begun using the ( character and ended using with ) . This loop will process its contents indefinitely until it is broken out of using the ^ character.

Next we have c. ^ , the c. pushes the contents of variable c onto the stack and then ^ pops it off the stack and if it is less than 1 it breaks out of the loop.

... continue reading