From cb5f9b8943bdc5860ceef63e63725f231293add2 Mon Sep 17 00:00:00 2001 From: Charles Mangin Date: Wed, 16 Jun 2021 00:14:21 -0400 Subject: [PATCH] added simple message validation --- QR.6502 | 26 +++++++++++++++++++++----- qrcode.bas | 4 ++-- qrcode.dsk | Bin 143360 -> 143360 bytes 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/QR.6502 b/QR.6502 index dd2b18b..d8c9aec 100644 --- a/QR.6502 +++ b/QR.6502 @@ -71,8 +71,10 @@ ROMSETVID EQU $FE93 ORG $2000 ; PROGRAM DATA STARTS AT $2000 + JMP CHECKMESSAGE ; CHECKS CONTENT OF ALPHANUMERIC MESSAGE + - JSR ROMINIT ; GR/HGR off, Text page 1 +SETUP JSR ROMINIT ; GR/HGR off, Text page 1 LDA #$00 STA LORES ; low res graphics mode STA MIXCLR @@ -604,7 +606,22 @@ NEXTMULT DEX BNE LOOP45 RTS *** MULT45 - + + +CHECKMESSAGE LDA MODE + CMP #$20 ; ALPHANUMERIC MODE, LIMITED CHARACTERS IN ALPHANUM + BEQ CHECKBYTES +CHECKDONE JMP SETUP ; BYTE MODE, SKIP TO THE SETUP + +CHECKBYTES LDY #$FF + +CHECKCHAR ; FOR EACH CHARACTER OF THE MESSAGE, CHECK FOR FF + INY + LDX MESSAGE,Y + BEQ CHECKDONE + LDA ALPHANUM,X + BPL CHECKCHAR + RTS ; OOPS. INVALID CHARACTER. DS \ @@ -635,11 +652,10 @@ GENERATOR HEX 00,11,3C,4F,32,3D,A3,1A,BB,CA,B4,DD,E1,53,EF,9C,A4,D4,D4,BC,BE * 0 17 60 79 50 61 163 26 187 202 180 221 225 83 239 156 164 212 212 188 190 DS \ -ALPHANUM DS 32 +ALPHANUM DS 32,$FF HEX 24,FF,FF,FF,25,26,FF,FF,FF,FF,27,28,FF,29,2A,2B,00,01,02,03,04,05,06,07,08,09,2C,FF,FF,FF,FF,FF,FF,0A,0B,0C,0D,0E,0F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,21,22,23 -* ASCII VAL + DS \,$FF - DS \ INTTOEXP HEX 00,00,01,19,02,32,1A,C6,03,DF,33,EE,1B,68,C7,4B,04,64,E0,0E,34,8D,EF,81,1C,C1,69,F8,C8,08,4C,71,05,8A,65,2F,E1,24,0F,21,35,93,8E,DA,F0,12,82,45,1D,B5,C2,7D,6A,27,F9,B9,C9,9A,09,78,4D,E4,72,A6,06,BF,8B,62,66,DD,30,FD,E2,98,25,B3,10,91,22,88,36,D0,94,CE,8F,96,DB,BD,F1,D2,13,5C,83,38,46,40,1E,42,B6,A3,C3,48,7E,6E,6B,3A,28,54,FA,85,BA,3D,CA,5E,9B,9F,0A,15,79,2B,4E,D4,E5,AC,73,F3,A7,57,07,70,C0,F7,8C,80,63,0D,67,4A,DE,ED,31,C5,FE,18,E3,A5,99,77,26,B8,B4,7C,11,44,92,D9,23,20,89,2E,37,3F,D1,5B,95,BC,CF,CD,90,87,97,B2,DC,FC,BE,61,F2,56,D3,AB,14,2A,5D,9E,84,3C,39,53,47,6D,41,A2,1F,2D,43,D8,B7,7B,A4,76,C4,17,49,EC,7F,0C,6F,F6,6C,A1,3B,52,29,9D,55,AA,FB,60,86,B1,BB,CC,3E,5A,CB,59,5F,B0,9C,A9,A0,51,0B,F5,16,EB,7A,75,2C,D7,4F,AE,D5,E9,E6,E7,AD,E8,74,D6,F4,EA,A8,50,58,AF EXPTOINT HEX 01,02,04,08,10,20,40,80,1D,3A,74,E8,CD,87,13,26,4C,98,2D,5A,B4,75,EA,C9,8F,03,06,0C,18,30,60,C0,9D,27,4E,9C,25,4A,94,35,6A,D4,B5,77,EE,C1,9F,23,46,8C,05,0A,14,28,50,A0,5D,BA,69,D2,B9,6F,DE,A1,5F,BE,61,C2,99,2F,5E,BC,65,CA,89,0F,1E,3C,78,F0,FD,E7,D3,BB,6B,D6,B1,7F,FE,E1,DF,A3,5B,B6,71,E2,D9,AF,43,86,11,22,44,88,0D,1A,34,68,D0,BD,67,CE,81,1F,3E,7C,F8,ED,C7,93,3B,76,EC,C5,97,33,66,CC,85,17,2E,5C,B8,6D,DA,A9,4F,9E,21,42,84,15,2A,54,A8,4D,9A,29,52,A4,55,AA,49,92,39,72,E4,D5,B7,73,E6,D1,BF,63,C6,91,3F,7E,FC,E5,D7,B3,7B,F6,F1,FF,E3,DB,AB,4B,96,31,62,C4,95,37,6E,DC,A5,57,AE,41,82,19,32,64,C8,8D,07,0E,1C,38,70,E0,DD,A7,53,A6,51,A2,59,B2,79,F2,F9,EF,C3,9B,2B,56,AC,45,8A,09,12,24,48,90,3D,7A,F4,F5,F7,F3,FB,EB,CB,8B,0B,16,2C,58,B0,7D,FA,E9,CF,83,1B,36,6C,D8,AD,47,8E,01 diff --git a/qrcode.bas b/qrcode.bas index 3e91db3..6eb8bc3 100644 --- a/qrcode.bas +++ b/qrcode.bas @@ -14,5 +14,5 @@ 820 VTAB 16: INVERSE: PRINT "Valid characters:" : PRINT "A-Z 0-9 $ % * + - . / : (space)": NORMAL 1000 VTAB 12: INPUT ">";S$ 1010 if ((M$ = "A" and len(S$)>114) or (M$ = "B" and len(S$)>78)) then ? "Message too long.": goto 1000 - -1020 CALL 8192 +1020 CALL 8192 : REM IF THIS FAILS, THE MESSAGE CONTAINS SOMETHING OUTSIDE THE ALLOWED RANGE +1030 HOME : VTAB 5: INVERSE : ? "INVALID CHARACTERS ENTERED. TRY AGAIN.": NORMAL :VTAB 8:GOTO 810 diff --git a/qrcode.dsk b/qrcode.dsk index b5781d58dac29f15e0ab27fca9eb893184de3597..385920a76ec90b5b6c00aaa2eae9a56774c92528 100644 GIT binary patch delta 1345 zcmcgsZ)h837=PaP?$Y$)Z1$&^g7)6tDkf#??qWM*CbOZvb}82+P2yDMvX-`Bzz?$Z zgI_fH&`2o@t_VBwp%MZYmzCB`WhI5o4kRS=-%at0_#vnp1qDx~Dy|yebfWvR?VArT z-0!*P_xyR^-+Py=Ta$FXkBWAjXuOB`AX-Cv(7|0;u&qe~G9E-%*HAB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