@@ -46,7 +46,7 @@ GO: MOVE P,[-100,,PDL-1]
46
46
PUSHJ P,FILL ;Fill the rest with alternating 236. and 17.
47
47
PUSHJ P,REDSOL ;Compute Reed-Solomon error correcting codes.
48
48
PUSHJ P,INTERL ;Interleave bytes from all blocks.
49
- PUSHJ P,FUNC ;Draw function patterns.
49
+ PUSHJ P,FUNC ;Draw function patterns.
50
50
PUSHJ P,ZIGZAG ;Draw output data.
51
51
PUSHJ P,EVAL ;Evaluate penalty scores.
52
52
PUSHJ P,APPLY ;Apply mask.
@@ -93,7 +93,7 @@ READ3: .CALL [ SETZ ;Open input file.
93
93
MOVE FN1
94
94
MOVE FN2
95
95
SETZ SNAME ]
96
- .VALUE
96
+ .LOSE %LSFIL
97
97
MOVE A,[440700,,MESSAGE]
98
98
MOVEM A,PTR
99
99
SETZM LENGTH'
@@ -105,8 +105,10 @@ READ4: .IOT DSKIC,B ;Read data from input.
105
105
IDPB B,PTR
106
106
PUSHJ P,CHECK ;Check data mode.
107
107
MOVEM A,MODE
108
- AOS LENGTH ;Keep track of data length.
109
- JRST READ4
108
+ AOS C,LENGTH ;Keep track of data length.
109
+ CAIGE C,MAX ;Maximum size of input buffer.
110
+ JRST READ4
111
+ POPJ P,
110
112
111
113
DEV: SIXBIT /TTY/
112
114
FN1: 0
@@ -126,9 +128,11 @@ INIT: MOVE A,[440100,,DATA]
126
128
127
129
SETZM VERSION
128
130
129
- INIT1: AOS VERSION
130
- MOVE A,VERSION ;Compute size from version.
131
- IMULI A,4
131
+ INIT1: AOS A,VERSION
132
+ CAILE A,40.
133
+ .VALUE [ASCIZ /:Data doesn't fit in a single QR code.
134
+ /]
135
+ IMULI A,4 ;Compute size from version.
132
136
ADDI A,17.
133
137
MOVEM A,SIZE'
134
138
@@ -579,20 +583,20 @@ EVAL3: SETZM PENALTY'
579
583
EVAL4: MOVE B,(P)
580
584
MOVEI D,0
581
585
SETZM DOTS'
582
- PUSHJ P,BEGIN
586
+ PUSHJ P,BEGIN ;Initialize run check.
583
587
EVAL5: MOVEI C,1
584
588
PUSHJ P,RUN ;Check for run of five or more.
585
589
PUSHJ P,FINDISH ;Check for finder-like pattern.
586
- PUSHJ P,TALLY ;Compute total number of dark/light .
590
+ PUSHJ P,TALLY ;Compute total number of dark modules .
587
591
EXCH A,B
588
- exch d,dots
589
- exch f,state
592
+ EXCH D,DOTS
593
+ EXCH F,STATE
590
594
MOVEI C,177. ;Now check in other direction.
591
595
PUSHJ P,RUN
592
596
PUSHJ P,FINDISH
593
597
EXCH A,B
594
- exch d,dots
595
- exch f,state
598
+ EXCH D,DOTS
599
+ EXCH F,STATE
596
600
AOBJN B,EVAL5
597
601
AOBJN A,EVAL4
598
602
@@ -646,7 +650,9 @@ DARK: PUSHJ P,MODULE
646
650
JRST RUN1
647
651
648
652
LIGHT: PUSHJ P,MODULE
649
- JRST [MOVEI D,0 ? MOVEI F,DARK ? JRST RUN1]
653
+ JRST [ MOVEI D,0
654
+ MOVEI F,DARK
655
+ JRST RUN1 ]
650
656
AOJA D,RUN1
651
657
652
658
findish:popj p,
@@ -1269,7 +1275,8 @@ ETABQ: 0 ? 13. ? 22. ? 18. ? 26. ? 18. ? 24. ? 18. ? 22.
1269
1275
30. ? 30. ? 30. ? 30. ? 30. ? 30. ? 30. ? 30. ? 30.
1270
1276
30. ? 30. ? 30. ? 30. ? 30.
1271
1277
1272
- MESSAGE:BLOCK 1000
1278
+ MESSAGE:BLOCK 7100. ;Maximum amount of data.
1279
+ MAX=<.-MESSAGE>*7
1273
1280
PDL: BLOCK 100
1274
1281
1275
1282
IMAGE: BLOCK <177.*177.> ;One word per module.
0 commit comments