Yeah maybe breaking the law, but as i said, i didn't test it...it just looks good in my mind... 8 deep level stack, 8 leds... mmm![]()
Yeah maybe breaking the law, but as i said, i didn't test it...it just looks good in my mind... 8 deep level stack, 8 leds... mmm![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Ladies and Gentlemen!
Please direct your attention to the Center Ring ....
12 WORDsBwwaaa Haaa Haaa!Code:list p=16F628A #include "P16F628A.inc" errorlevel -302 ; suppress message 302 from list file __CONFIG _CP_OFF & _BODEN_ON & _MCLRE_ON & _WDT_ON & _PWRTE_ON & _LVP_OFF & _INTOSC_OSC_NOCLKOUT Init clrf PORTB ; PORTB all 0's rlf STATUS, F ; sets Bank1 and clears carry bcf OPTION_REG, 2 ; 1:8 prescaler to WDT comf SPBRG,F ; Make SPBRG all 1's Loop btfsc STATUS,C ; no sleep if rotated into carry sleep rlf SPBRG,F ; rotate SPBRG left msb to carry rrf PR2, F ; rotate carry into PR2, lsb to carry movf SPBRG, W ; put SPBRG into W reg andwf PR2, W ; and it with PR2 movwf TRISB ; result goes to TRISB goto Loop ; Repeat
Added:
<script language="javascript" src="http://www.pbpgroup.com/files/CylonRotate.js"></script><br>
DT
Woohoo, now if we see this code example somewhere, we will know where it come from
PR2, SPBRG... euh in a light 'chaser' ,deuh, doh... hein???
Nice one.... smell of the burned brain-cells, but nice ;o}
Last edited by mister_e; - 22nd December 2007 at 13:20.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well, that's going to be tough to beat. Nice work Darrel.
Interesting side note: Using your rlf STATUS,F approach reduced my 13 word version to
only 12 words..;o}
Code:list p=16F628A #include <P16F628A.inc> errorlevel -302 ; suppress message 302 from list file __CONFIG _CP_OFF & _BODEN_ON & _MCLRE_OFF & _WDT_ON & _PWRTE_ON & _LVP_OFF & _INTOSC_OSC_NOCLKOUT clrf PORTB ; clear port rlf STATUS,F ; Bank1, clear carry for 1st rotate bcf OPTION_REG,2 ; 1:8 prescaler to WDT Left sleep ; go to sleep for ~1 second rlf TRISB,F ; rotate 0 from carry into lsb, then left across trisb btfsc TRISB,7 ; jump to Right once trisb,7 = 0 goto Left Right sleep ; go to sleep for ~1 second rrf TRISB,F ; rotate bit right across trisb btfsc TRISB,0 ; jump to left once trisb,0 = 0 goto Right ; loop until trisb,0 = 0 goto Left ; now rotate back to the left end
OMG! How HORRIBLE!
That means yours doesn't pause at each end like mine.
Which makes your 12, better than my 12.
Actually, it's awesome,
I'm crying because now I have to spend the next week trying to beat it.
<br>
DT
Oh I wouldn't call it better since your version is WAY more creative, and your nifty rotate STATUS thing was the only reason mine was reduced.
Man that was some clever & creative problem solving, and that's really what it's all about...;o}
Bookmarks