flat assembler
Message board for the users of flat assembler.

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

Author
Thread Post new topic Reply to topic
FlierMate



Joined: 21 Jan 2021
Posts: 129
FlierMate
I have written a 21x21 QR code generator console app in Pascal, with the Reed-Solomon error correction encoder ported from C by someone.

I tried to rewrite my QR code generator from Pascal to FASM, and it did not work. This was my first attempt. The ECC (error correction code) generated by the Assembly code was either in null or with invalid bytes.

Is there any Reed-Solomon simple encoder example in FASM? (FYI, I have deleted the erroneous Assembly program Crying or Very sad )

It was a mess trying to rewrite Pascal code in Assembly, especially I am not well versed in stack frame. Confused
Post 24 Oct 2021, 12:40
View user's profile Send private message Visit poster's website Reply with quote
Hrstka



Joined: 05 May 2008
Posts: 25
Location: Czech republic
Hrstka
Can you post a link to the Pascal source code?
Post 01 Nov 2021, 11:46
View user's profile Send private message Reply with quote
FlierMate



Joined: 21 Jan 2021
Posts: 129
FlierMate
Hrstka wrote:
Can you post a link to the Pascal source code?


Hi, I have attached the Pascal source file on here since the link contains additional binaries for Win32 and Linux.

The Reed-Solomon encoder functions are as below:
Code:
  rs_init_gf(285);
  rs_init_code(7,0);
  rs_encode(19,@data[0],@ecc[0]);
  rs_free;    


The 285 value is fixed. 19 means the total codewords in Version 1 (21x21) QR Code.


Description: Pascal source
Download
Filename: QRCLI.txt
Filesize: 13.46 KB
Downloaded: 28 Time(s)

Post 02 Nov 2021, 03:39
View user's profile Send private message Visit poster's website Reply with quote
Hrstka



Joined: 05 May 2008
Posts: 25
Location: Czech republic
Hrstka
Looks interesting. I would reserve a fixed amount of memory instead of calling GetMem and add some lookup tables in order to simplify the code. I may try to convert it to assembler if I have enough time. Are you using 32bit or 64bit instruction set?
Post 02 Nov 2021, 09:42
View user's profile Send private message Reply with quote
FlierMate



Joined: 21 Jan 2021
Posts: 129
FlierMate
Hrstka wrote:
Looks interesting. I would reserve a fixed amount of memory instead of calling GetMem and add some lookup tables in order to simplify the code. I may try to convert it to assembler if I have enough time. Are you using 32bit or 64bit instruction set?


That's very good of you, it will be pleasant if you able to rewrite the Pascal code in Assembly.
I am using 32-bit instruction for Win32, but prefer 64-bit instruction for Linux. I am using Linux x64 since last few months.
Post 02 Nov 2021, 11:15
View user's profile Send private message Visit poster's website Reply with quote
FlierMate



Joined: 21 Jan 2021
Posts: 129
FlierMate
Hi, the following are some additional info to help understand the program.

1. Please refer to attached image, as that is what my QRCLI program was referring to,
* Version 1 (21x21, 23x23 if includes quiet zone)
* Byte encoding
* 14-chars max (although 21x21 allows up to 17 chars for byte encoding)
* Low error correction level (7%, that is 7 bytes of ECC)

2. The last three characters (15th, 16th , 17th) were not encoded as the bit pattern is different from the previous 14 characters. You may want to improve it or leave it as is (14-chars max)

3. The QRCLI program encodes a fixed length of 14 (regardless of the length of actual string) by substituting the rest with null bytes.

Thank you!


Description: The QRCLI program follows this specific size of QR code specification
Filesize: 102.46 KB
Viewed: 394 Time(s)

qr.png


Post 02 Nov 2021, 11:23
View user's profile Send private message Visit poster's website Reply with quote
Hrstka



Joined: 05 May 2008
Posts: 25
Location: Czech republic
Hrstka
Here is my assembly version. The code is 32bit to make it more universal. Targeted for Windows, but should be easy to adapt it for Linux as well. Instead of drawing the QR code to the screen I decided to create a bmp file. You just have to magnify the image to see it. The string is hard-coded, if you want to pass arguments on command line, you have to implement it.


Description: QR code generator, version 1.0
Download
Filename: QRCLI.asm
Filesize: 11.59 KB
Downloaded: 30 Time(s)

Post 05 Nov 2021, 08:30
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.