Author Topic: QR-Code  (Read 1668 times)

jj2007

  • Member
  • *****
  • Posts: 13657
  • Assembly is fun ;-)
    • MasmBasic
Re: QR-Code
« Reply #45 on: November 26, 2022, 08:59:54 AM »
Actually dlls was just for examples, so everyone can try them.
Static libraries are usually difficult cases for too many programmers, as they often have linking time problems.

Real static libraries are ok. What makes trouble are import libraries. They are fake. Most of the Masm32 SDK "static" libraries link to C:\Windows\System32\ DLLs - no problem, as these DLLs are always present on a Windows machine. But as soon as you import functions from a DLL that happens to sit only in your QR code folder, the exe doesn't work any more if you move it to a different folder.

jj2007

  • Member
  • *****
  • Posts: 13657
  • Assembly is fun ;-)
    • MasmBasic
Re: QR-Code
« Reply #46 on: November 26, 2022, 09:43:32 AM »
I've run some tests comparing:

a) Jack's version: libqrencode32Jack.dll, 62974 bytes of 22.11.22, 03:15:50
b) Timo's version: qrcodegen_na_msvcrt.lib, 4648 bytes of 25.11.22, 00:48:34

Both support strings up to 2933 bytes, Timo's version up to 2940 or so. However, the codes generated by Jack's dll are slightly more easy to recognise by my smartphone reader.

Sources & executables here

Biterider

  • Member
  • *****
  • Posts: 1076
  • ObjAsm Developer
    • ObjAsm
Re: QR-Code
« Reply #47 on: November 26, 2022, 05:35:26 PM »
Hi Jack
I wonder if QR could be used to backup small programs on paper and then restored?
This reminds me of an old project that works perfectly https://ollydbg.de/Paperbak/.
I found this when I was looking for the "PaperBack" https://github.com/cyphar/paperback  :tongue:

Biterider

TimoVJL

  • Member
  • *****
  • Posts: 1258
Re: QR-Code
« Reply #48 on: November 26, 2022, 08:08:16 PM »
a static library made with msvc 2022
i haven't tested it.

Original code:
Code: [Select]
* Copyright (c) Project Nayuki. (MIT License)
 * https://www.nayuki.io/page/qr-code-generator-library
EDIT
static library test, asm code borrowed from jj2007
Code: [Select]
model flat, c
.486
includelib qrcodegen_na
qrcodegen_Mask_AUTO = -1
qrcodegen_encodeText PROTO C :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD
qrcodegen_Ecc_HIGH=3
qrcodegen_VERSION_MIN=1 ; The minimum version number supported in the QR Code Model 2 standard
qrcodegen_VERSION_MAX=40 ; The maximum version number supported in the QR Code Model 2 standard
qrcodegen_BUFFER_LEN_MAX=3917
;...
.DATA
stext db "https://www.nayuki.io/",0
.DATA?
qrcode db qrcodegen_BUFFER_LEN_MAX dup(?)
tempBuffer db qrcodegen_BUFFER_LEN_MAX dup(?)
.CODE
mainCRTStartup:
LoadQR:
  ;mov pData, offset qrcode
  invoke qrcodegen_encodeText, addr stext, addr tempBuffer, addr qrcode,
     qrcodegen_Ecc_HIGH, qrcodegen_VERSION_MIN, qrcodegen_VERSION_MAX, qrcodegen_Mask_AUTO, 1
  ret
END LoadQR
« Last Edit: November 27, 2022, 03:50:12 AM by TimoVJL »
May the source be with you

daydreamer

  • Member
  • *****
  • Posts: 2305
  • my kind of REAL10 Blonde
Re: QR-Code
« Reply #49 on: November 26, 2022, 10:42:27 PM »
I wonder if QR could be used to backup small programs on paper and then restored?
say that you split an exe for example into chunks and then create the QR's and print them on paper for backup, how many bytes per page could be saved ?
see https://stackoverflow.com/questions/11065415/how-much-data-information-can-we-save-store-in-a-qr-code
That reminds me of spy novels, sending info by microscopic size secret documents
But uncompressed source it's limited to contain lot of repeated strings triple or more space
Especially asm snippet Unrolled many times for speed

my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

HSE

  • Member
  • *****
  • Posts: 2362
  • AMD 7-32 / i3 10-64
Re: QR-Code
« Reply #50 on: November 27, 2022, 01:14:21 AM »
Hi JJ!

Demo14 assembles fine but I have no idea what the 2560 byte exe is supposed to do.

Some little demos show things in DebugCenter. If DebugCenter fail to open You will see nothing.

LATER: but apparently Demo14 fail  :thumbsup:

MORE LATER: what fail is my memory  :biggrin: :biggrin: I don't used make.bat with ObjAsm32!

To see something, program must be assembled in debug mode (like RadAsm Project state). To use make.bat, must be replaced OA32_ASM_RLS with OA32_ASM_DBG inside it.
             


With CrtDLL.inc, Demo07:

Demo08: ...

I found a more pristine ObjAsm32 installation, and I obtain exactly your same errors  :biggrin:

You have ObjAsm32 running. Congratulations!!

Regards, HSE
« Last Edit: November 28, 2022, 12:53:51 PM by HSE »
Equations in Assembly: SmplMath

HSE

  • Member
  • *****
  • Posts: 2362
  • AMD 7-32 / i3 10-64
Re: QR-Code
« Reply #51 on: November 28, 2022, 12:55:24 PM »
Just in case, Demo14 work perfectly (see above)

And Demo8 work with TBBUTTONINFOW and HtmlHelpA (perhaps it's not original Masm32SDK's htmlhelp.lib)

In Graph2D.inc just replaced function CRTDLL_snprintf. That was an old discussion I don't remember  :biggrin: :biggrin:
« Last Edit: November 28, 2022, 11:33:49 PM by HSE »
Equations in Assembly: SmplMath