summaryrefslogtreecommitdiffstats
path: root/mix/1.3.2/saddle-point.mixal
blob: 67d0ce8c55fb98d8163e86cc67030e5603c0d004 (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
* This program is work in progress.
        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
        JLE  4F
        LD5  0,4 load new min in row
        ENT1 0,4 store address of min in I1
        ENT2 0,3 store col position (j)
4H      INC4 1
        INC3 1 incr counter
        CMP3 =8=
        JLE  2B
PCOL    ENT2 1008,2 position of first row in min col
        ENT3 1 i counter
6H      CMP5 0,2
        JL   RC
        INC2 8
        INC3 1
        CMP3 =9=
        JLE  6B
STOP    HLT
        END START