-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish program and write documentation
- Loading branch information
1 parent
1bf1329
commit f139483
Showing
9 changed files
with
563 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Barcode generator | ||
|
||
## About | ||
This program generates a [Code 39](https://en.wikipedia.org/wiki/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](https://en.wikipedia.org/wiki/Code_39#/media/File:Free_3_of_9_(Code_39_barcode).svg)) | ||
|
||
A barcode will be generated in the `output.bmp` file. | ||
|
||
## Sample run | ||
``` | ||
./program 2 CODE-X86 | ||
``` | ||
|
||
In `output.bmp` file: | ||
|
||
![example](documentation/example.bmp) | ||
|
||
The correctness of the barcode generated can be verified for example with an Android app: | ||
|
||
![example](documentation/screenshot-barcode-scanner.png) | ||
|
||
## 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](documentation/logic.drawio.svg) |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.