So, to get us started on messing with efficient machine code fragments, I give you this arbitrary length integer addition routine written in MIPS III (R4000):
nadd: lw $6, 0($3)
lw $7, 0($4)
sw $5, 0($4)
addiu $3,$3, 4
addiu $4,$4, 4
bne $0,$2, nadd
Arbitrary length numbers are represented as vectors segmented into thirty two bit sections, ascending, the number of which is the length; one number is passed in register three and the destination and second summand is in register four; the length of the shorter number is in register two and must not be zero; registers six and seven are clobbered; register five is clobbered and holds a single bit if overflow occured; register thirty one holds the destination once the routine is finished. All but register thirty one can easily be changed.
I read in a thirty two bit word from each number, add it using bit thirty three as a carry flag, store this result in the destination location, then shift the carry flag into bit 1 and repeat until the addition is done.
I have actual MIPS hardware that I could test this with, but testing machine code routines is so frustrating on UNIX that I've merely given this a few glances over. I don't think there are any flaws, but I could be wrong.
Regardless, feel free to improve on this and point out any mistakes I may have made.