Subversion Repositories SvarDOS

Rev

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

Rev 517 Rev 519
Line 175... Line 175...
175
REVERT_REDIR_IF_ANY:
175
REVERT_REDIR_IF_ANY:
176
; is stdout redirected?
176
; is stdout redirected?
177
mov bx, [OLD_STDOUT]
177
mov bx, [OLD_STDOUT]
178
cmp bx, 0xffff
178
cmp bx, 0xffff
179
je STDOUT_DONE
179
je STDOUT_DONE
180
; revert the stdout handle (dst in BX alread)
180
; revert the stdout handle (dst in BX already)
181
mov cx, 1        ; src handle (1=stdout)
181
mov cx, 1        ; src handle (1=stdout)
182
mov ah, 0x46     ; redirect a handle
182
mov ah, 0x46     ; redirect a handle
183
int 0x21
183
int 0x21
-
 
184
; close the old handle (still in bx)
-
 
185
mov ah, 0x3e
-
 
186
int 0x21
184
mov [OLD_STDOUT], word 0xffff ; mark stdout as "not redirected"
187
mov [OLD_STDOUT], word 0xffff ; mark stdout as "not redirected"
185
STDOUT_DONE:
188
STDOUT_DONE:
186
ret
189
ret
187
 
190
 
188
 
191
 
Line 210... Line 213...
210
mov cx, 1              ; src handle (1=stdout)
213
mov cx, 1              ; src handle (1=stdout)
211
mov ah, 0x46           ; "redirect a handle"
214
mov ah, 0x46           ; "redirect a handle"
212
int 0x21
215
int 0x21
213
; close the original file handle, I no longer need it
216
; close the original file handle, I no longer need it
214
mov ah, 0x3e           ; close a file handle (handle in BX)
217
mov ah, 0x3e           ; close a file handle (handle in BX)
-
 
218
int 0x21
215
NO_STDOUT_REDIR:
219
NO_STDOUT_REDIR:
216
ret
220
ret