> The start bit idea is clever! It allows a character to have > up to 7 dits or dahs. Heh. The motorola "Black Widow" design contest (for their 8pin cpus, essentially) has as one of the "steps" to finish a morse code program. The core that they supply stores the translation table as STRINGS: >>> char *convert(char c){ //Convert ASCII received switch(c){ >>> case 'a': >>> return ".-"; >>> case 'b': >>> return "-..."; >>> case 'c': >>> return "-.-."; >>> I guess that says something about changes in attention paid to code size by "youngins" these days. And C vs ASM, perhaps. Although since the high-end 8pin chip contains 8kbyte of flash (more than any other 8pin uC?) I guess it doesn't matter. > SendMorseCharA > RLF MorseChar,f ; shift msb into carry > movf MorseChar,f ; test to see if we're done > bz SendMorseCharZ ; We're done, get out > skpc ; skip if dit > call DoDah ; go send dah - PRESERVE CARRY! > skpnc > call DoDit ; go send dit > call InterCharDelay > goto SendMorseCharA ; go send next bit, if any > SendMorseCharZ > return ; we're outta here! Speaking of C compilers, this is a good example of the sort of code that I think it would be really difficult for a C compiler to generate; It's what I meant by "explicit use of carry." Does anybody want to take a shot at C code/compiler implementation that comes close to outputting this? (And on the third hand, it is perhaps also an example of optimization that doesn't need to be done.) BillW -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist