Simple bitcoin mining algorithm
The simplest miner would work like this:


Request a new Getwork from a given pool/bitcoind with specified credentials
For nonce=0;nonce&lt;0xFFFFFFFF;nonce++

Set Getwork Data nonce
SHA-256 hash the Getwork Data (block header)
Check if hash result is smaller than Getwork Target, if so, submit a share
If more than 1 second passed since you received Getwork, stop the loop

GOTO: 1


Now, if you want something that could rise up to par with currently used miners, you need to consider:


OpenCL calculations, without this you will never get the high hashrates of graphic cards.
Midstate, or in other words hashing optimization. First half of Getwork Data doesn't change, so no point in calculating midstate for each hash.
Longpolling, makes you calculate less stale blocks.
Rollntime, minimizes communication with the pool.