2016-11-01 21:37:12 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPPtr1 .EQ ZPBIN
|
|
|
|
|
ZPPtr2 .EQ ZPBIN+2
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START Code Length To Relocate
|
|
|
|
|
.DA DS.END-DS.START Data Segment to Allocate
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.MSG.USAGE .DA MSG.USAGE
|
|
|
|
|
L.MSG.DIR .DA MSG.DIR
|
|
|
|
|
L.MSG.FILE .DA MSG.FILE
|
|
|
|
|
L.MSG.OK .DA MSG.OK
|
|
|
|
|
L.MSG.ERR .DA MSG.ERR
|
|
|
|
|
L.STAT .DA STAT
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.INIT >SYSCALL GetArgC
|
|
|
|
|
sta ArgCount
|
|
|
|
|
cmp #1
|
2016-11-13 21:03:31 +00:00
|
|
|
|
beq .99
|
|
|
|
|
|
|
|
|
|
stz ArgIndex
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
|
|
|
|
.1 dec ArgCount
|
2016-11-08 16:56:05 +00:00
|
|
|
|
beq .7
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2016-11-13 21:03:31 +00:00
|
|
|
|
inc ArgIndex
|
|
|
|
|
lda ArgIndex
|
2016-11-01 21:37:12 +00:00
|
|
|
|
>SYSCALL GetArgA
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
cmp #2
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp #'-'
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
|
|
|
|
|
ldx OptionList
|
|
|
|
|
|
|
|
|
|
.2 cmp OptionList,x
|
|
|
|
|
beq .3
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
2016-11-13 21:03:31 +00:00
|
|
|
|
|
|
|
|
|
.99 >LDYA L.MSG.USAGE
|
|
|
|
|
>SYSCALL CPrintFYA
|
2016-11-01 21:37:12 +00:00
|
|
|
|
lda #SYSMGR.ERRSYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.3 ldy OptionVars-1,x
|
|
|
|
|
lda #$80
|
|
|
|
|
sta (pData),y
|
|
|
|
|
bra .1
|
|
|
|
|
|
2016-11-08 16:56:05 +00:00
|
|
|
|
.4 ldy #index
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bne .5 Already have a Src dir...
|
|
|
|
|
|
|
|
|
|
>LDYA ZPPtr1
|
2016-11-01 21:37:12 +00:00
|
|
|
|
jsr InitSrcDirYA
|
2016-11-08 16:56:05 +00:00
|
|
|
|
bcc .1 success, scan for any other args
|
|
|
|
|
rts
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2016-11-08 16:56:05 +00:00
|
|
|
|
.5 ldy #hDstBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bne .99 we already have a second arg....error!
|
|
|
|
|
|
|
|
|
|
>LDYA ZPPtr1
|
|
|
|
|
jsr InitDstDirYA
|
|
|
|
|
bcc .1 success, scan for any other args
|
|
|
|
|
rts
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2016-11-08 16:56:05 +00:00
|
|
|
|
.7 ldy #index processed all args
|
2016-11-01 21:37:12 +00:00
|
|
|
|
lda (pData),y
|
2016-11-08 16:56:05 +00:00
|
|
|
|
beq .99 , no src ? ERROR
|
|
|
|
|
|
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bne .8 we also have a Dst folder
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hPREFIX no dst folder, use actual prefix
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
jsr InitDstDirYA
|
|
|
|
|
bcs .99
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
|
|
|
|
.8 lda (pPs)
|
|
|
|
|
ora #S.PS.F.EVENT Now accept events
|
|
|
|
|
sta (pPs)
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN ldy #bCANCEL
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bmi .99
|
|
|
|
|
|
|
|
|
|
ldy #bSTOP
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bmi .8
|
|
|
|
|
|
|
|
|
|
jsr GetNextEntry
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #hFilter
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .4 No filter....
|
|
|
|
|
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHW ZPPtr1
|
|
|
|
|
>SYSCALL PStrMatch
|
|
|
|
|
bcs .8 no match, skip....
|
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
.4 ldy #S.STAT.P.DRIVE
|
2016-11-01 21:37:12 +00:00
|
|
|
|
lda (ZPPtr2),y ProDOS Device ?
|
|
|
|
|
bne .5
|
|
|
|
|
|
2016-12-09 16:36:24 +00:00
|
|
|
|
ldy #S.STAT.P.TYPE
|
2016-11-01 21:37:12 +00:00
|
|
|
|
lda (ZPPtr2),y
|
|
|
|
|
cmp #$0F Directory ?
|
|
|
|
|
bne .6
|
|
|
|
|
|
|
|
|
|
jmp CS.RUN.DIR
|
|
|
|
|
.5 jmp CS.RUN.DEV
|
|
|
|
|
.6 jmp CS.RUN.FILE
|
|
|
|
|
|
|
|
|
|
.9 jsr LeaveSubDir
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
ldy #bRecurse
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bpl .8
|
|
|
|
|
|
2016-11-13 21:03:31 +00:00
|
|
|
|
.DO X.DELETE.SOURCE=1
|
2016-11-01 21:37:12 +00:00
|
|
|
|
jsr CS.RUN.DELETE.DIR
|
|
|
|
|
jsr CS.RUN.PRINT.RC
|
2016-11-13 21:03:31 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
.FIN
|
|
|
|
|
|
2016-11-01 21:37:12 +00:00
|
|
|
|
jsr BasePath..
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.99 lda #0
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.DEV >PUSHW ZPPtr1
|
|
|
|
|
>LDYA L.MSG.FILE
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-11-01 21:37:12 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #bRecurse
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bpl .8
|
|
|
|
|
|
|
|
|
|
jsr CS.RUN.PRINT.FILE
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
clc
|
|
|
|
|
jsr CS.RUN.PRINT.RC
|
|
|
|
|
|
|
|
|
|
>LDYA ZPPtr1
|
|
|
|
|
jmp EnterSubDirYA
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.DIR ldy #bRecurse
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bpl .8
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp #'.'
|
|
|
|
|
beq .8
|
|
|
|
|
|
2016-11-13 21:03:31 +00:00
|
|
|
|
jsr CS.RUN.PRINT.DIR
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
jsr CS.RUN.COPY.DIR
|
|
|
|
|
jsr CS.RUN.PRINT.RC
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2016-11-01 21:37:12 +00:00
|
|
|
|
>LDYA ZPPtr1
|
|
|
|
|
jmp EnterSubDirYA
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.FILE jsr CS.RUN.PRINT.FILE
|
|
|
|
|
bcs .9
|
2016-11-13 21:03:31 +00:00
|
|
|
|
jsr CS.RUN.COPY.FILE
|
|
|
|
|
jsr CS.RUN.PRINT.RC
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.DO X.DELETE.SOURCE=1
|
2016-11-01 21:37:12 +00:00
|
|
|
|
jsr CS.RUN.DELETE.FILE
|
|
|
|
|
jsr CS.RUN.PRINT.RC
|
2016-11-13 21:03:31 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
.FIN
|
|
|
|
|
|
2016-11-01 21:37:12 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2016-11-13 21:03:31 +00:00
|
|
|
|
CS.RUN.PRINT.DIR
|
|
|
|
|
jsr CS.RUN.GET.SRC.DST
|
|
|
|
|
>LDYA L.MSG.DIR
|
|
|
|
|
bra CS.RUN.PRINT
|
2016-11-01 21:37:12 +00:00
|
|
|
|
CS.RUN.PRINT.FILE
|
2016-11-13 21:03:31 +00:00
|
|
|
|
jsr CS.RUN.GET.SRC.DST
|
|
|
|
|
>LDYA L.MSG.FILE
|
|
|
|
|
|
|
|
|
|
CS.RUN.PRINT >SYSCALL CPrintFYA
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
CS.RUN.GET.SRC.DST
|
2016-11-08 16:56:05 +00:00
|
|
|
|
ldy #hDstBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
|
2016-11-01 21:37:12 +00:00
|
|
|
|
>PUSHW ZPPtr1
|
2016-11-08 16:56:05 +00:00
|
|
|
|
|
|
|
|
|
ldy #hSrcBasePath
|
2016-11-01 21:37:12 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
2016-11-13 21:03:31 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.COPY.DIR ldy #hDstBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL PStrCpy
|
2016-11-01 21:37:12 +00:00
|
|
|
|
|
2016-11-13 21:03:31 +00:00
|
|
|
|
>PUSHW ZPPtr1
|
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL PStrCat
|
|
|
|
|
>LDYAI UsrBuf256
|
|
|
|
|
>SYSCALL MKDirYA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.COPY.FILE
|
|
|
|
|
jsr CS.RUN.MAKE.SRC
|
|
|
|
|
|
|
|
|
|
clc
|
2016-11-01 21:37:12 +00:00
|
|
|
|
rts
|
2016-11-13 21:03:31 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DO X.DELETE.SOURCE=1
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.DELETE.DIR
|
|
|
|
|
jsr CS.RUN.GET.BASE.PATH
|
|
|
|
|
bra CS.RUN.DELETE
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.DELETE.FILE
|
|
|
|
|
jsr CS.RUN.GET.BASE.PATH
|
|
|
|
|
>PUSHW ZPPtr1
|
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL PStrCat
|
|
|
|
|
|
|
|
|
|
CS.RUN.DELETE >LDYAI UsrBuf256
|
2016-11-08 16:56:05 +00:00
|
|
|
|
* >SYSCALL RemoveYA
|
|
|
|
|
clc
|
2016-11-01 21:37:12 +00:00
|
|
|
|
rts
|
2016-11-13 21:03:31 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.FIN
|
2016-11-01 21:37:12 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.GET.BASE.PATH
|
2016-11-08 16:56:05 +00:00
|
|
|
|
ldy #hSrcBasePath
|
2016-11-01 21:37:12 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL PStrCpy
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-11-13 21:03:31 +00:00
|
|
|
|
CS.RUN.MAKE.SRC ldy #hSrcBasePath
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
CS.RUN.MAKE.DST ldy #hDstBasePath
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL PStrCpy
|
|
|
|
|
|
|
|
|
|
>PUSHW ZPPtr1
|
|
|
|
|
>PUSHWI UsrBuf256
|
|
|
|
|
>SYSCALL PStrCat
|
|
|
|
|
>LDYAI UsrBuf256
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-11-01 21:37:12 +00:00
|
|
|
|
CS.RUN.PRINT.RC pha
|
|
|
|
|
php
|
|
|
|
|
bcs .1
|
|
|
|
|
>LDYA L.MSG.OK
|
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.1 >PUSHA
|
|
|
|
|
>LDYA L.MSG.ERR
|
|
|
|
|
|
2016-11-03 16:27:43 +00:00
|
|
|
|
.8 >SYSCALL CPrintFYA
|
2016-11-01 21:37:12 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
plp
|
2016-11-13 21:03:31 +00:00
|
|
|
|
bcc .81
|
2016-11-01 21:37:12 +00:00
|
|
|
|
ldy #bContinue
|
|
|
|
|
lda (pData),y
|
|
|
|
|
eor #$80
|
|
|
|
|
asl
|
2016-11-13 21:03:31 +00:00
|
|
|
|
.81 pla
|
2016-11-01 21:37:12 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 plx
|
|
|
|
|
plx
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
|
|
|
|
lda (pEvent),y
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ldy #S.PS.hStdIn
|
2016-11-01 21:37:12 +00:00
|
|
|
|
cmp (pPs),y
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
lda (pEvent)
|
|
|
|
|
and #S.EVT.F.KEY is it a KEY event?
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATAHI is it an O or SAPPLE key ?
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATALO
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
cmp #$03 Ctrl-C
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
lda #$FF
|
|
|
|
|
ldy #bCANCEL
|
|
|
|
|
sta (pData),y
|
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.1 cmp #$13 Ctrl-S
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
ldy #bSTOP
|
|
|
|
|
lda (pData),y
|
|
|
|
|
eor #$FF
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.QUIT jsr LeaveSubDir
|
|
|
|
|
bcc CS.QUIT
|
|
|
|
|
|
|
|
|
|
ldy #hFilter
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .3
|
|
|
|
|
>SYSCALL FreeMemA
|
|
|
|
|
|
|
|
|
|
.3 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE BIN/X.CPMV.S
|
2016-11-08 16:56:05 +00:00
|
|
|
|
LOAD BIN/CP.S
|
|
|
|
|
ASM
|