Skyhigh 13 ch24 Ram Expansion Unit

From C64 Diskmag Wiki
Jump to: navigation, search
           ram expansion unit




howdy folx... here's devil on the keys
writing sum text. the reason is that i
promised BIZ KID sum time ago to write
an little article about the REU to the
c64 (ram expansion unit (xmem)).
it's sad that these reu might be a bit
hard to get nowadays, but if any of you
gets the chance of buing one, don't
hesitate. the most common reu is the
1764 with 256k memory as standard, but
you can increase it to 512k. ok, these
reu was originaly built for the c128,
so there's no problems to use with one.

as a coder it's just great to have a reu
but these doesn't work like the xmemorys
on the amiga or pc. since the c64 only
have an 16 bits adressbus, it can't use
adresses higher than $ffff (65535) and
this is why the reus' uses banks. one
bank is ofcoz 64 kb, and wich means that
a 256 kb reu have 4 banks (0-3). to use
the reu while coding, it's easiest to
get the turboass kit for reu (contains
t.ass, monitor) wich was fixed for reu
by tron/fairligt.(monitor coded by tron)
but if you wanna use it in your own
utilitys and stuff, there are sum addys
that you have to control, and that's the
main reason of why i wrote this text.

here's a complete list of the register
available for the reu. and afterwards
i'll introduce 'em to you.

status   = $df00
command  = $df01
c64lob   = $df02
c64hib   = $df03
reulob   = $df04
reuhib   = $df05
reubank  = $df06
lgtlob   = $df07
lgthib   = $df08
irqmask  = $df09
bnklock  = $df0a


status  ($df00) (read only!)

this is a bit controled register.
this register can't be written to, and
bit 5-7 will be empty after reading.

bit 7: irq request, will be set when an
       irq is running.

bit 6: set if copy finnished.

bit 5: if set, an error has occured
       during transfer.

bit 4: size of reu (0=512 kb, 1=256 kb)

bits 0-3: reu version number.


command ($df01)

this is a bit-controled register the
bits used are:

bit 7: when this bit is set, the reu
       starts the transfer. (that's why
       you have to store $df01 last!)

bit 6: reserved

bit 5: autoload (don't ask me!!!)

bit 4: write at $fff0 enable.

bit 3: reserved

bit 2: reserved

bits 0-1:

       wich transfer mode.

       00 c64 --> reu
       01 reu --> c64
       10 c64 <-> reu (switch)
       11 verify


c64lob  ($df02)

sets the lowbyte of the c64 start


c64hib  ($df03)

sets the highbyte of the c64 start


reulob  ($df04)

sets the lowbyte of the reu start


reuhib  ($df05)

sets the highbyte of the reu start

reubank ($df06)

decides wich bank u will use in the reu
when transfering.


lgtlob  ($df07)

lowbyte of the transfer lenght


lgthib  ($df08)

highbyte of the transfer lenght

irqmask ($df09)

another bit controled register.

bit 7: enables irq while transfering.

bit 6: holds irq to after transfering.

bit 5: error in verify


bnklock ($df0a)

this register allowes you to lock the
memory counters  (f.ex transfer $1000 in
c64 to $1000-$2000 in reu(fill reu area
with the byte in $1000))
this could be usefull for FAST filling
an area with a certain byte (check out
the fill rout in tronmon 2.0).
this adress is also bit-controled.
the bits are:

bit 7: lock c64 (if set)

bit 6: lock reu (if set)


allright, to make things a little more
clear, i'll write a little program
with comments.


reumove
        lda #$00      ;set the c64 start
        sta c64lob    ;addy to $2000
        lda #$20      ;
        sta c64hib    ;

        lda #$00      ;set the reu start
        sta reulob    ;addy to $4000
        lda #$40      ;
        sta reuhib    ;

        lda #$01      ;use bank 1 in reu
        sta reubank   ;

        lda #$ff      ;set lenght of
        sta lgtlob    ;transfer
        lda #$1f      ;
        sta lgthib    ;

        lda #%00000000;unlock both c64
        sta bnklock   ;and reu

        lda #%10010000;write to $fff0
        sta command   ;set c64 as src
                      ;and reu as dest.
                      ;and start
                      ;transfering.

        rts

/devil of noice 1994-09-16
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox