RE: [stella] 6502 tutorial

Subject: RE: [stella] 6502 tutorial
From: "Andrew Davie" <adavie@xxxxxxxxxxxxxxxxx>
Date: Wed, 23 Dec 1998 08:29:05 +1100
The sample code in that tutorial has a 16-bit count down loop, copied below.

            ;
            ; A 16-bit count down loop
            ;

            start LDY #$FF    ; load Y with $FF
            loop1 LDX #$FF    ; load X with $FF
            loop2 DEX         ; X = X - 1
                  BNE loop2   ; if X not zero goto loop2
                  DEY         ; Y = Y - 1
                  BNE loop1   ; if Y not zero goto loop1
                  RTS         ; return

            There are two loops here, X will be set to 255 and count to
            zero for each time Y is decremented.  The net result is to
            count the 16-bit number Y (high) and X (low) down from $FFFF
            = 65535 to zero.


In both cases, the #$FF should be changed to #0 to ACTUALLY achieve a 65535
loop count.
As it is, it will only iterate 255*255 = 65025 times.

Pedantically,
A

--???????? _????????????? Andrew Davie
??? _? *? (_|?? _???????? adavie@xxxxxxxxxxxxxxxxx
<mailto:adavie@xxxxxxxxxxxxxxxxx>
?? (/_??? _? , | )??????? ICQ 3297382 (boofly)??
?,???? ,~' L_|\??? _|
(?? ,-'??????? \? (_|???? http://www.comcen.com.au/~adavie? +
?? (???? GMT+10 \?? _????? /slide? = Slide Rule Trading Post
\/? \??? __??? @/? (?????? /weird? = Weird Computing Machines
? _? L,~'? "\__/? _??????? /slide/calculator/soviet.html =
?(_|????????? v? (/_???????? Museum of Soviet Calculators
????? _|?????????????????? /javaslide/javaslide.html =
???? (_| *? \/\/???????????? Interactive Java Slide Rule


> -----Original Message-----
> From: owner-stella@xxxxxxxxxxx [mailto:owner-stella@xxxxxxxxxxx]On
> Behalf Of John Saeger
> Sent: Wednesday, December 23, 1998 4:19 AM
> To: stella@xxxxxxxxxxx
> Subject: Re: [stella] 6502 tutorial
>
>
>
> -----Original Message-----
> From: Tennessee Carmel-Veilleux <veilleux@xxxxxxxxx>
>
>
> > I once downloaded a 6502 assembly tutorial that was located at the
> >'Incridible 6502 page'. It was an excellent tutroial called "Assembly
> >language in one step" if I remember. However, I know someone who
> would like
> >to learn 6502 assembly but the site where this tutorial was is down and I
> >lost the digital copy. All that remains is the hardcopy i made
> but I don't
> >want to xerox and send 55 pages halfway around the world :) Would anyone
> know
> >of a good 6502 assembly tutorial I could suggest to him, or even better,
> >would anyone still have that "Assembly in one step" tutorial ?
>
> I just happen to have a copy :-)
>
> John
>
>


--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread