Skip to content
Simon Rawles edited this page Nov 6, 2016 · 1 revision

We started exploring how to program the Analytical Engine using the simulator

Example programs:

To divide 7 by 5 and print the remainder:

T1
N275 7
N302 5
/
L275
L302
P'

To find the absolute value of a number:

T1
N001 0
N002 -77
-
L001
L002
CF?1
S002
. print register 2
L002
P

(Replace the -77 with any number as the input)

Plotting y=x^3 using the inbuilt plotter

T1
.Iteration variable
N000 -10000000000000000000000000
.Step
N001 100000000000000000000000
.Number of steps
N002    201
.Constants
N003    1
N004    0
(?
.Load x
+
L000
.send x to plotter
DX
.Calculate x^3
x
L000
L000
.scaling (10^25 is 1 under decimal rep)
>25
S005
L000
L005
>25
.plot x^3
DY
.pen down
D+
.increment x location
+
L000
L001
S000
.decrease steps remaining
-
L002
L003
S002
.check loop condition
L004
L002
)

Plotting a sigmoid function:

    N001 0

. Input variable x:
N002 -10000000000000000000000000
N006 +10000000000000000000000000
. Scaling parameter c:
N004 1000000000000000000000000
. Step iteration
N005 100000000000000000000000


(
+
L002
L005
S002
DX
+
L001
L002
S003
-
L001
L003
CF?1
S003
+
L004
L003
S003
/
L002
<25
L003
S003'
DY
D+
-
L006
L002
CF?1
)
D-

We also wrote a program that can play a tune: [Music]

Clone this wiki locally