Subversion Repositories SvarDOS

Rev

Rev 412 | Rev 415 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 412 Rev 413
Line 107... Line 107...
107
    mov cx, [buffsz]
107
    mov cx, [buffsz]
108
    mov dx, [buff] /* DX points to buffer */
108
    mov dx, [buff] /* DX points to buffer */
109
    int 0x21       /* CF set on error, bytes read in AX (0=EOF) */
109
    int 0x21       /* CF set on error, bytes read in AX (0=EOF) */
110
    jc FAIL        /* abort on error */
110
    jc FAIL        /* abort on error */
111
    /* EOF? (ax == 0) */
111
    /* EOF? (ax == 0) */
112
    cmp ax, 0
112
    test ax, ax
113
    je ENDOFFILE
113
    jz ENDOFFILE
114
    /* write block of AX bytes to dst */
114
    /* write block of AX bytes to dst */
115
    mov cx, ax     /* block length */
115
    mov cx, ax     /* block length */
116
    mov ah, 0x40   /* DOS 2+ -- write to file (CX bytes from DS:DX) */
116
    mov ah, 0x40   /* DOS 2+ -- write to file (CX bytes from DS:DX) */
117
    mov bx, [dsth] /* file handle */
117
    mov bx, [dsth] /* file handle */
118
    /* mov dx, [buff] */ /* DX points to buffer already */
118
    /* mov dx, [buff] */ /* DX points to buffer already */
Line 121... Line 121...
121
    cmp ax, cx     /* sould be equal, otherwise failed */
121
    cmp ax, cx     /* sould be equal, otherwise failed */
122
    mov ax, 0x08   /* preset to DOS error "Insufficient memory" */
122
    mov ax, 0x08   /* preset to DOS error "Insufficient memory" */
123
    jne FAIL
123
    jne FAIL
124
    jmp COPY
124
    jmp COPY
125
 
125
 
126
    /* if dst ascii mode -> add an EOF */
-
 
127
    ENDOFFILE:
126
    ENDOFFILE:
128
    /* TODO */
127
    /* if dst ascii mode -> add an EOF (ASCII mode not supported for the time being) */
129
 
128
 
130
    jmp CLOSESRC
129
    jmp CLOSESRC
131
 
130
 
132
    FAIL:
131
    FAIL:
133
    mov [errcode], ax
132
    mov [errcode], ax
Line 170... Line 169...
170
    outputnl("destination  Specifies the directory and/or filename for the new file(s)");
169
    outputnl("destination  Specifies the directory and/or filename for the new file(s)");
171
    outputnl("/V           Verifies that new files are written correctly");
170
    outputnl("/V           Verifies that new files are written correctly");
172
    outputnl("");
171
    outputnl("");
173
    outputnl("To append files, specify a single file for destination, but multiple files");
172
    outputnl("To append files, specify a single file for destination, but multiple files");
174
    outputnl("for source (using wildcards or file1+file2+file3 format).");
173
    outputnl("for source (using wildcards or file1+file2+file3 format).");
-
 
174
    outputnl("");
-
 
175
    outputnl("NOTE: /A and /B are no-ops (ignored), provided only for compatibility reasons.");
175
    return(-1);
176
    return(-1);
176
  }
177
  }
177
 
178
 
178
  /* parse cmdline and fill the setup struct accordingly */
179
  /* parse cmdline and fill the setup struct accordingly */
179
 
180