GithubHelp home page GithubHelp logo

iljakalistratov / code39encoder Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 238 KB

Code39 Barcode Encoder written in RISC-V Asssembly language

License: MIT License

Assembly 100.00%
assembly assembler risc-v code39 encoder rars cesp barcode barcode-generator barcodes

code39encoder's Introduction

Code39 Encoder in RISC-V

The goal of this project is to code a Code39-Encoder in RISC-V.

Authors

Ilja Kalistratov

Code39 Encoder Video

IMAGE ALT TEXT

https://youtu.be/Lp5gN6S5I2U

Description

Code39 is a barcode format, in which each char of the alphabet has its own pattern, consisting out of five black lines and four white lines. Besides of that, there are two different widths of the lines, 3 fat lines & the rest are thin lines. Code39 has the "*" symbol as start, as well as, stop sign, to give a barcode scanner the opportunity to know, where the word starts and where it ends.

There isn't any algorithm behind Code39. Every char of the alphabet is assigned to a specific pattern:

Code39 Pattern

The program takes an input and reads the string out of it. Then the processing and conversion of the string will start.

The whole program is written in RISC-V assembly language. It does not contain any C-code or compiled C-code.

How to run

Open up the main.asm file in RARS.

Before you start the program, it is important to open the Bitmap Display and to configure it. The configuration should look like this:

Bitmap Display

If this is done, click on the "Connect to program" button. Now you can assemble and run the main.asm.

Now if you started the program you should see an input window, which looks like this:

Input Window

This is the place, where to enter the string you want to convert into Code39.

If you entered a string, you can click on "OK". The program should start to encode it and show the converted Code39 format on the Bitmap Display.

Restrictions

  • Due to lack of time, for now only strings, containing numbers from "0" to "9" are working. Other characters/symbols will be ignored
  • String vaildation is not implemented.

Files

src/main.asm # Main function of the programm.

src/cesplib_rars.asm # configurations for RARS and the Bitmap Display of RARS

src/draw_pixel.asm # draw_pixel function of our lecture in Rechnerarchitektur, which draws a pixel with an given color & position on the Bitmap Display.

src/draw_line.asm # function, which makes it possible to draw lines in different colors

src/draw_black_line.asm # draws a vertical black line

src/draw_white_line.asm # draws a vertical white line

src/draw_fat_black_line.asm # draws a fat (3px) vertical black line

src/draw_fat_white_line.asm # draws a fat (3px) vertical white line

src/read_input.asm # opens the input dialog

src/analyze_input.asm # function to process the input

src/encode.asm # function to convert every char of the string and draw it on the Bitmap Display

src/create_pattern.asm # the draw function of every char in the alphabet is handled in this file

src/print_input.asm # function that prints the size and the content of the input string in the console -> this function was only used for debugging

Test

Due to lack of time, there are no unit tests in this project.

code39encoder's People

Contributors

iljakalistratov avatar

Watchers

 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.