September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
33
Task/Even-or-odd/EDSAC-order-code/even-or-odd.edsac
Normal file
33
Task/Even-or-odd/EDSAC-order-code/even-or-odd.edsac
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
[ Even or odd
|
||||
===========
|
||||
|
||||
A program for the EDSAC
|
||||
|
||||
Determines whether the number stored at
|
||||
address 15@ is even or odd, and prints
|
||||
'E' or 'O' accordingly
|
||||
|
||||
Works with Initial Orders 2 ]
|
||||
|
||||
T56K [ load point ]
|
||||
GK [ base address ]
|
||||
|
||||
O11@ [ print letter shift ]
|
||||
T10@ [ clear accumulator ]
|
||||
H15@ [ multiplier := n ]
|
||||
C12@ [ acc +:= mult AND 1 ]
|
||||
S12@ [ acc -:= 1 ]
|
||||
G8@ [ branch on negative ]
|
||||
O14@ [ print 'O' ]
|
||||
ZF [ halt ]
|
||||
[ 8 ] O13@ [ print 'E' ]
|
||||
ZF [ halt ]
|
||||
|
||||
[ 10 ] P0F [ used to clear acc ]
|
||||
[ 11 ] *F [ letter shift character ]
|
||||
[ 12 ] P0D [ const: 1 ]
|
||||
[ 13 ] EF [ character 'E' ]
|
||||
[ 14 ] OF [ character 'O' ]
|
||||
[ 15 ] P18D [ number to test: 37 ]
|
||||
|
||||
EZPF [ branch to load point ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue