Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
3valcomp.asm
Makefile
ReadMe.txt
absolute.asm
average.asm
irob.asm
krobstzco.asm
ktobsrzco.asm
nlz.asm
ntz.asm
parity.asm
pop.asm
sign.asm
signext.asm
snoob.asm
srsfu.asm
torcob.asm
torob.asm
torobsa.asm
torzb.asm
torzbca.asm
totob.asm
totobsa.asm
totzb.asm
totzbca.asm

ReadMe.txt

Hacker's Delight Linux assembly files.
Assemble with nasm, link with ld or use the Makefile.

Following functions are already available:

3valcomp	: three valued compare
absolute	: absolute value
average		: average of two integers
irob		: isolate rightmost one bit
krobstzco	: keep rightmost one bit, set trailing zero bits, clear all other bits
ktobsrzco	: keep trailing one bits, set rightmost zero bit, clear all other bits
nlz		: number of leading zeros
ntz		: number of trailing zeros
parity		: paritybit
pop		: number of one bits
sign		: sign bit
signext		: sign extension
snoob		: next higher number with same number of one bits
srsfu		: shift right signed from unsigned
torcob		: turn off the rightmost contigious string of one bits
torob		: turn off rightmost one bit
torobsa		: turn off rightmost one bit, set all other bits
torzb		: turn on rightmost zero bit
torzbca		: turn on rightmost zero bit, clear all other bits
totob		: turn off trailing one bits
totobsa		: turn off trailing one bits, set all other bits
totzb		: turn on trailing zero bits
totzbca		: turn on trailing zero bits, clear all other bits

2018-01-17 : This repository will be updated soon...
A better implementation is the use of macros because the programs are rather short.  Anyway here are the subroutines.
The Makefile does not generate a static or dynamic library (not yet)
nlz and ntz subroutines needs a remake and put it all in a loop.
You can’t perform that action at this time.