Here we go. Sorry I can't upload files to my cloud space at OneDrive ATM, so you'll have to type in this for yourself. It's not that long anyhow:
Code: Select all
10 FORT=673TO712:READA:POKET,A:NEXT
11 DATA 32,241,215,32,201,255,169,0,133,251,168,169,64,133,252,170,138,72,152,72,177
12 DATA 251,32,210,255,104,168,104,170,200,208,240,230,252,202,208,235,76,204,255
13 :
14 OPEN2,11,2,"DUMP.BIN,S,W"
15 FORT=0TO15:POKE38912,T:SYS673,2:NEXT
16 CLOSE2
17 :
18 REM ** 256K DUMP.PRG WRITTEN 2015-07-18 BY MICHAEL KIRCHER
The file name in the OPEN statement adopts the convention of using the *.bin extension, in contrast to *.prg files which have the two-byte load address. The 1581 already knows it's a SEQ, so there...
I only ported the main loop to ML. Here's the commented disassembly:
Code: Select all
.02A1 20 F1 D7 JSR $D7F1 ; read channel number from BASIC text into X
.02A4 20 C9 FF JSR $FFC9 ; CHKOUT - set channel in X for output
.02A7 A9 00 LDA #$00
.02A9 85 FB STA $FB
.02AB A8 TAY
.02AC A9 40 LDA #$40
.02AE 85 FC STA $FC ; set high byte of pointer to $40
.02B0 AA TAX ; ... incidentally also number of pages to write
.02B1 +---+---> 8A TXA ; put current X and Y on stack
.02B2 | | 48 PHA
.02B3 | | 98 TYA
.02B4 | | 48 PHA
.02B5 | | B1 FB LDA ($FB),Y ; read single RAM byte
.02B7 | | 20 D2 FF JSR $FFD2 ; CHROUT to file
.02BA | | 68 PLA ; restore X and Y from stack
.02BB | | A8 TAY
.02BC | | 68 PLA
.02BD | | AA TAX
.02BE | | C8 INY ; increment effective address within page
.02BF | +---< D0 F0 BNE $02B1
.02C1 | E6 FC INC $FC ; increment high byte of pointer
.02C3 | CA DEX ; decrement remaining pages
.02C4 +-------< D0 EB BNE $02B1 ; until =0.
.02C6 4C CC FF JMP $FFCC ; CLRCHN - restore default output