Below is the complete Gems list. The list are in several parts. First you have the Intel and Motorola Gems, below any hardware specific Gems (ie. graphic card, sound card, or computer specific like the Amiga).

Please read the history page for a complete new-gem/update table. (last updated 2004-05-05) - Please read.

All gems can now be downloaded in a single ZIP file:
They are called gem0000-gem00xx (and some other names too), not what they are called on the page (ie A BIOS Delay and similar). This means that it is not easy to find anything without open all files and check them. Next revision will use a script to automate this process and then all files will have correct names.

x86 gems
4x4 by 4x1 matrix multiply
63 bit CRC
Absoulte Value of
Add with 255 saturation
Aligned Fill
Bit Block Inversion
Bit Transposition algorithm
BSWAP with 16-bit registers
CodeAlign - Align your code
Convert hex to ASCII
Converting DX:AX into a base 10 string
Copy Zero Flag to Carry Flag
Copying data using the FPU
Disable the Cache(s)
Dividing 64-bit unsigned integers
Dividing signed integers by powers of 2
Doing a NOP
Exchange two values
Fast Float to Int
Fast Nibble swap
Fast strlen()
Filling a register with the Carry Flag
Find common divisor
Find minimum of two unsigned values
Get Parity of 32-bit word
Halt - the loop
Hadamard Transform in MMX
IF using AND
Inverse squareroot
LEA a power command
MOVS with SI=-X, DI=+X
Negate multiple-word numbers
Penalties on the 486
Performance monitoring
Population count of a 32-bit register
Pseudo Random number generator
Quad-precision shift
Quad Adders
Reversing bit order
Round signed integers
SALC - Set AL on Carry
Shifting + rounding upwards
Shifting bit arrays
Sinus Generator - 40 bytes
Small bubble sort
Smaller loops
Snippets from Ramblings in Realtime
Square root < 20 cycles
Testing for zero
The ADC-Gem

x86 Mnemonic Replacements
Emulate Bit scan instructions
Emulate BSF instruction
Fast BSF replacement
Remove shift by one latency
Replace Bit scan instructions

PC Platform Gems
A BIOS delay
Flat Real Mode
Flat Real Mode with EMM
Writing a string
Writing a two-digit number

DRAMs Speed Up/Booster
Drawing pixels
Palette Programming

PC Tiny Programs
15-byte Dump Meg to STDOUT
20-byte Starfield
56-byte Sierpinski's Triangle Generator
61-byte Mandelbrot generator
65-byte Life Simulator
78-byte Fade screen
79-byte Copper bar x 3
80-byte Pi calculator
84-byte Sample player
122-byte Quality fire

Motorola Gems
Absoulte Value of
Clear / Fill memory fast
Insert sort
Jump tables
Optimize for MC68k CPUs

John Eckerdal
last updated: 1999-09-02