Just Another Armchair Programmer
(Red-Black) RB-Tree Implementation in x86_64 Assembly Language with C interface
by Jerry McIntosh
This is an Assembly Language implementation of a (Red-Black) RB-Tree. The (Red-Black) RB-Tree is implemented as a shared-library with a C interface. There is also a C demo program.
The (Red-Black) RB-Tree implementaton is based on the implementation found in:
Introduction to Algorithms, 3rd ed. by Cormen, Leiserson, Rivest, and Stein
- Linux OS
- Programming languages: C and Assembly
- Netwide Assembler (NASM), the GCC compiler, and the make utility
- your favorite text editor
- and working at the command line
Run the following command in the Red-Black-Tree-main
folder:
sh rbtree_make.sh
In folder rbtest
enter the following command:
./go_rbtest.sh
You can modify a couple defines in the C header file main.h
:
#define DATA_COUNT 128
#define DELETE_COUNT 0
Modifying these defines will change the behavior of the demo program.
There are calls to printf
in the rbtree.asm
file. They are for demo purposes only and can be removed or commented out. The printf
code sections are marked with comment lines: BEGIN PRINTF
; and END PRINTF
. The format and text strings passed to printf
are in the .data
section of the rbtree.asm
file.
Have Fun!