Giter Club home page Giter Club logo

qr-asm's Introduction

qr-asm

Generate a QR code from scratch with only ARM assembly.


QR code to my GitHub profile.

A byte mode QR code of https://github.com/barrettotte using Q error correction level.
See qrcode.pbm for the raw image file.

Why?

At first, I learned how QR codes worked with an ugly python implementation; See docs/python. Midway through the python implementation, I started to learn ARM assembly. But, I had no idea what to build to practice my knowledge.

So, this project turned into a giant coding challenge just to see if I could do it. In a world where C exists, you should obviously never use assembly for this type of project/application.

Usage

Usage: qrcode msg err_lvl

valid error levels: L=1, M=0, Q=3, H=2

My primary test - ./bin/qrcode "https://github.com/barrettotte" 3

Quick build and test - make && make test

Limitations

I constrained the QR code generation a lot. I just wanted to encode a url, not build a whole library.

  • Byte mode encoding only
  • QR version 4 and below (up to 80 characters with v4-L)
  • Mask evaluation not implemented, hardcoded to mask 0 (I think masks only effect scan efficiency)
  • Instead of implementing an entire image file format, I used the PBM file format to create my QR code image.

Additionally, I'm still a novice with assembly so there is probably a ton of unoptimized code. I also didn't use all the features of the ARM assembler/architecture. I wanted to write this so a year from now a dummy like me could understand what I wrote.

Debugging with GDB

I'm still new to GDB, but this worked for me.

  • make && make qemu
  • make debug

For sanity checking this ugly thing, see my notes in docs/3Q-test.md

References

qr-asm's People

Contributors

barrettotte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.