- MIPS Assembly
- x86 Assembly
- Program generating barcode in 32-bit x86 NASM
- Tutorial on how to configure an IDE for x86 NASM on Linux
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. Additionally, the barcode contains a checksum.
Details of the task can be found in task.pdf file.
Put all the files in one folder. Run Mars4_5.jar program. Given that you have Java installed on your computer, MARS should launch.
- Click
F3to assemble andF5to run the program. - In the
Run I/Owindow type the inputs requested. - A barcode will be generated in the
output.bmpfile.
Inputs:
width: 2px
text to encode: PINEAPPLE
In output.bmp file:
The correctness of the barcode generated can be verified for example with an Android app:
The checksum option must be enabled in a barcode scanner in order for the decoding to occur properly.
The source for the program is located in bmp.asm and macros.asm file. It is written in Mips assembly language. The simplified logic of the core functions in pseudocode is presented in form of diagrams below:

