summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2018-02-22 02:29:21 +0000
committerrsiddharth <s@ricketyspace.net>2018-02-22 02:29:21 +0000
commit4c6449f09ed390cc2fc08830cb1d2fb6c0abe044 (patch)
tree33a15e128ad2be62ab2ec64e6a1f836c3501dfb3
parent30c402cd6ce21dd14b3ad28fb33c82720de6f6a6 (diff)
mix: 1.3.2: Update saddle-point.mixal.
-rw-r--r--mix/1.3.2/saddle-point.mixal39
1 files changed, 21 insertions, 18 deletions
diff --git a/mix/1.3.2/saddle-point.mixal b/mix/1.3.2/saddle-point.mixal
index 7924a7c..7e086bc 100644
--- a/mix/1.3.2/saddle-point.mixal
+++ b/mix/1.3.2/saddle-point.mixal
@@ -1,29 +1,32 @@
* This program is work in progress.
ORIG 2000
-START NOP
-RC ENT5 4095
- LD4 CUR(4:4) load i into I4
- LD4 3000,4
+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 NOP
- HLT
- ORIG 3000
-RS CON 0
- CON 1009
- CON 1017
- CON 1025
- CON 1033
- CON 1041
- CON 1049
- CON 1057
- CON 1065
- CON 1073
-CUR CON 65 00 00 00 01 01 -> a(0, 0, i, j)
+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
+ JMP RC
+STOP HLT
END START