File tree Expand file tree Collapse file tree 4 files changed +23
-4
lines changed Expand file tree Collapse file tree 4 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,15 @@ SIZE: .word 0
2323FA1: .byte 8
2424FNADR1: .word 0
2525FNLEN1: .byte 0
26+ FNLEN2: .byte 0
2627
2728.include "utils.s"
2829
2930; -----------------------------------------------------------------------------
3031; message table; last character has high bit set
3132MSGBAS =*
3233MSG0: .BYTE "PIP 0.2" ,13 +$80
33- MSG1: .BYTE "COPYING... " ,$80
34+ MSG1: .BYTE "COPYING " ,$80
3435MSG2: .BYTE "ERROR " ,$80
3536MSG3: .BYTE " BYTES." ,13 +$80
3637
6768 bcs @l31
6869 jmp open_files
6970
70- prep_copy: ; separate source and destination name
71+ ; separate source and destination names
72+ ; source becomes current file, destination goes to FNADR1 and FNLEN1
73+ prep_copy:
7174 lda FNLEN
7275 sty FNLEN1
7376 sec
@@ -85,6 +88,9 @@ prep_copy: ; separate source and destination name
8588 sta FNADR+1
8689
8790open_files:
91+ lda FNLEN
92+ sta FNLEN2
93+ beq @of1
8894 ; open input
8995 lda #pipfhi
9096 tay
@@ -98,6 +104,13 @@ open_files:
98104 ; open output
99105 lda FNLEN1
100106 beq redirect ; no output
107+
108+ LDY #MSG1-MSGBAS ; display
109+ JSR SNDMSG
110+ jsr print_name
111+ jsr CRLF
112+
113+ lda FNLEN1
101114 ldx FNADR1
102115 ldy FNADR1+1
103116 jsr SETNAMX
@@ -121,21 +134,26 @@ open_files:
121134
122135redirect:
123136 ; set input
137+ lda FNLEN2
138+ beq @rdro
124139 ldx #pipfhi
125140 jsr CHKIN
141+ @rdro:
126142 lda FNLEN1
127143 beq copy_loop
128144 ldx #pipfho
129- jsr CHKOUT
130-
145+ ; jsr CHKOUT
131146
132147 ldy #0
133148copy_loop:
149+
134150 jsr GETIN
135151 tax
136152 jsr READST
137153 bne feof
138154
155+ ; enable quote mode
156+ ; most controls are displayed as reverse characters
139157 lda #$FF
140158 sta QTSW
141159
@@ -152,6 +170,7 @@ copy_loop:
152170 jsr STOP
153171 bne copy_loop
154172 ; stop pressed
173+
155174feof:
156175 AND #$BF
157176 beq done
You can’t perform that action at this time.
0 commit comments