{"id":22624638,"url":"https://github.com/barrettotte/qr-asm","last_synced_at":"2025-04-11T17:53:06.117Z","repository":{"id":114091062,"uuid":"372848399","full_name":"barrettotte/qr-asm","owner":"barrettotte","description":"Generate a QR code from scratch with only ARM assembly.","archived":false,"fork":false,"pushed_at":"2021-09-06T21:17:34.000Z","size":492,"stargazers_count":107,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T13:51:10.574Z","etag":null,"topics":["arm","arm-assembly","arm-assembly-language","assembly","pbm-image","qrcode","qrcode-generator","reed-solomon"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barrettotte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-01T13:55:08.000Z","updated_at":"2024-12-30T10:07:26.000Z","dependencies_parsed_at":"2023-06-12T14:00:33.282Z","dependency_job_id":null,"html_url":"https://github.com/barrettotte/qr-asm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barrettotte%2Fqr-asm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barrettotte%2Fqr-asm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barrettotte%2Fqr-asm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barrettotte%2Fqr-asm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barrettotte","download_url":"https://codeload.github.com/barrettotte/qr-asm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456291,"owners_count":21106601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","arm-assembly","arm-assembly-language","assembly","pbm-image","qrcode","qrcode-generator","reed-solomon"],"created_at":"2024-12-09T00:17:08.530Z","updated_at":"2025-04-11T17:53:06.109Z","avatar_url":"https://github.com/barrettotte.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qr-asm\n\nGenerate a QR code from scratch with only ARM assembly.\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./docs/asm_qrcode.png\" alt=\"QR code to my GitHub profile.\"/\u003e\n  \u003cp\u003eA byte mode QR code of \u003ca href=\"https://github.com/barrettotte\"\u003ehttps://github.com/barrettotte\u003c/a\u003e using Q error correction level.\n  \u003cbr\u003eSee \u003ca href=\"qrcode.pbm\"\u003eqrcode.pbm\u003c/a\u003e for the raw image file.\u003c/p\u003e\n\u003c/div\u003e\n\n## Why?\n\nAt first, I learned how QR codes worked with an ugly python implementation; See [docs/python](docs/python).\nMidway through the python implementation, I started to learn ARM assembly. But, I had no idea what to build\nto practice my knowledge.\n\nSo, this project turned into a giant coding challenge just to see if I could do it.\nIn a world where C exists, you should obviously never use assembly for this type of project/application.\n\n## Usage\n\n`Usage: qrcode msg err_lvl`\n\nvalid error levels: `L=1, M=0, Q=3, H=2`\n\nMy primary test - `./bin/qrcode \"https://github.com/barrettotte\" 3`\n\nQuick build and test - `make \u0026\u0026 make test`\n\n## Limitations\n\nI constrained the QR code generation a lot. I just wanted to encode a url, not build a whole library.\n\n- Byte mode encoding only\n- QR version 4 and below (up to 80 characters with v4-L)\n- Mask evaluation not implemented, hardcoded to mask 0 (I think masks only effect scan efficiency)\n- Instead of implementing an entire image file format, I used the [PBM](https://en.wikipedia.org/wiki/Netpbm) file format to create my QR code image.\n\nAdditionally, I'm still a novice with assembly so there is probably a ton of unoptimized code.\nI also didn't use all the features of the ARM assembler/architecture. \nI wanted to write this so a year from now a dummy like me could understand what I wrote.\n\n### Debugging with GDB\n\nI'm still new to GDB, but this worked for me.\n\n- `make \u0026\u0026 make qemu`\n- `make debug`\n\nFor sanity checking this ugly thing, see my notes in [docs/3Q-test.md](docs/3Q-test.md)\n\n## References\n\n- [ARM A32 Calling Convention](https://en.wikipedia.org/wiki/Calling_convention#ARM_(A32))\n- [ARM 32-bit EABI Syscall Reference](https://chromium.googlesource.com/chromiumos/docs/+/master/constants/syscalls.md#arm-32_bit_EABI)\n- [GNU ARM Assembler Quick Reference](https://www.ic.unicamp.br/~celio/mc404-2014/docs/gnu-arm-directives.pdf)\n- [QR Code Design Wiki](https://en.wikipedia.org/wiki/QR_code#Design)\n- [QR Code Tutorial](https://www.thonky.com/qr-code-tutorial/)\n- [Reed Solomon Codes for Coders](https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders)\n- [GDB Command Reference](https://visualgdb.com/gdbreference/commands/x)\n- [PBM File Description](https://oceancolor.gsfc.nasa.gov/staff/norman/seawifs_image_cookbook/faux_shuttle/pbm.html)\n- [Netpbm Wiki](https://en.wikipedia.org/wiki/Netpbm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarrettotte%2Fqr-asm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarrettotte%2Fqr-asm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarrettotte%2Fqr-asm/lists"}