# The Gill Test
# Copyright Tom Jennings 1999-2002, tomj@wps.com
# A measure of the arithmetic speed of an automatic computer. It is
# defined as the time in milliseconds required for a computer to:
#
# A + B = C {Store C} C + D + E = F {Store F} G x H = K {Store K}
# when all access is to the fastest internal storage used in the computer
# in question. For a one-address computer only with one constant storage
# access storage device {such as magnetic cores}, a gill is equal to
# ten times the average operation time.
# {Named after Stanley Gill of Cambridge University}
#
# In this age of Whetstones and Drystones and 500 MHz chips this measure
# in m-sec is not very significant, but back in 1960 it was a valid
# speed test.
track 0
sector 0 # OPTIMIZED 64x5
ldm a # A
addm b # + B
sto cc # = C
addm d # + D
addm e # + E
sto f # = F
lda C+2
# jump mult
halt 0
# Multiply MCAND by MPER and leave the
# single-precision result in MQ
sector 10
mult: sta multr
and 0
sto MQ
ld 1
sto mtest # m'per digit tester
mult1: ldm MPER
andm mtest # test m'per digit
snz # (carry is clear)
jump mult2 # add in MCAND if 1
ldm MCAND # MCAND lo
addm MQ # + MQ lo
sto MQ # = MQ lo
mult2: ldm MCAND
rlc # shift multiplicand
sto MCAND # MCAND * 2
ldm mtest
or 0 # clear carry
rlc
snz # if no more bits
multr: jump 0 # done.
sto mtest
jump mult1
# 33
sector 39
a: 123456
b: 123456
cc: 123456
d: 123456
e: 123456
f: 123456
g: 123456
h: 123456
k: 123456
sector 54 # OPTIMIZED 64x5
MPER: 174762 # 525252, 9 1's, 9 0's
Mtest: 0
MQ: 0
MCAND: 0