2016-12-02 16:09:24 +00:00
|
|
|
|
NEW
|
2018-11-17 17:17:13 +00:00
|
|
|
|
PREFIX
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2019-12-04 13:46:58 +00:00
|
|
|
|
.TF bin/format
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
2019-08-26 06:29:18 +00:00
|
|
|
|
.INB INC/MLI.E.I
|
|
|
|
|
.INB INC/KERNEL.I
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.INB INC/LIBBLKDEV.I
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
2018-12-18 14:37:07 +00:00
|
|
|
|
.DUMMY
|
|
|
|
|
.OR ZPBIN
|
|
|
|
|
ZS.START
|
|
|
|
|
ZPPtr1 .BS 2
|
2019-02-13 06:50:10 +00:00
|
|
|
|
ZPPtrFD .BS 2
|
|
|
|
|
ZPPtrDevName .BS 2
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2020-01-06 07:03:37 +00:00
|
|
|
|
Index .BS 1
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
|
|
|
|
hDevID .BS 1
|
2019-10-09 10:05:08 +00:00
|
|
|
|
hBuf .BS 1
|
2020-01-06 07:03:37 +00:00
|
|
|
|
hMem .BS 1
|
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
bLL .BS 1
|
|
|
|
|
bCustomBlkSize .BS 1
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
MediaBlkSize .BS 2
|
|
|
|
|
CatSize .BS 1
|
|
|
|
|
CatBlkCnt .BS 1
|
|
|
|
|
CatOptions .BS 1
|
|
|
|
|
|
2018-12-18 14:37:07 +00:00
|
|
|
|
ZS.END
|
|
|
|
|
.ED
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
2018-12-18 14:37:07 +00:00
|
|
|
|
.DA #0 S.PS.F.EVENT
|
|
|
|
|
.DA #0
|
|
|
|
|
.DA CS.END-CS.START Code Size (without Constants)
|
|
|
|
|
.DA DS.END-DS.START Data SegmentSize
|
|
|
|
|
.DA #32 Stack Size
|
|
|
|
|
.DA #ZS.END-ZS.START Zero Page Size
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
2019-08-26 06:29:18 +00:00
|
|
|
|
*--------------------------------------
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
2019-08-26 06:29:18 +00:00
|
|
|
|
.DA CS.DOEVENT
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.LIBBLKDEV .DA LIBBLKDEV
|
2017-03-30 16:11:31 +00:00
|
|
|
|
L.MSG.USAGE .DA MSG.USAGE
|
|
|
|
|
L.MSG.OK .DA MSG.OK
|
|
|
|
|
L.MSG.ERR .DA MSG.ERR
|
2020-01-06 07:03:37 +00:00
|
|
|
|
L.MSG.CRLF .DA MSG.CRLF
|
2019-08-26 06:29:18 +00:00
|
|
|
|
L.MSG.NOSIZE .DA MSG.NOSIZE
|
|
|
|
|
L.MSG.INIT .DA MSG.INIT
|
2020-01-06 07:03:37 +00:00
|
|
|
|
L.MSG.LLDISK2 .DA MSG.LLDISK2
|
|
|
|
|
L.MSG.LL .DA MSG.LL
|
|
|
|
|
L.MSG.WRITECAT .DA MSG.WRITECAT
|
2019-08-26 06:29:18 +00:00
|
|
|
|
L.FMT.BLANK .DA FMT.BLANK
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2019-10-08 12:47:47 +00:00
|
|
|
|
CS.INIT >LDYA L.LIBBLKDEV
|
|
|
|
|
>SYSCALL LoadLib
|
|
|
|
|
bcs .9
|
|
|
|
|
sta hLIBBLKDEV
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN ldy #S.PS.ARGC
|
2020-02-28 07:21:46 +00:00
|
|
|
|
lda (pPS),y
|
2019-10-08 12:47:47 +00:00
|
|
|
|
beq .99
|
2018-11-05 16:28:40 +00:00
|
|
|
|
|
2020-01-06 07:03:37 +00:00
|
|
|
|
.1 inc Index
|
|
|
|
|
lda Index
|
2018-10-16 15:48:03 +00:00
|
|
|
|
>SYSCALL ArgV
|
2018-04-19 12:06:21 +00:00
|
|
|
|
bcc .11
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
jmp .8
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
.11 >STYA ZPPtr1
|
2016-12-02 16:09:24 +00:00
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
cmp #'-'
|
|
|
|
|
bne .4
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2017-10-03 15:33:30 +00:00
|
|
|
|
ldy #1
|
2016-12-02 16:09:24 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2019-10-08 12:47:47 +00:00
|
|
|
|
beq .99
|
2016-12-02 16:09:24 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
cmp #'0'
|
2019-10-08 12:47:47 +00:00
|
|
|
|
bcc .2
|
2018-04-19 12:06:21 +00:00
|
|
|
|
cmp #'9'+1
|
2019-10-08 12:47:47 +00:00
|
|
|
|
bcs .2
|
2018-04-19 12:06:21 +00:00
|
|
|
|
and #$0F
|
2019-10-08 12:47:47 +00:00
|
|
|
|
sta CatSize
|
|
|
|
|
.10 bra .1
|
|
|
|
|
|
|
|
|
|
.2 jsr CS.RUN.CheckOpt
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
cpy #bCustomBlkSize
|
|
|
|
|
bne .1
|
|
|
|
|
|
2020-01-06 07:03:37 +00:00
|
|
|
|
inc Index
|
|
|
|
|
lda Index
|
2019-10-08 12:47:47 +00:00
|
|
|
|
>SYSCALL ArgV
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
>SYSCALL atoi
|
|
|
|
|
>STYA MediaBlkSize
|
2016-12-02 16:09:24 +00:00
|
|
|
|
bra .1
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
.99 >PUSHW L.MSG.USAGE
|
|
|
|
|
>PUSHBI 0
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2019-10-08 12:47:47 +00:00
|
|
|
|
lda #E.SYN
|
|
|
|
|
sec
|
2020-01-06 07:03:37 +00:00
|
|
|
|
.9 rts
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
|
|
|
|
.4 lda hDevID
|
2018-08-11 10:57:57 +00:00
|
|
|
|
bne .5 Already have a dev...go get VolName
|
|
|
|
|
|
2017-03-30 16:11:31 +00:00
|
|
|
|
>LDYA ZPPtr1
|
2018-08-11 10:57:57 +00:00
|
|
|
|
>SYSCALL GetDevByName
|
2020-01-06 07:03:37 +00:00
|
|
|
|
bcs .9
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2019-02-13 06:50:10 +00:00
|
|
|
|
>STYA ZPPtrFD
|
2019-10-08 12:47:47 +00:00
|
|
|
|
stx hDevID
|
2019-02-13 06:50:10 +00:00
|
|
|
|
>LDYA ZPPtr1
|
|
|
|
|
>STYA ZPPtrDevName
|
2019-10-08 12:47:47 +00:00
|
|
|
|
bra .10
|
|
|
|
|
|
2017-10-03 15:33:30 +00:00
|
|
|
|
.5 ldy #$ff
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2017-10-03 15:33:30 +00:00
|
|
|
|
.6 iny
|
2017-10-04 15:12:03 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2019-10-08 12:47:47 +00:00
|
|
|
|
sta (pData),y VolName
|
|
|
|
|
beq .10
|
2017-10-03 15:33:30 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
cpy #16
|
|
|
|
|
bcc .6
|
|
|
|
|
bra .99 VolName too long
|
2018-04-19 12:06:21 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
.8 lda hDevID
|
|
|
|
|
beq .99
|
2018-04-19 12:06:21 +00:00
|
|
|
|
*--------------------------------------
|
2020-01-06 07:03:37 +00:00
|
|
|
|
CS.RUN.Format jsr CS.RUN.GetDevStatus
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHW L.MSG.INIT
|
2020-01-06 07:03:37 +00:00
|
|
|
|
>PUSHW ZPPtrDevName
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHW MediaBlkSize
|
|
|
|
|
>PUSHEA.G VolName
|
|
|
|
|
|
2020-01-06 07:03:37 +00:00
|
|
|
|
>PUSHBI 6
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2019-10-08 12:47:47 +00:00
|
|
|
|
bcs .9
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
|
|
|
|
bit bLL
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
jsr CS.RUN.LL
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.1 jsr CS.RUN.InitCat
|
2018-04-19 12:06:21 +00:00
|
|
|
|
bcs .9
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
jsr CS.RUN.BuildCat
|
|
|
|
|
bcs .9
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
jsr CS.RUN.WriteCat
|
|
|
|
|
bcs .9
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
>LDYA L.MSG.OK
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PutS
|
2018-04-19 12:06:21 +00:00
|
|
|
|
lda #0
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
.9 pha
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHW L.MSG.ERR
|
|
|
|
|
pla
|
|
|
|
|
pha
|
2018-04-19 12:06:21 +00:00
|
|
|
|
>PUSHA
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>PUSHBI 1
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2018-04-19 12:06:21 +00:00
|
|
|
|
pla
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-01-06 07:03:37 +00:00
|
|
|
|
CS.RUN.GetDevStatus
|
2019-10-08 12:47:47 +00:00
|
|
|
|
lda bCustomBlkSize
|
|
|
|
|
bmi .8
|
|
|
|
|
|
2020-02-29 14:06:28 +00:00
|
|
|
|
>PUSHB hDevID
|
2019-10-08 12:47:47 +00:00
|
|
|
|
>PUSHEA.G DIB
|
2020-02-29 14:06:28 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
>SYSCALL GetDevStatus
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDA.G DIB+S.DIB.SIZE
|
|
|
|
|
tax
|
|
|
|
|
iny
|
|
|
|
|
ora (pData),y
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
lda (pData),y
|
|
|
|
|
sta MediaBlkSize+1
|
|
|
|
|
stx MediaBlkSize
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 >LDYA L.MSG.NOSIZE
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PutS
|
2019-10-08 12:47:47 +00:00
|
|
|
|
lda #MLI.E.IO
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-01-06 07:03:37 +00:00
|
|
|
|
CS.RUN.LL >LDA.G DIB+S.DIB.T
|
|
|
|
|
cmp #S.DIB.T.DISKII
|
|
|
|
|
beq CS.RUN.LL.DISKII
|
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHW L.MSG.LL
|
2020-01-06 07:03:37 +00:00
|
|
|
|
>PUSHBI 0
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2020-01-06 07:03:37 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2020-02-29 14:06:28 +00:00
|
|
|
|
>PUSHB hDevID
|
2020-01-06 07:03:37 +00:00
|
|
|
|
>PUSHBI IOCTL.FORMAT
|
2020-02-29 14:06:28 +00:00
|
|
|
|
>PUSHEA.G IOCTL
|
|
|
|
|
|
2020-01-06 07:03:37 +00:00
|
|
|
|
>SYSCALL IOCTL
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.LL.DISKII
|
|
|
|
|
>LDYAI 4096
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL GetMem
|
2020-01-06 07:03:37 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
stx hMem
|
|
|
|
|
|
|
|
|
|
stz Index
|
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
.1 >PUSHW L.MSG.LLDISK2
|
|
|
|
|
>PUSHB Index
|
2020-01-06 07:03:37 +00:00
|
|
|
|
>PUSHBI 1
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2020-01-06 07:03:37 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc Index
|
|
|
|
|
lda Index
|
|
|
|
|
cmp #35
|
|
|
|
|
bne .1
|
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHW L.MSG.CRLF
|
2020-01-06 07:03:37 +00:00
|
|
|
|
>PUSHBI 0
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2020-01-06 07:03:37 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2019-10-08 12:47:47 +00:00
|
|
|
|
CS.RUN.InitCat lda CatSize
|
2018-04-19 12:06:21 +00:00
|
|
|
|
bne .1
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
lda #4
|
2019-10-08 12:47:47 +00:00
|
|
|
|
sta CatSize
|
2018-04-19 12:06:21 +00:00
|
|
|
|
|
|
|
|
|
.1 >LDA.G VolName
|
2016-12-02 16:09:24 +00:00
|
|
|
|
bne .8 Volume name ok
|
2017-10-04 06:16:39 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHEA.G VolName
|
|
|
|
|
>PUSHW L.FMT.BLANK
|
2019-08-26 06:29:18 +00:00
|
|
|
|
>PUSHW A2osX.TIMER16
|
|
|
|
|
>PUSHW A2osX.RANDOM16
|
|
|
|
|
>PUSHBI 4
|
|
|
|
|
>SYSCALL sprintf
|
|
|
|
|
rts
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
.8 clc
|
2016-12-02 16:09:24 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-01-06 07:03:37 +00:00
|
|
|
|
CS.RUN.BuildCat jsr .7
|
2018-04-19 12:06:21 +00:00
|
|
|
|
|
2017-10-04 15:12:03 +00:00
|
|
|
|
>LIBCALL hLIBBLKDEV,LIBBLKDEV.GetProDOSCatSize
|
2017-10-04 06:16:39 +00:00
|
|
|
|
bcs .9
|
2017-10-04 15:12:03 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
stx CatBlkCnt
|
|
|
|
|
|
2020-01-30 14:59:40 +00:00
|
|
|
|
>SYSCALL GetMem BufferSize
|
2017-03-30 16:11:31 +00:00
|
|
|
|
bcs .9
|
2020-01-30 21:55:41 +00:00
|
|
|
|
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>STYA.G IOCTL+S.IOCTL.BUFPTR
|
2019-10-09 10:05:08 +00:00
|
|
|
|
stx hBuf
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2020-01-30 21:55:41 +00:00
|
|
|
|
lda CatBlkCnt
|
|
|
|
|
asl
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
.1 sta (ZPPtr1),y
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
jsr .7
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2017-10-04 06:16:39 +00:00
|
|
|
|
>PUSHEA.G VolName
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>PUSHW.G IOCTL+S.IOCTL.BUFPTR
|
2017-03-30 16:11:31 +00:00
|
|
|
|
>LIBCALL hLIBBLKDEV,LIBBLKDEV.BuildProDOSCat
|
|
|
|
|
.9 rts
|
2018-04-19 12:06:21 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
.7 >PUSHW MediaBlkSize
|
|
|
|
|
>PUSHB CatSize
|
|
|
|
|
>PUSHB CatOptions
|
2018-04-19 12:06:21 +00:00
|
|
|
|
rts
|
2017-03-30 16:11:31 +00:00
|
|
|
|
*--------------------------------------
|
2020-02-14 07:21:56 +00:00
|
|
|
|
CS.RUN.WriteCat >PUSHW L.MSG.WRITECAT
|
|
|
|
|
>PUSHBI 0
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2020-02-29 14:06:28 +00:00
|
|
|
|
.1 >PUSHB hDevID
|
|
|
|
|
>PUSHBI IOCTL.WRITEBLOCK
|
|
|
|
|
>PUSHEA.G IOCTL
|
|
|
|
|
|
2018-04-16 15:25:39 +00:00
|
|
|
|
>SYSCALL IOCTL
|
2017-03-30 16:11:31 +00:00
|
|
|
|
bcs .9
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2017-10-04 15:12:03 +00:00
|
|
|
|
lda #'.'
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL PutChar
|
2020-01-06 07:03:37 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>LDA.G IOCTL+S.IOCTL.BUFPTR+1
|
|
|
|
|
inc
|
|
|
|
|
inc
|
2017-10-04 06:16:39 +00:00
|
|
|
|
sta (pData),y
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>INC.G IOCTL+S.IOCTL.BLKNUM
|
2018-04-16 15:25:39 +00:00
|
|
|
|
>SLEEP
|
2019-10-08 12:47:47 +00:00
|
|
|
|
dec CatBlkCnt
|
2020-01-06 07:03:37 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
clc
|
2017-03-30 16:11:31 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-03-13 16:55:43 +00:00
|
|
|
|
CS.DOEVENT sec
|
2016-12-02 16:09:24 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-10-09 10:05:08 +00:00
|
|
|
|
CS.QUIT lda hBuf
|
2017-03-30 16:11:31 +00:00
|
|
|
|
beq .1
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
.1 lda hMem
|
|
|
|
|
beq .2
|
|
|
|
|
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL FreeMem
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
|
|
|
|
.2 lda hLIBBLKDEV
|
2016-12-02 16:09:24 +00:00
|
|
|
|
beq .8
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>SYSCALL UnloadLib
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-10-08 12:47:47 +00:00
|
|
|
|
CS.RUN.CheckOpt ldy #1
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
|
|
|
|
|
ldx #OptionVars-OptionList-1
|
|
|
|
|
|
|
|
|
|
.2 cmp OptionList,x
|
|
|
|
|
beq .3
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.3 ldy OptionVars,x
|
|
|
|
|
ldx #$ff
|
|
|
|
|
stx 0,y
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-12-02 16:09:24 +00:00
|
|
|
|
CS.END
|
|
|
|
|
*--------------------------------------
|
2019-12-04 13:46:58 +00:00
|
|
|
|
LIBBLKDEV .AZ "libblkdev"
|
2019-08-26 06:29:18 +00:00
|
|
|
|
hLIBBLKDEV .BS 1
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
2018-04-19 12:06:21 +00:00
|
|
|
|
MSG.USAGE .AS "Usage : FORMAT <BLOCKDEV> [VOLUME.NAME]\r\n"
|
|
|
|
|
.AS " -L : Low-Level Format\r\n"
|
2019-10-08 12:47:47 +00:00
|
|
|
|
.AS " -B xxxx : override Device block size\r\n"
|
2018-04-19 12:06:21 +00:00
|
|
|
|
.AZ " -1-9 : Catalog Size (Blocks)\r\n"
|
2018-08-22 15:23:27 +00:00
|
|
|
|
MSG.OK .AZ "[OK]"
|
2020-01-06 07:03:37 +00:00
|
|
|
|
MSG.ERR .AS "[%h]"
|
|
|
|
|
MSG.CRLF .AZ "\r\n"
|
2019-08-26 06:29:18 +00:00
|
|
|
|
MSG.NOSIZE .AZ "Unable to get media size."
|
2020-01-06 07:03:37 +00:00
|
|
|
|
MSG.INIT .AZ "Formatting %s (%D Blks), Volname:%s\r\n"
|
|
|
|
|
MSG.LLDISK2 .AZ "\rTrack %02d..."
|
|
|
|
|
MSG.LL .AZ "\rLow Level Format..."
|
|
|
|
|
MSG.WRITECAT .AZ "Writing Catalog..."
|
2019-08-26 06:29:18 +00:00
|
|
|
|
FMT.BLANK .AZ "BLANK%H%H"
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
2019-10-08 12:47:47 +00:00
|
|
|
|
OptionList .AS "LlBb"
|
|
|
|
|
OptionVars .DA #bLL,#bLL,#bCustomBlkSize,#bCustomBlkSize
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
|
|
|
|
VolName .BS 16
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-07-20 14:10:10 +00:00
|
|
|
|
IOCTL .BS S.IOCTL
|
|
|
|
|
DIB .BS S.DIB
|
2017-10-09 05:51:32 +00:00
|
|
|
|
DS.END .ED
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2018-12-03 06:59:30 +00:00
|
|
|
|
SAVE USR/SRC/BIN/FORMAT.S
|
2016-12-02 16:09:24 +00:00
|
|
|
|
ASM
|