ArticleslgStudy

science

Mouse (programming language)

Mouse (programming language) is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Mouse (programming language) rather than just read about it. In short: The Mouse (sometimes written as MOUSE) programming language is a small computer programming language developed by Dr. Peter Grogono in the late 1970s and early 1980s.

Key takeaways

  • Mouse (programming language) belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Mouse (programming language) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Mouse (programming language) from memory before moving on to harder problems.

Reference excerpt

The Mouse (sometimes written as MOUSE) programming language is a small computer programming language developed by Dr. Peter Grogono in the late 1970s and early 1980s. It was developed as an extension of an earlier language called MUSYS, which was used to control digital and analog devices in an electronic music studio. Mouse was originally intended as a small, efficient language for microcomputers with limited memory. It is an interpreted, stack-based language and uses Reverse Polish notation. To make an interpreter as easy as possible to implement, Mouse is designed so that a program is processed as a stream of characters, interpreted one character at a time. The elements of the Mouse language consist of a set of (mostly) one-character symbols, each of which performs a specific function (see table below). Since variable names are limited to one character, there are only 26 possible variables in Mouse (named A-Z). Integers and characters are the only available data types. Despite these limits, Mouse includes a number of relatively advanced features, including:

Conditional branching Loops Pointers Macros (subroutines (which may be recursive)) Arrays Code tracing The design of the Mouse language makes it ideal for teaching the design of a simple interpreter. Much of the book describing Mouse is devoted to describing the implementation of two interpreters, one in Z80 assembly language, the other in Pascal.

Details The language described here is the later version of Mouse, as described in the Mouse book. This version is an extension of the language described in the original magazine article.

Symbols The following table describes each of the symbols used by Mouse. Here X refers to the number on the top of the stack, and Y is the next number on the stack.

Expressions

Common idioms These expressions appear frequently in Mouse programs.

X: ~ store into variable X X. ~ recall variable X X. Y: ~ copy X into Y N. 1 + N: ~ increment N by 1 P. Q. P: Q: ~ swap values of P and Q ? A: ~ input a number and store in A P. ! ~ print variable P

Input Mouse may input integers or characters. When a character is input, it is automatically converted to its ASCII code.

? X: ~ input a number and store into X ?' X: ~ input a character and store its ASCII code into X

Output Mouse may print integers, characters, or string constants, as shown in these examples. If an exclamation point appears in a string constant, a new line is printed.

X. ! ~ recall number X and print it X. !' ~ recall ASCII code X and print character "Hello" ~ print string "Hello" "Line 1!Line 2" ~ print strings "Line 1" and "Line 2" on two lines

Conditionals A conditional statement has the general form:

B [ S ] ~ equivalent to: if B then S

Here B is an expression that evaluates to 1 (true) or 0 (false), and S is a sequence of statements.

Loops Loops may have one of several forms. Most common are the forms:

(B ^ S) ~ equivalent to: while B do S (S B ^) ~ equivalent to: repeat S until (not B)

Here again B is a boolean value (0 or 1), and S is a sequence of statements.

Macro calls The format of a macro (subroutine) call may be illustrated by the following example. Macro A in this example adds the two parameters passed to it from the main program, and returns the sum on the top of the stack.

#A,p1,p2; ~ call in main program to macro A ... $A 1% 2% + @ ~ macro A (add parameters p1 and p2)

Here p1 and p2 are parameters passed to the macro.

Example programs This short program prints 'Hello world.'

"Hello world." $ This program displays the squares of the integers from 1 to 10.

1 N: ~ initialize N to 1 ( N. N. * ! " " ~ begin loop; print squares of numbers N. 10 - 0 < ^ ~ exit loop if N >= 10 N. 1 + N: ) $ ~ increment N and repeat loop

Notes

External links The Mouse Programming Language The Great MOUSE Programming Language Revival Friends of the Mouse Mouse, the Language Mouse: Computer Programming Language (includes source code for Mouse interpreters) Information on sourceforge.net

Worked examples

Example 1 — a first encounter with Mouse (programming language)

Start with the simplest possible case. Write down what Mouse (programming language) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Mouse (programming language) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Mouse (programming language) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Mouse (programming language)

In research
Mouse (programming language) appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Mouse (programming language) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Mouse (programming language) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Stack-oriented programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for Mouse (programming language) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Mouse (programming language)” →

How to study Mouse (programming language) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Mouse (programming language) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Mouse (programming language) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Mouse (programming language) in simple terms?

The Mouse (sometimes written as MOUSE) programming language is a small computer programming language developed by Dr. Peter Grogono in the late 1970s and early 1980s.

Why does Mouse (programming language) matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Mouse (programming language)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Mouse (programming language).

Tags

  • Stack-oriented programming languages

Keep exploring