Skip to content

Commit 9733cb4

Browse files
committed
pip++
1 parent 41b8913 commit 9733cb4

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

pip.s

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ SIZE: .word 0
2323
FA1: .byte 8
2424
FNADR1: .word 0
2525
FNLEN1: .byte 0
26+
FNLEN2: .byte 0
2627

2728
.include "utils.s"
2829

2930
; -----------------------------------------------------------------------------
3031
; message table; last character has high bit set
3132
MSGBAS =*
3233
MSG0: .BYTE "PIP 0.2",13+$80
33-
MSG1: .BYTE "COPYING... ",$80
34+
MSG1: .BYTE "COPYING ",$80
3435
MSG2: .BYTE "ERROR ",$80
3536
MSG3: .BYTE " BYTES.",13+$80
3637

@@ -67,7 +68,9 @@ args:
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

8790
open_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

122135
redirect:
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
133148
copy_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+
155174
feof:
156175
AND #$BF
157176
beq done

run64.d64

0 Bytes
Binary file not shown.

run64.d71

0 Bytes
Binary file not shown.

run64.d81

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)