Saveprog.prg

Aus CBMPET.DE

Wechseln zu: Navigation, Suche

CBM_8296_RAMDrive

;---------------------------------------------------------

; save two files in (empty !) expansion

;

; [/] 28. oct. 2009
;  M.Sachse
;
;  http://www.cbmhardware.de
;
; this source is only for evolution purposes !
; the bin-files and entries may be changed.
; 
;
;      -----------------------------------------------------
;     |  File-Entry  : Directory                            |
;      -----------------------------------------------------
;     |  Byte   |   Description                             |
;      -----------------------------------------------------
;     |   0-1   |   ID l/h                                  |
;     |   2     |   Filetyp ($00:DEL, $01:PRG)              |
;     |   3-4   |   Sector l/h (File)                       |
;     |   5-20  |   Filename  ($20: filled up)              |
;     |   21    |   DIR-Byte ($00:Root)                     |
;     |   22-23 |   Load-Address                            |
;     |   24    |   Blocks                                  |
;     |   25-26 |   Bytes l/h  (may be changed in future to |
;     |         |               pointers)                   |
;     |   27-31 |   Reserved                                |
;      -----------------------------------------------------
;---------------------------------------------------------

    sector    = $a000
     page     = $a001 
    dataport  = $a400
    mypage    = $0a
    mysector  = $0b

;---------------------------------------------------

!to "saveprog.prg",cbm

; Basicstart

*= $0400

!byte $00,$0c,$08,$0a,$00,$9e,$31,$30,$33,$39,$00,$00,$00,$00

; main

*=$040f

 
          lda #$20               ; Sector 32  : Directory
          sta sector             
          ldx #$0  
          stx page               ; set page 0   
j0:       lda entry0,x           ; load
          sta dataport,x         ; and save two entries 
          inx
          cpx #$40               ; write both entries
          bne j0

          lda #97                ; Sector 97 : Datas
          sta sector
          sta mysector

          ldy #$00               ; write programs 
j1:       lda $1000,y
          sta dataport,y         ; into memory expansion
          iny
          bne j1         
          inc j1+2 
          inc mysector           ; save actual sector 
          lda mysector           ; load it 
          sta sector             ; and set register (write only !)
          cmp #115               ; up to sector 115
          bne j1
          rts


entry0:
          !byte $00,$00,$01,$00,$61
          !pet  "pflash8000     "
          !byte $00,$00,$04,$11,$d8,$10,$00,$00,$00,$00,$00

;entry1
          !byte $00,$01,$01,$00,$72
          !pet  "hello world    "
          !byte $00,$01,$04,$01,$54,$00,$00,$00,$00,$00,$00

*=$1000
!bin"pflash8000.prg"
*=$2100
!bin"hello.bas"
Persönliche Werkzeuge