Sample Programs

RAM Board
In and Out

Reads an integer and prints it out. Good first test run.

1020
Read, store in 20
1120
Print data in 20
4300
Halt
Sum of Two Integers

Reads two intergers, calculates the sum, and prints the sum.

1007
Read A, store in 07
1008
Read B, store in 08
2007
Load A in Acc
3008
Add B
2109
Store sum (A+B) in 09
1109
Write sum
4300
Halt
Max of Two Integers

Reads two integers, determines the larger, and prints out the larger.

00 1009
Read A
01 1010
Read B
02 2009
Load A
03 3110
Subtract B
04 4107
if Acc<0 goto 07
05 1109
else Print A
06 4300
Halt
07 1110
Print B
08 4300
Halt
Calculate List Average

Reads a list of integers, calculates the average and prints out the average.

  • 00 - 1050   Read C, init to 0 (list length count)
  • 01 - 1051   Read i, init to 1 (increments count)
  • 02 - 1052    Read Sum, init to 0
  • 03 - 1053    Read N (enter 0 to END list)
  • 04 - 2053
  • 05 - 4212
  • 06 - 3052
  • 07 - 2152
  • 08 - 2050
  • 09 - 3051
  • 10 - 2150
  • 11 - 4003
  • 12 - 2052
  • 13 - 3350
  • 14 - 2154
  • 15 - 1154
  • 16 - 4300

back arrowSim3 Operation next