Whenever you're processing data to/from a device that uses BCD data. One example is the clock in the 6526. Another would be the RTC in CMD devices. In this case, you're correct that the use of 6502 Decimal mode is a 'trick'. It depends on the fact that the 6502 interprets nybbles greater than 9 as that many of that place value. In other words: SED CLC LDA #$0A ADC #$00 yeilds $10 in the Accumulator. It may be tricky, but it works. Thats always the MOST important factor when implementing an algorithm! Furthermore, as Spiro showed, the Decimal mode algorithm SAVES CYCLES when used in a larger subroutine. FAST CODE IS GOOD CODE! --- Ruud Baltissen <Ruud.Baltissen@abp.nl> wrote: > > Perhaps because the compare-branch algorithm uses > > fewer cycles ;-) > > IMHO a better reason is that the first approach is a > pure trick without > logical background and therefor hard to understand. > Anyway it is the first > that I saw a program using the decimal mode. > Question out of curiousity: > does anybody know circumstances where it is better > to use the decimal mode > above the binary? > > Groetjes, Ruud > > http://Ruud.C64.org > > > > - > This message was sent through the cbm-hackers > mailing list. > To unsubscribe: echo unsubscribe | mail cbm-hackers-request@dot.tml.hut.fi. ===== Get a FREE 6Mb webmail box from go6502! - http://www.geocities.com/profdredd As low as 2.99% Intro APR from NextCard! - http://www.nextcard.com/index6.html?ref=aff0074521 PayPal is the FAST FREE and SECURE way to send money! - https://secure.paypal.x.com/refer/pal=profdredd%40yahoo.com __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ - This message was sent through the cbm-hackers mailing list. To unsubscribe: echo unsubscribe | mail cbm-hackers-request@dot.tml.hut.fi.
Archive generated by hypermail 2.1.1.