Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 1.86 KB

README.md

File metadata and controls

48 lines (31 loc) · 1.86 KB

Barcode generator

This project is the 3rd in a series on Assembly programming

  1. MIPS Assembly
  1. x86 Assembly

About

This program generates a Code 39 barcode for a given string. In other words, it draws the appropriate sequences of bars and spaces into a bmp file.

Details of the task can be found in task.pdf file.

How to run

This project is precompiled for Linux. Open terminal in the folder with files.

Type ./program width_of_narrow_bar text_to_be_encoded

Where:

width_of_narrow_bar - 1, 2 or 3

text_to_be_encoded - sequence of up to 9 characters (uppercase letters, numbers and more)

A barcode will be generated in the output.bmp file.

Sample run

./program 2 CODE-X86

In output.bmp file:

example

The correctness of the barcode generated can be verified for example with an Android app:

example

Implementation

The source for the program is located in main.c and functions.asm files. It is written in C and 32 bit x86 assembly language. The simplified logic of the core functions in pseudocode is presented in form of diagrams below. The diagrams were created with the MIPS implementation in mind, but are valid in the x86 case as well.

Logic chart