βββββββββββββββββββββββββββββββββββ
βββ βββ ββββββ βββββββ ββββββββββββ
βββ βββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββ βββ
βββββββββββββββββββββββββββ βββ
βββ ββββββ ββββββββββββββ βββ
βββ ββββββ ββββββββββ βββ βββ
ββββββ ββββββββββββ ββββ
βββββββββββββββββββββ βββββ
βββββββββββββββββββββββββββ
βββββββββββββββββββββββββββ
βββ ββββββββββββββ βββ βββ
βββ ββββββββββββββ βββ
βββββββββββββββββββββββββββββββββββ
A habit tracking program in 32-bit x86 assembly.
Habit ASM was submitted as a final project for Assembly Language, CSC 314, at Dakota State University during the Fall 2020 semester. The course instructor was Andrew Kramer.
This repository contains the following files:
| File | Description |
|---|---|
habit.asm |
This is the main program file. |
logo.txt |
This file contains the program logo. |
habit.txt |
This file stores the user's goal as goalDuration habitName (for example, 15 running). |
data.txt |
This file stores the user's daily habit entries. Empty values are represented by -1. |
README.md |
The program documentation. |
LICENSE |
The Habit ASM license. |
.editorconfig |
An EditorConfig file for habit.asm to have tabs display correctly on GitHub. |
Habit ASM utilizes assembly I/O routines developed by Paul Carter.
The following files are included for development on a Linux-based system:
asm_io.asmasm_io.inccdecl.hdriver.c
Habit ASM was developed using the Netwide Assembler (NASM) along with the GCC compiler on a Linux machine.
The following instructions describe dependency installation on Ubuntu 20.04.3 LTS.
- Update package lists with
sudo apt update. - Install NASM using
sudo apt install nasm. - Verify GCC installation with
gcc -v.- If GCC is not installed, you can install it as part of the
build-essentialpackagesudo apt install build-essential.
- If GCC is not installed, you can install it as part of the
- Install the
gcc-multilibpackage for 32-bit C compilationsudo apt install gcc-multilib.
- Begin by assembling the I/O routines file with
nasm -f elf -d ELF_TYPE asm_io.asm. This will create theasm_io.oobject file. - Assemble the
habit.asmfile withnasm -f elf habit.asm. This will create thehabit.ofile. - Finally, compile the C code in 32-bit mode and link the object and library files to create an executable with
gcc -m32 -o habit habit.o driver.c asm_io.o. - Launch Habit ASM with
./habit.
Please see the repository Wiki for detailed program documentation. π
Habit ASM > Main Menu
===================================
Enter 1 ... to set up a new habit
Enter 2 ... to record a daily entry
Enter 3 ... to print a report
Enter 0 ... to exit
===================================
Option:
Sample Report:1
Main Menu > Show Report
-----------------------------------
Goal: walking
Minutes: 30
+------+------+-------+
| Day: | Min: | Met: |
+------+------+-------+
| 1 | 30 | * |
+------+------+-------+
| 2 | 20 | |
+------+------+-------+
| 3 | 35 | * |
+------+------+-------+
| 4 | 10 | |
+------+------+-------+
| 5 | 30 | * |
+------+------+-------+
| 6 | 15 | |
+------+------+-------+
| 7 | 30 | * |
+------+------+-------+
-----------------------------------
Progress:
ββββββββββββββ
______________| 100%
-----------------------------------
Total days recorded: 7 / 7
Total goal met: 4 / 7
Total time: 2:50
The I/O routines for assembly were written by Paul Carter.
Program compilation instructions are adapted from Chapter 1, Section 4, "Creating a Program" of Carter's textbook, PC Assembly Language, available on the author's website.
Habit ASM's logo was generated with Patrick Gillespie's Text to ASCII Art Generator using the ANSI Regular font.
The author would like to thank Andrew Kramer, Instructor of Computer and Cyber Sciences at Dakota State University, for the guidance and support of this project.
This work, "Habit ASM", incorporates I/O routines for assembly, asm_io.asm, asm_io.inc, cdecl.h, and driver.c by Paul Carter, used under CC BY-NC-SA 4.0. "Habit ASM" is licensed under CC BY-NC-SA 4.0 by Elchanan Heller.
Footnotes
-
The progress bar does not line up correctly in the documentation examples due to formatting differences. β©