flat assembler
Message board for the users of flat assembler.

Index > Main > Reed-Solomon simple encoder in Assembly language?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
FlierMate



Joined: 21 Jan 2021
Posts: 219
FlierMate 04 Feb 2022, 15:39
al_Fazline wrote:
DataMatrix is indeed kinda easier to understand, then QR, I think.

The only problem is that I don't quite understand how to generate the error correction codes myself. It has some hardcore math in it. I'm wondering if it's using same constants as QR or not (as far as I understand particular Reed-Solomon implementation depends on several constants. I didn't find which constants DM is supposed to use however.


Thanks for giving hope that it is easier to understand than QR.

In QR, according to specification, the
Code:
 rs_init_gf(&rs, 0x11d);    


In data matrix, however,
Code:
rs_init_gf(&rs, 0x12d);    


where rs_init_gf is:
Quote:
rs_init_gf(&rs, prime_poly) initialises the parameters for the Galois Field.


Reference to Zint API:
- https://github.com/woo-j/zint/blob/master/backend/qr.c (QR)
- https://github.com/woo-j/zint/blob/master/backend/dmatrix.c (Data matrix)

So perhaps you can make use of the simple Reed-Solomon encoder in this thread (converted by Hrstka) for use in Data matrix encoding as well, just change the prime_poly (gf) from 285 (0x11d) to 301 (ox12d). I don't understand the math, don't ask me why. Razz

Please share your work with us once you have implemented it in FASM. All the best!
Post 04 Feb 2022, 15:39
View user's profile Send private message Reply with quote
FIierMate



Joined: 02 Oct 2024
Posts: 4
FIierMate 02 Oct 2024, 18:08
FlierMate wrote:
Good day everyone!

I have modified the qrcli for Linux 32-bit to display the 21x21 QR code directly in terminal window (instead of saving it as tiny BMP file).

It makes use of ANSI escape code for coloring.


Today I revisited this source code and test run under WSL2, I found that little modification needs to be done to ANSI escape code in order to work under WSL2.

Just replace separator, colon, with semicolon.

Change from...
Code:
colorblack   db   27,'[48:5:0m'   ; ANSI escape code
lenblack = $ - colorblack
colorwhite   db   27,'[48:5:15m'    


...to...
Code:
colorblack   db   27,'[48;5;0m'   ; ANSI escape code
lenblack = $ - colorblack
colorwhite   db   27,'[48;5;15m'    


But if you run it in Linux VM, these changes are not needed.
Post 02 Oct 2024, 18:08
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.