Augustana University College

COMPUTING SCIENCE 370
Programming Languages


Pseudo-code Interpreters



Machine Language

Complications

Early Program Design Notations


AUTOMATION PRINCIPLE
Automate mechanical, tedious, or error-prone activities.

Pseudo-code example: IBM 650 (1955)


IMPOSSIBLE ERROR PRINCIPLE
Making errors impossible to commit is preferable to detecting them after their commission.

Instruction Format and Security

Addresses must be limited to 3 digits, as only 1000-word data space.

How many addresses can be placed in an instruction?

Code format:
  CODE SOURCE 1 SOURCE 2 DEST
± 1 digit 3 digits 3 digits 3 digits
Instruction table:
OP + -  
0 z <- (x)   move
1 z <- (x) + (y) z <- (x) - (y) add / subtract
2 z <- (x) * (y) z <- (x) / (y) multiply / divide
3 z <- square(x) z <- sqrt(x) square / square root
4 if (x) = (y) goto Z if (x) != (y) goto Z test equality
5 if (x) >= (y) goto Z if (x) < (y) goto Z test inequality
6 z <- (x + (y)) y + (z) <- (x) indexing
7 x <- (x) + 1
if (x) < (y) goto Z
  increment and test (looping)
8 read into z print (x) I/O
9 stop   halt

lowercase = data space; uppercase = code space; ( ) = contents of address

Principles illustrated by the operation table:

ORTHOGONALITY PRINCIPLE
Independent functions should be controlled by independent mechanisms.

orthogonal
right-angled; varying independently (as along different axes)

REGULARITY PRINCIPLE
Regular rules, without exceptions, are easier to learn, use, describe, and implement.


ABSTRACTION PRINCIPLE
Avoid requiring something to be stated more than once: factor out the recurring pattern.

Questions

  1. What is the read-execute cycle?
  2. Debugging: What is a trace? What is the difference between a breakpoint and a data trap?
  3. What principle would motivate us to add support for symbolic labels to our interpreter?
  4. What data structure is used to associate symbolic labels with data addresses (variables)?
  5. What principle would motivate us to perform bounds checking during array references (operations +6 and -6)?
  6. What does it mean for a tool to be ampliative? reductive?

Copyright © 2000 Jonathan Mohr