-
Notifications
You must be signed in to change notification settings - Fork 0
/
year41.hrm
70 lines (56 loc) · 1.85 KB
/
year41.hrm
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
-- HUMAN RESOURCE MACHINE PROGRAM --
-- 41: Sorting Floor
-- INSTRUCTIONS: "For each zero terminated string in the INBOX, SORT the
-- contents of the string, smallest first, biggest last, and put the
-- results in the OUTBOX. Repeat for each string!"
-- AVAILABLE COMMANDS: INBOX, OUTBOX, COPYFROM, COPYTO, ADD, SUB,
-- BUMPUP, BUMPDN, JUMP, JUMPZ, JUMPN, COMMENT
-- SIZE: 22 commands (challenge 34)
-- AVERAGE RUNTIME: 646 steps (challenge 714)
-- Tile 22: Running minimum of values currently on the floor
-- Tile 23: Pointer into the string on the floor
-- Tile 24: Pointer to the end of the string on the floor
-- Perform selection sort using the outbox as the sorted portion and
-- the floor as the unsorted portion.
a:
b:
INBOX
JUMPZ d
COPYTO [24]
BUMPUP 24
JUMP a
c:
COPYFROM [22]
OUTBOX
COPYFROM 24
JUMPZ b
COPYFROM [24]
COPYTO [22]
d:
BUMPDN 24
COPYTO 22
COPYTO 23
e:
f:
BUMPDN 23
JUMPN c
COPYFROM [22]
SUB [23]
JUMPN e
COPYFROM 23
COPYTO 22
JUMP f
DEFINE LABEL 22
eJzTZ2BgiIpQ67wRwTJ/ZgTvZSCXITySYU5QtNGkE3HPO10SUjtK0pa052Tm9r3I2jJZPfscWM2LrM+T
UnJy+2YUqHW2lqd21Fat6f1ZXTX9Z3XIqu01S7ZW1EDMCu2UbQ7trJsl3NW1WLgLIhbR8ToORBdNm924
cVrdrHXTJdflT4eYqzujcOLKmc87H89+3Oaz5F4z6/J7zQdWPG77u/J1T+Vq+9nma2I2mK/5cbhyNUT9
KBgFo4AyAAC7YlWZ;
DEFINE LABEL 23
eJzjZGBgmFC8N1uwmGX+1UK17VcLGU4FF3FcCCx2Pw+UYvAu3WHFQAVwp00rTqxzTTyIXT+xNG3fxJBV
DhMj1oL4vydNrv496Vz5zsknS17M/JMVP3dnBu8S6yxq2DsKRsEowA8AC+Mkqg;
DEFINE LABEL 24
eJwzY2BguBfWtZgjvmtxXVLbAquUvTN3J2v17EtS6+yMS2i9FqnYJhWh1rkwdMME1ZCDc54FS65LDUnd
phC2Yd+1yLoTx+KPnq1McT8PNIbhVv6thlv5uXui89vOgfjihSzzxQurpgcWr+iyrl7Sblj/vDO7cU3v
0mb72UubBVe8bDx4CqQucr71jNvzcvsWz1Zs+zF5fotr//NOj741vSd7/8zg6Hu960i//cl/E9vOmU7t
vrhuevdF1dlNpyPnP98+c37i5pCF/V5guxYkbhZfwHDq6oJzl4UW9V9hGAWjYBQQBQCW+2ff;
-- vim: set autoindent: