How to save RAM0 area $A000 - $BFFF in assembler?

Started by MIRKOSOFT, July 10, 2010, 01:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MIRKOSOFT

Hi!

I tried to save RAM0 area $A000 - $BFFF, so I configured MMU to $0E, but always it saves only ROM... here's code:


lda #$0e
sta $ff00
lda #12
sta $ff68
lda #$00
ldx #$a0
sta $fb
stx $fc
lda #10
ldx #<name
ldy #>name
jsr $ffbd // setnam
lda #00
ldx #08
ldy #00
jsr $ffba // setlfs
lda #$fb
ldx #$00
ldy #$c0
jsr $ffd8 // save
lda #00
sta $ff00
rts


Yes, KERNAL routine SAVE needs also config BANK for I/O operation - and there can be problem. I used there:
lda #12
sta $ff68

and I'm not sure that's correctly.

Can anybody help me?

Many many thanks for every reply.

Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

BigDumbDinosaur

#1
What's with the following in your code?

     lda #12
   sta $ff68


You're doing it all wrong.  $FF68 is the kernel subroutine call for SETBNK, not someplace you'd write data.  You would call it thusly:

     lda #0        ;bank containing data to be saved
   ldx #0        ;bank containing the filename
   jsr setbnk    ;$ff68


Try reading Mapping the Commodore 128!!!  Everything you need to know is in there.  Nothing annoys me more than someone who is too lazy to take advantage of readily available documentation.  Geesh!!!
x86?  We ain't got no x86.  We don't need no stinking x86!

MIRKOSOFT

Hi!


I was following your instructions, but result is the same!


Don't know what I'm doing wrong... I was searching also in that book...
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

MIRKOSOFT

For better explain of problem are attached two source-code files.
SAVER - saves area $A000 - $AFFF
VDC Viewer - copies data from area $A000 - $AFFF to VDC
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

BigDumbDinosaur

    lda #$0e
    sta $ff00
    lda #$00
    ldx #$a0
    sta $fb
    stx $fc
    lda #10
    ldx #<name
    ldy #>name
    jsr $ffbd    // setnam
    lda #0
   ldx #0
   sta $ff68

    lda #00
    ldx #08
    ldy #00
    jsr $ffba    // setlfs
    lda #$fb
    ldx #$00
    ldy #$b0
    jsr $ffd8    // save
    lda #00
    sta $ff00
    rts


As I said a post or two ago, the highlighted code is wrong.
x86?  We ain't got no x86.  We don't need no stinking x86!