summaryrefslogtreecommitdiffstats
path: root/mix/1.3.2/saddle-point.mixal
blob: 924a6120ac9f02cf781e38874456d1e5cf73ad23 (plain) (blame)
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
        ORIG 2000
START   ENTA 0 Register A tracks current row i
        ENT4 1008 Will contain address of element being compared against the current row min.
RC      ENT5 4095 Contains the current row min.
        INCA 1
        CMPA =9=
        JLE  2F
        ENT1 0
        JMP  STOP
2H      INC4 1
        ENT3 1 j counter
2H      CMP5 0,4
        JL   4F
        JE   3F
        LD5  0,4 Load new min in row
        ENT2 -1 Reset I2
3H      ENT1 0,4 Store address of min in I1
        INC2 1
        ST3  1000,2 Store j in aux. list.
4H      INC4 1
        INC3 1 Incr j counter
        CMP3 =8=
        JLE  2B
PCOL    LD6  1000,2 Position of first row in min col
        INC6 1008
        ENT3 1 i counter
6H      CMP5 0,6
        JL   8F
        INC6 8
        INC3 1
        CMP3 =9=
        JLE  6B
        JMP  STOP
8H      DEC2 1
        J2N  RC
FUCK    LD1 1000,2 Load address of new min in I1.
        INC1 -9,4
        JMP PCOL
STOP    HLT
        END START