Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,112 @@
|
|||
[Demo of matrix transposition. Not in place, creates a new matrix.
|
||||
EDSAC, Initial Orders 2.]
|
||||
..PZ [blank tape and terminator]
|
||||
T 50 K [to call matrix transpose subroutine with 'G X']
|
||||
P 200 F [address of matrix transpose subroutine]
|
||||
T 47 K [to call matrix print subroutine with 'G M']
|
||||
P 100 F [address of matrix print subroutine]
|
||||
T 46 K [to call print subroutine with 'G N']
|
||||
P 56 F [address of print subroutine (EDSAC library P1)]
|
||||
|
||||
[Subroutine to transpose a matrix of 17-bit real numbers, not in place.
|
||||
Caller must ensure original and transpose don't overlap.
|
||||
Parameters, all in the address field (i.e. denote n by P n F)
|
||||
10F = width (number of columns)
|
||||
11F = height (number of rows)
|
||||
12F = start address of input matrix
|
||||
13F = start address of output matrix]
|
||||
E25K TX GK
|
||||
|
||||
[The subroutine loads elements by working down each column in turn.
|
||||
Elements are stored at consecutive locations in the transposed matrix.]
|
||||
A3F T31@ [set up return to caller]
|
||||
A13F A33@ T14@ [initialize T order for storing transpose]
|
||||
A12F A32@ U13@ [initialize A order for loading original]
|
||||
T36@ [also save as A order for top of current column]
|
||||
S10 F [negative of width]
|
||||
[10] T35@ [initialize negative counter]
|
||||
S11 F [negative of height]
|
||||
[12] T34@ [initialize negative counter]
|
||||
[13] AF [maunfactured order; load matrix element]
|
||||
[14] TF [maunfactured order; store matrix element]
|
||||
A14@ A2F T14@ [update address in T order]
|
||||
A13@ A10F T13@ [update address in A order]
|
||||
A34@ A2F G12@ [inner loop till finished this column]
|
||||
A36@ A2F U36@ T13@ [update address for start of column]
|
||||
A35@ A2F G10@ [outer loop till finished all columns]
|
||||
[31] ZF [exit]
|
||||
[32] AF [added to an address to make A order for that address]
|
||||
[33] TF [added to an address to make T order for that address]
|
||||
[34] PF [negative counter for rows]
|
||||
[35] PF [negative counter for columns]
|
||||
[36] AF [load order for first element in current column]
|
||||
|
||||
[Subroutine to print a matrix of 17-bit real numbers.
|
||||
Straightforward, so given in condensed form.
|
||||
Parameters (in the address field, i.e. pass n as PnF):
|
||||
10F = width (number of columns)
|
||||
11F = height (number of rows)
|
||||
12F = start address of matrix
|
||||
13F = number of decimals]
|
||||
E25K TM
|
||||
GKA3FT30@A13FT18@A12FA31@T14@S11FT36@S10FT37@O34@O35@TDAFT1FA16@
|
||||
GN [call library subroutine P1]
|
||||
PFA14@A2FT14@A37@A2FG10@O32@O33@A36@A2FG8@ZFAF@F&F!FMFPFPF
|
||||
|
||||
[Library subroutine P1.
|
||||
Prints number in 0D to n places of decimals, where
|
||||
n is specified by 'P n F' pseudo-order after subroutine call.]
|
||||
E25K TN
|
||||
GKA18@U17@S20@T5@H19@PFT5@VDUFOFFFSFL4FTDA5@A2FG6@EFU3FJFM1F
|
||||
|
||||
[Main routine]
|
||||
PK T300K GK
|
||||
[Constants]
|
||||
[0] #F [figures shift on teleprinter]
|
||||
[1] @F [carriage return]
|
||||
[2] &F [line feed]
|
||||
[3] P3F [number of columns (in address field)]
|
||||
[4] P5F [number of rows (in address field)]
|
||||
[5] P400F [address of matrix]
|
||||
[6] P500F [address of transposed matrix]
|
||||
[7] P2F [number of decimals when printing matrix]
|
||||
[8] TF [add to address to make T order]
|
||||
[9] P328F [0.0100097...., matrix elements are multiples of this]
|
||||
[Variables]
|
||||
[10] PF [matrix element, initialized to 0.00]
|
||||
[11] PF [negative counter]
|
||||
|
||||
[Enter with acc = 0]
|
||||
[12] O@ [set figures mode on teleprinter]
|
||||
A5@ [address of matrix]
|
||||
A8@ [make T order to store first elememt]
|
||||
T24@ [plant in code]
|
||||
H4@ N3@ L64F L32F [acc := negative number of entries]
|
||||
[20] T11@ [initialize negative counter]
|
||||
A10@ A9@ U10@ [increment matrix element]
|
||||
[24] TF [store in matrix]
|
||||
A24@ A2F T24@ [inc store address]
|
||||
A11@ A2F G20@ [inc negative counter, loop till zero]
|
||||
|
||||
[Matrix is set up, now print it]
|
||||
A3@ T10F [10F := width]
|
||||
A4@ T11F [11F := height]
|
||||
A5@ T12F [12F := address of matrix]
|
||||
A7@ T13F [13F := number of decimals]
|
||||
[39] A39@ GM [call print subroutine]
|
||||
O1@ O2@ [add CR LF]
|
||||
|
||||
[Transpose matrix: 10F, 11F, 12F stay the same]
|
||||
A6@ T13F [13F := address of transpose]
|
||||
[45] A45@ GX [call transpose routine]
|
||||
|
||||
[Print transpose]
|
||||
A10F TF A11F T10F AF T11F [swap width and height]
|
||||
A13F T12F [12F := address of transpose]
|
||||
A7@ T13F [13F := number of decimals]
|
||||
[57] A57@ GM [call print subroutine]
|
||||
|
||||
O@ [figures mode, dummy to flush teleprinter buffer]
|
||||
ZF [stop]
|
||||
E12Z [enter at 12 (relative)]
|
||||
PF [accumulator = 0 on entry]
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
[Transpose a matrix in place. EDSAC, Initial Orders 2.]
|
||||
..PZ [blank tape and terminator]
|
||||
T50K [to call matrix transpose with 'G X']
|
||||
P160F [address of matrix transpose subroutine]
|
||||
T47K [to call matrix print subroutine with 'G M']
|
||||
P120F [address of matrix print subroutine]
|
||||
T46K [to call print subroutine with 'G N']
|
||||
P56F [address of print subroutine (P1 in EDSAC library)]
|
||||
T48K [to call division subroutine with 'G &']
|
||||
P77F [address of division subroutine]
|
||||
|
||||
[Subroutine to transpose a matrix of 17-bit values in place.
|
||||
Translated and slightly modified from C version on Rosetta Code website.
|
||||
Parameters, all in the address field (i.e. n is stored as P n F):
|
||||
10F = width (number of columns, "w" in C program)
|
||||
11F = height (number of rows, "h" in C program)
|
||||
12F = start address of matrix]
|
||||
E25K TX GK
|
||||
A3F T64@ [set up return to caller]
|
||||
H10F V11F L32F L64F [acc := size of matrix as width*height]
|
||||
T84@ T85@ [store size; C variable start := 0]
|
||||
[8] TF A85@ T86@ T87@ [set C variables, next := start, i := 0]
|
||||
[12] TF A87@ A2F T87@ [i++]
|
||||
A16@ G65@ [call subroutine to update "next"]
|
||||
A85@ S86@ G12@ [acc := start - next, loop back if < 0]
|
||||
[Skip to location 58 if acc > 0 or i = 1.
|
||||
We already know that acc >= 0 and i > 0.]
|
||||
S2F E58@ [subtract 1 from acc, skip if still >= 0]
|
||||
S2F A87@ G58@ [acc := -2 + i, skip if < 0]
|
||||
[The assignment next := start in the C program is unnecessary]
|
||||
TF A86@ A12F A81@ T31@ [make and plant order to load m{next}]
|
||||
[31] AF T83@ [tmp := m{next}]
|
||||
[33] TF [clear acc; also added to an address to make T order for that address]
|
||||
[34] A86@ A12F A33@ T54@ [make and plant order to store m{next}]
|
||||
A38@ G65@ [call subroutine to update "next"]
|
||||
A86@ S85@ G48@ [go to 48 if i < start]
|
||||
S2F E48@ [go to 48 if i > start]
|
||||
TF A82@ G52@ [make order to load tmp, and go to 52]
|
||||
[48] TF A86@ A12F A81@ [make order to load m{next}]
|
||||
[52] T53@ [plant order to load tmp or m{next}]
|
||||
[53] AF [manufactured order; if i = start loads tmp, else loads m{next}]
|
||||
[54] TF [manufactured order; stores m{next}, using old value of "next"]
|
||||
A85@ S86@ G33@ [acc := start - next, loop back if < 0]
|
||||
[58] TF A85@ A2F U85@ [start++]
|
||||
S84@ G8@ [loop until start = size]
|
||||
[64] ZF [overwritten by return to caller]
|
||||
[Subroutine to execute next = (next % h) * w + next / h in C program]
|
||||
[65] A3F T80@ [set up return to caller]
|
||||
A86@ T4F A11F T5F [set up parameters to divide "next" by "h"]
|
||||
A71@ G& [call division subroutine]
|
||||
[In case anybody is following this in detail, note that "next" and "h" are
|
||||
stored in the address field, so we need to shift the quotient 1 left]
|
||||
H4F V10F L64F L16F A5F LD T86@ [compute RHS and store in "next"]
|
||||
[80] ZF [overwritten by return to caller]
|
||||
[Constants]
|
||||
[81] AF [added to an address to make A order for that address]
|
||||
[82] A83@ [order to load C variable "tmp"]
|
||||
[Variables; integers are stored in the address field for convenience.]
|
||||
[83] PF [C variable "tmp" (holds value of a matrix element)]
|
||||
[84] PF [size of matrix, width*height]
|
||||
[85] PF [C variable "start"]
|
||||
[86] PF [C variable "next"]
|
||||
[87] PF [C variable "i"]
|
||||
|
||||
[Subroutine to print a matrix of 17-bit real numbers.]
|
||||
E25K TM
|
||||
GKA3FT30@A13FT18@A12FA31@T14@S11FT36@S10FT37@O34@O35@TDAFT1FA16@
|
||||
GN
|
||||
PFA14@A2FT14@A37@A2FG10@O32@O33@A36@A2FG8@ZFAF@F&F!FMFPFPF
|
||||
|
||||
[Library subroutine P1.
|
||||
Prints positive number in 0D to n places of decimals, where
|
||||
n is specified by 'P n F' pseudo-order after subroutine call.]
|
||||
E25K TN
|
||||
GKA18@U17@S20@T5@H19@PFT5@VDUFOFFFSFL4FTDA5@A2FG6@EFU3FJFM1F
|
||||
|
||||
[Integer division: number at 4F, divisor at 5F
|
||||
Returns remainder at 4F, quotient at 5F
|
||||
Working location 0D. 37 locations.]
|
||||
E25K T&
|
||||
GKA3FT34@A5FUFT35@A4FRDS35@G13@T1FA35@LDE4@T1FT5FA4FS35@G22@
|
||||
T4FA5FA36@T5FT1FAFS35@E34@T1FA35@RDT35@A5FLDT5FE15@EFPFPD
|
||||
|
||||
[Main routine]
|
||||
[Given in condensed form, since it's the same as in part 1, except
|
||||
that the address of the transposed matrix is not required.]
|
||||
PKT250KGK#F@F&FP7FP4FP320FP2FTFP328FPFPFO@A5@A7@T23@H4@N3@L64FL32F
|
||||
T10@A9@A8@U9@TFA23@A2FT23@A10@A2FG19@A3@T10FA4@T11FA5@T12FA6@T13F
|
||||
A38@GMO1@O2@A42@GXA10FTFA11FT10FAFT11FA50@GMO@ZFE11ZPF
|
||||
Loading…
Add table
Add a link
Reference in a new issue