Skip to content

Commit ab4ad4c

Browse files
committed
tp
1 parent 093481e commit ab4ad4c

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

src/lars/qrcode.8

+22-15
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ GO: MOVE P,[-100,,PDL-1]
4646
PUSHJ P,FILL ;Fill the rest with alternating 236. and 17.
4747
PUSHJ P,REDSOL ;Compute Reed-Solomon error correcting codes.
4848
PUSHJ P,INTERL ;Interleave bytes from all blocks.
49-
PUSHJ P,FUNC ;Draw function patterns.
49+
PUSHJ P,FUNC ;Draw function patterns.
5050
PUSHJ P,ZIGZAG ;Draw output data.
5151
PUSHJ P,EVAL ;Evaluate penalty scores.
5252
PUSHJ P,APPLY ;Apply mask.
@@ -93,7 +93,7 @@ READ3: .CALL [ SETZ ;Open input file.
9393
MOVE FN1
9494
MOVE FN2
9595
SETZ SNAME ]
96-
.VALUE
96+
.LOSE %LSFIL
9797
MOVE A,[440700,,MESSAGE]
9898
MOVEM A,PTR
9999
SETZM LENGTH'
@@ -105,8 +105,10 @@ READ4: .IOT DSKIC,B ;Read data from input.
105105
IDPB B,PTR
106106
PUSHJ P,CHECK ;Check data mode.
107107
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,
110112

111113
DEV: SIXBIT /TTY/
112114
FN1: 0
@@ -126,9 +128,11 @@ INIT: MOVE A,[440100,,DATA]
126128

127129
SETZM VERSION
128130

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.
132136
ADDI A,17.
133137
MOVEM A,SIZE'
134138

@@ -579,20 +583,20 @@ EVAL3: SETZM PENALTY'
579583
EVAL4: MOVE B,(P)
580584
MOVEI D,0
581585
SETZM DOTS'
582-
PUSHJ P,BEGIN
586+
PUSHJ P,BEGIN ;Initialize run check.
583587
EVAL5: MOVEI C,1
584588
PUSHJ P,RUN ;Check for run of five or more.
585589
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.
587591
EXCH A,B
588-
exch d,dots
589-
exch f,state
592+
EXCH D,DOTS
593+
EXCH F,STATE
590594
MOVEI C,177. ;Now check in other direction.
591595
PUSHJ P,RUN
592596
PUSHJ P,FINDISH
593597
EXCH A,B
594-
exch d,dots
595-
exch f,state
598+
EXCH D,DOTS
599+
EXCH F,STATE
596600
AOBJN B,EVAL5
597601
AOBJN A,EVAL4
598602

@@ -646,7 +650,9 @@ DARK: PUSHJ P,MODULE
646650
JRST RUN1
647651

648652
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 ]
650656
AOJA D,RUN1
651657

652658
findish:popj p,
@@ -1269,7 +1275,8 @@ ETABQ: 0 ? 13. ? 22. ? 18. ? 26. ? 18. ? 24. ? 18. ? 22.
12691275
30. ? 30. ? 30. ? 30. ? 30. ? 30. ? 30. ? 30. ? 30.
12701276
30. ? 30. ? 30. ? 30. ? 30.
12711277

1272-
MESSAGE:BLOCK 1000
1278+
MESSAGE:BLOCK 7100. ;Maximum amount of data.
1279+
MAX=<.-MESSAGE>*7
12731280
PDL: BLOCK 100
12741281

12751282
IMAGE: BLOCK <177.*177.> ;One word per module.

0 commit comments

Comments
 (0)