[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating a new Apple IIgs ROM 03 checksum



barrym95838 <barrym95838@yahoo.com> wrote:
>> 
>> Couldn't this magic word be subtracted after all the other summing was
>> 
>> complete?  SEC, SBC abs-long, and you're done?
>> 
> 
> Hi, Jerry
> 
> I strongly agree that adding it with everything else in the inner loop
> and subtracting it when done is the more desirable choice, since that
> strategy is just as compact, and much faster than 32768 php/cpy/bne/plp
> combos!  I know, we're only talking about a few hundred milliseconds in
> this particular case, but the benefit of being aware of this is that it
> can help in other projects, ones that may have much longer loops and/or
> tight performance constraints.
> 
> Of course, if we were coding for a "more modern" processor, some of us
> might just let it go as is, and let brute power take over.  I don't
> usually include myself in that group, since I will likely have an 8-bit
> mentality for life! ;-)
> 
> Mike

It also acknowledges that the "twiddle" value can be anywhere, not just
where it happens to be located currently. 

In fact, a program seeking to identify an unmatched ROM might not only
require the checksum to be as expected, but might also require the original
twiddle value to be unchanged.  In this case, one would have to leave the
original twiddle value and add another elsewhere to correct the checksum. 

The main point is that it is completely unnecessary to know where the
"original" twiddle value is, or even if there is one. Just add a word that
causes the checksum to be unchanged. 

-michael - NadaNet 3.1 and AppleCrate II: http://home.comcast.net/~mjmahon