[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Assembler code
You're right. You can remove le line MYMOVE and replace the JMP MYMOVE with
JMP LOOP1
I do this program automaticly and I always keep the way to init registers
but here, in a small routine, it's not realy useful of course
"John B. Matthews" <nospam@nospam.com> wrote in message
nospam-288DDD.23112310012005@news-server.woh.rr.com">news:nospam-288DDD.23112310012005@news-server.woh.rr.com...
> In article <41e30966$0$25811$8fcfb975@news.wanadoo.fr>,
> "Jplcsch" <jplcsch@wanadoo.fr> wrote:
>
> > Remove the TYA, not useful .
> >
> > "Jplcsch" <jplcsch@wanadoo.fr> wrote in message
> > news:41e3078d$0$8055$8fcfb975@news.wanadoo.fr...
> > > in assembler the routine could be
> > >
> > > LDX #$00
> > > LDY #DA ; init source address it's enough here
> > > MYMOVE LDA #00
> > > LOOP1 LDA $DA00,X :
> > > STA $8000,X
> > > DEX
> > > BNE LOOP1
> > > INY
> > > CPY #DC
> > > BEQ EXIT
> > > TYA
> > > INC LOOP1+3 ; modify memory source high adress
> > > INC LOOP1+6 ; modify memory dest high address
> > > JMP MYMOVE
> > > EXIT RTS
> > >
> > > "sanjaya" <pererasanjaya@hotmail.com> wrote in message
> > > 5e56673f.0501100007.40cb668f@posting.google.com">news:5e56673f.0501100007.40cb668f@posting.google.com...
> > > > can someone help me with the assembler code to move memory contents
> > > > from $DA00-$DBFF (Bank 1 main memory) to $8000-$81ff (main memory).
> > > >
> > > > thanks,
> > > > sanjaya
>
> Very economical! If you change "JMP MYMOVE" to "JMP LOOP1" or "BNE
> LOOP1", can't "MYMOVE LDA #00" be elided also?
>
> --
> John
> jmatthews at wright dot edu
> www dot wright dot edu/~john.matthews/