<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 24 Nov 2009 00:37:08 +0000
From   : rs423@... (Mick Champion)
Subject: Quine

Rick Murray wrote:
> Mick Champion wrote:
>
>   
>> CLC
>> LDA byte1
>> LDX #0
>> .loop
>> ADC byte1
>> STA byte1
>> BCC a
>> INC byte2
>> .a
>> INX
>> CPX#4
>> BNE loop
>>     
>
> Am I thick or do I not see what you are multiplying BY?
> Are you trying 'byte1' times four? (LDX #0 --> CPX #4)?
>   
Yes, using X as a counter. Looking at that now when fully awake, it 
wouldn't work anyway as I failed to save the original byte1 value, and 
instead left it to double itself each loop. Ah well.<sigh>



>
> I Googled this for you:
>    http://www.cyberroach.com/analog/an19/boot_camp.htm
>   
Thanks. Saved.





>
> There's another cheat you can use. Count DOWN in your loop, not up. When 
> you hit zero, the Z flag will be set so you can BNE loop (until zero...) 
> disposing of the need to CMP.
>   
True. Should have read this before posting previous message.



Mick
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>