-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcrypto1.mms
73 lines (71 loc) · 1.68 KB
/
crypto1.mms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
* Cryptanalysis Problem (CLASSIFIED) (pipelined)
a GREG
b GREG
bb GREG
c GREG
t GREG
x GREG
y GREG
LOC Data_Segment
freq GREG @ Base address for byte counts
LOC @+8*(1<<8) Space for the byte frequencies
p GREG @
BYTE "abracadabraa",0,"abc" Trivial test data
ones GREG #0101010101010101
LOC #100
Start LDOU a,p,0
INCL p,8
BDIF t,ones,a
BNZ t,3F Do main loop, unless near the end.
2H SRU b,a,53
LDO c,freq,b Load old count.
SLU bb,a,8
INCL c,1
SRU bb,bb,53
STO c,freq,b Store new count.
LDO c,freq,bb
SLU b,a,16
INCL c,1
SRU b,b,53
STO c,freq,bb
LDO c,freq,b Load old count.
SLU bb,a,24
INCL c,1
SRU bb,bb,53
STO c,freq,b Store new count.
LDO c,freq,bb
SLU b,a,32
INCL c,1
SRU b,b,53
STO c,freq,bb
LDO c,freq,b Load old count.
SLU bb,a,40
INCL c,1
SRU bb,bb,53
STO c,freq,b Store new count.
LDO c,freq,bb
SLU b,a,48
INCL c,1
SRU b,b,53
STO c,freq,bb
LDO c,freq,b Load old count.
SLU bb,a,56
INCL c,1
SRU bb,bb,53
STO c,freq,b Store new count.
LDO c,freq,bb
LDOU a,p,0
INCL p,8
INCL c,1
BDIF t,ones,a
STO c,freq,bb
PBZ t,2B Do main loop, unless near the end.
3H SRU b,a,53
LDO c,freq,b Load old count.
INCL c,1
STO c,freq,b Store new count.
SRU b,b,3
SLU a,a,8
PBNZ b,3B Continue unless done.
POP
Main IS Start