base:saving_a_file
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | base:saving_a_file [2015-04-17 04:33] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Saving a memory range to a file ====== | ||
+ | < | ||
+ | file_start = $2000 ; example addresses | ||
+ | file_end | ||
+ | |||
+ | LDA # | ||
+ | LDX #<fname | ||
+ | LDY #>fname | ||
+ | JSR $FFBD ; call SETNAM | ||
+ | LDA #$00 | ||
+ | LDX $BA ; last used device number | ||
+ | BNE .skip | ||
+ | LDX #$08 ; default to device 8 | ||
+ | .skip LDY #$00 | ||
+ | JSR $FFBA ; call SETLFS | ||
+ | |||
+ | LDA #< | ||
+ | STA $C1 | ||
+ | LDA #> | ||
+ | STA $C2 | ||
+ | |||
+ | LDX #< | ||
+ | LDY #> | ||
+ | LDA #$C1 ; start address located in $C1/$C2 | ||
+ | JSR $FFD8 ; call SAVE | ||
+ | BCS .error | ||
+ | RTS | ||
+ | .error | ||
+ | ; Akkumulator contains BASIC error code | ||
+ | |||
+ | ... error handling ... | ||
+ | RTS | ||
+ | |||
+ | fname: | ||
+ | fname_end: | ||
+ | </ | ||
base/saving_a_file.txt · Last modified: 2015-04-17 04:33 by 127.0.0.1