mirror of
https://github.com/a2stuff/prodos-path.git
synced 2024-12-26 22:30:54 +00:00
Add TOUCH command
This commit is contained in:
parent
f124dd1bd5
commit
96b87c2180
@ -44,6 +44,7 @@ Sample commands included:
|
||||
* `ONLINE` - lists online volumes (volume name, slot and drive)
|
||||
* `COPY` - copy a single file, e.g. `copy /path/to/file,dstfile`
|
||||
* `TYPE` - show file contents (TXT, BAS, or BIN/other), e.g. `type filename`
|
||||
* `TOUCH` - apply current ProDOS date/time to a file's modification time, e.g. `touch filename`
|
||||
* `DATE` - prints the current ProDOS date and time
|
||||
* `CHTYPE` - change the type/auxtype of a file, e.g. `chtype file,T$F1,A$1234`
|
||||
* `T` (type) and `A` (auxtype) are optional. If neither is specified, current types are shown.
|
||||
|
1
cd.cmd.s
1
cd.cmd.s
@ -27,7 +27,6 @@
|
||||
;; Point BI's parser at the command execution routine.
|
||||
lda #<execute
|
||||
sta XTRNADDR
|
||||
page_num2 := *+1 ; address needing updating
|
||||
lda #>execute
|
||||
sta XTRNADDR+1
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
;; Point BI's parser at the command execution routine.
|
||||
lda #<execute
|
||||
sta XTRNADDR
|
||||
page_num2 := *+1 ; address needing updating
|
||||
lda #>execute
|
||||
sta XTRNADDR+1
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
;; Point BI's parser at the command execution routine.
|
||||
lda #<execute
|
||||
sta XTRNADDR
|
||||
page_num2 := *+1 ; address needing updating
|
||||
lda #>execute
|
||||
sta XTRNADDR+1
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
;; Point BI's parser at the command execution routine.
|
||||
lda #<execute
|
||||
sta XTRNADDR
|
||||
page_num2 := *+1 ; address needing updating
|
||||
lda #>execute
|
||||
sta XTRNADDR+1
|
||||
|
||||
|
63
touch.cmd.s
Normal file
63
touch.cmd.s
Normal file
@ -0,0 +1,63 @@
|
||||
;;; ============================================================
|
||||
;;;
|
||||
;;; TOUCH - Apply current ProDOS date/time stamp to file
|
||||
;;;
|
||||
;;; Usage: TOUCH filename[,S#][,D#]
|
||||
;;;
|
||||
;;; * filename can be relative or absolute path
|
||||
;;;
|
||||
;;; ============================================================
|
||||
|
||||
.include "apple2.inc"
|
||||
.include "more_apple2.inc"
|
||||
.include "prodos.inc"
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
.org $4000
|
||||
|
||||
;; Point BI's parser at the command execution routine.
|
||||
lda #<execute
|
||||
sta XTRNADDR
|
||||
lda #>execute
|
||||
sta XTRNADDR+1
|
||||
|
||||
;; Mark command as external (zero).
|
||||
lda #0
|
||||
sta XCNUM
|
||||
|
||||
;; Set accepted parameter flags
|
||||
|
||||
;; Filename
|
||||
lda #PBitsFlags::FN1
|
||||
sta PBITS
|
||||
|
||||
;; Slot & Drive handling
|
||||
lda #PBitsFlags::SD
|
||||
sta PBITS+1
|
||||
|
||||
clc ; Success (so far)
|
||||
rts1: rts ; Return to BASIC.SYSTEM
|
||||
|
||||
;;; ============================================================
|
||||
|
||||
execute:
|
||||
;; Get the existing file info
|
||||
lda #$A
|
||||
sta SSGINFO
|
||||
lda #GET_FILE_INFO
|
||||
jsr GOSYSTEM
|
||||
bcs rts1
|
||||
|
||||
;; Apply time/date stamp
|
||||
ldx #3
|
||||
: lda DATE,x
|
||||
sta FIMDATE,x
|
||||
dex
|
||||
bpl :-
|
||||
|
||||
;; Set new file info
|
||||
lda #$7
|
||||
sta SSGINFO
|
||||
lda #SET_FILE_INFO
|
||||
jmp GOSYSTEM
|
@ -21,7 +21,6 @@
|
||||
;; Point BI's parser at the command execution routine.
|
||||
lda #<execute
|
||||
sta XTRNADDR
|
||||
page_num2 := *+1 ; address needing updating
|
||||
lda #>execute
|
||||
sta XTRNADDR+1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user