To copy a 40-column text screen from $6000 without touching
the screen holes:
LDX #$F8
L1 LDA $6000-1,X
STA $0400-1,X
LDA $6100-1,X
STA $0500-1,X
LDA $6200-1,X
STA $0600-1,X
LDA $6300-1,X
STA $0700-1,X
DEX
BEQ L3
CPX #$80
BNE L2
LDX #$78
L2 CPX #$FF
BNE L1
L3 RTS
--
Paul
Monroe, Michigan USA
Hi, y'all!
"Paul R. Santa-Maria" wrote in message news:<3FF6E758.B94BA646@buckeye-express.com>...
> To copy a 40-column text screen from $6000 without touching
> the screen holes:
<--- snip --->
Here's another version that's one instruction shorter:
;
;
;
LDX #0
L1 LDA $6000,X
STA $0400,X
LDA $6100,X
STA $0500,X
LDA $6200,X
STA $0600,X
LDA $6300,X
STA $0700,X
INX
CPX #$78
BNE L2
LDX #$80
L2 CPX #$F8
BNE L1
RTS
Willi
Willi Kusche wrote:
> Here's another version that's one instruction shorter...
About a minute after I posted I realized I could trim it by
one instruction. My second version is the same size as yours.
LDX #$F8
L1 LDA $6000-1,X
STA $0400-1,X
LDA $6100-1,X
STA $0500-1,X
LDA $6200-1,X
STA $0600-1,X
LDA $6300-1,X
STA $0700-1,X
DEX
BEQ L2 ;=>DONE
CPX #$80
BNE L1 ;=>DO NOT SKIP
LDX #$78
BNE L1 ;=>ALWAYS
L2 RTS
But I think I like yours better.
--
Paul
Monroe, Michigan USA
"Paul R. Santa-Maria" writes:
>About a minute after I posted I realized I could trim it by
>one instruction. My second version is the same size as yours.
> LDX #$F8
>L1 LDA $6000-1,X
> STA $0400-1,X
> LDA $6100-1,X
> STA $0500-1,X
> LDA $6200-1,X
> STA $0600-1,X
> LDA $6300-1,X
> STA $0700-1,X
> DEX
> BEQ L2 ;=>DONE
> CPX #$80
> BNE L1 ;=>DO NOT SKIP
> LDX #$78
> BNE L1 ;=>ALWAYS
>L2 RTS
>But I think I like yours better.
As I posted earlier in the "Prodos woes" thread, you can make
it even shorter by moving the decrement to the end of the loop.
ldy #$f8
loop
lda $6000-1,y
sta $400-1,y
lda $6100-1,y
sta $500-1,y
lda $6200-1,y
sta $600-1,y
lda $6300-1,y
sta $700-1,y
cpy #$81
bne skip
ldy #$79
skip
dey
bne loop
rts
--
David Wilson School of IT & CS, Uni of Wollongong, Australia
"Bill Garber" wrote in message
news:7tSdnSbskKn81mWiRVn-jg@comcast.com...
:
: "Paul R. Santa-Maria" wrote in
: message news:3FF82867.1C8AF7AD@buckeye-express.com...
: : Bill Garber wrote:
: : > : > Wonderful, except there are 8 screen holes, AFAICT. ;-)
: : > Sorry, I viewed it as 8 x 8 byte holes,
: : > instead of 64 x 1 byte holes.
: :
: : I do not understand. Are you saying the code is wrong?
:
: I'm not sure, but it appears to only get half
: of them. Have another look at it and I'll do
: the same, but I'm sure you'll need 8 passes
: instead of 4. Again, I'm not really sure. ;-)
Yes, I'm right. According to the Apple //c
Reference Manual, there are 8 blocks that
run this way:
$400-$477 leaving $478-$47F
$480-$4F7 leaving $4F8-$4FF
$500-$577 leaving $578-$57F
$580-$5F7 leaving $5F8-$5FF
$600-$677 leaving $678-$67F
$680-$6F7 leaving $6F8-$6FF
$700-$777 leaving $778-$77F
$780-$7F7 leaving $7F8-$7FF
It's not much more to code it,
just a few modifications.
Bill @ GarberStreet Enterprizez };-)
Web Site - http://garberstreet.netfirms.com
Email - willy4SPAM6pa@comXcast.net
Remove - SPAM and X to contact me
---
This email ain't infected, dude!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.556 / Virus Database: 348 - Release Date: 12/26/03
"Bill Garber" wrote in message
news:vLmdnepNXOlhzWWiRVn-sQ@comcast.com...
:
: "Bill Garber" wrote in message
: news:7tSdnSbskKn81mWiRVn-jg@comcast.com...
: :
: : "Paul R. Santa-Maria" wrote in
: : message news:3FF82867.1C8AF7AD@buckeye-express.com...
: : : Bill Garber wrote:
: : : > : > Wonderful, except there are 8 screen holes, AFAICT.
;-)
: : : > Sorry, I viewed it as 8 x 8 byte holes,
: : : > instead of 64 x 1 byte holes.
: : :
: : : I do not understand. Are you saying the code is wrong?
: :
: : I'm not sure, but it appears to only get half
: : of them. Have another look at it and I'll do
: : the same, but I'm sure you'll need 8 passes
: : instead of 4. Again, I'm not really sure. ;-)
:
: Yes, I'm right. According to the Apple //c
: Reference Manual, there are 8 blocks that
: run this way:
:
: $400-$477 leaving $478-$47F
: $480-$4F7 leaving $4F8-$4FF
: $500-$577 leaving $578-$57F
: $580-$5F7 leaving $5F8-$5FF
: $600-$677 leaving $678-$67F
: $680-$6F7 leaving $6F8-$6FF
: $700-$777 leaving $778-$77F
: $780-$7F7 leaving $7F8-$7FF
:
: It's not much more to code it,
: just a few modifications.
Never mind, the code is there.
It does LDX #$78 and jump back
to do the other 4 passes. DUH!
Bill @ GarberStreet Enterprizez };-)
Web Site - http://garberstreet.netfirms.com
Email - willy4SPAM6pa@comXcast.net
Remove - SPAM and X to contact me
---
This email ain't infected, dude!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.556 / Virus Database: 348 - Release Date: 12/26/03