Hey coders!
Since we've got this nice cypher-crypto-whatever thing going on the general forumites, how about a new challange for us, coders, sorta-like an oldskool thing ?
I got the idea during chat tonite: Once upon a long, LONG time ago (when i was still in school, back in 1992, my last year) our "digital technology" teacher asked us to write a assembler program that would multiply 2 8bit numbers, using the processor that had been used many years in small game-computers/home computers (like ZX spectrum and Apple): the Z80. If you're not familiar with this processor, the instruction set is quite simular to the 8080/8085 family. These are ALL 8-bit processors, which makes a WORD-sized multiplication more challanging.
So, the job is simply: write a program (in Z80 or 8085 asm) that would do an 8bit*8bit multiply: operands were to be supplied into specific memory locations. For this example we'll take hex addresses: 0100 and 0101 for the 2 factors, and the resulting product to be stored in 0102/0103 (a 16bit WORD)
AFTER execution of the multiplication code, the values inside memory addresses 0100 and 0101 should still be the same!Our instruction then was to create code as short and fast as possible. Needless to say: i beat my professor! My code was just a few bytes shorter, and on average, i'd say about 2048 times faster (give or take a few 1000)
So all you coders out there: let's see who can beat my teacher as well!
Links:
Z80 overview
Z80 instruction setPS: he didn't want to be embarressed too much, so he didn't ask us write a division program the week afterwards.. lol
[EDIT] Updated the instructions slightly. Every hour i remember more about this glorious day in my history
oh, and the actual school-coding was indeed in 8085 assembler, i now remember!