Subversion Repositories SvarDOS

Rev

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

Rev 1869 Rev 1870
Line 482... Line 482...
482
; set DS to original PSP
482
; set DS to original PSP
483
push bx
483
push bx
484
pop ds
484
pop ds
485
 
485
 
486
; save the original process stdin and stdout on stack
486
; save the original process stdin and stdout on stack
487
mov dh, [0x18]   ; original stdin (from the JFT)
-
 
488
mov dl, [0x19]   ; original stdout (from the JFT)
487
mov dx, [0x18]   ; original stdin and stdout (from the JFT)
489
push dx
488
push dx
490
 
489
 
491
; overwrite the original process stdin and stdout with stderr, in case stdout
490
; overwrite the original process stdin and stdout with stderr, in case stdout
492
; or stdin was redirected.
491
; or stdin was redirected.
493
mov dl, [0x1f]   ; the process stderr (3rd entry of the JFT in original PSP)
492
mov dl, [0x1f]   ; the process stderr (3rd entry of the JFT in original PSP)
494
mov [0x18], dl
493
mov dh, dl
495
mov [0x19], dl
494
mov [0x18], dx
496
 
495
 
497
; set DS to myself so I can reach (and display) my messages
496
; set DS to myself so I can reach (and display) my messages
498
push cs
497
push cs
499
pop ds
498
pop ds
500
 
499
 
Line 644... Line 643...
644
; (saved on stack as STDINSTDOUT PSPSEG"
643
; (saved on stack as STDINSTDOUT PSPSEG"
645
pop dx    ; original process' stdin and stdout handlers (dh=stdin / dl=stdout)
644
pop dx    ; original process' stdin and stdout handlers (dh=stdin / dl=stdout)
646
pop bx    ; original process' PSP
645
pop bx    ; original process' PSP
647
push bx
646
push bx
648
pop ds    ; set DS to the original process so I can access its PSP
647
pop ds    ; set DS to the original process so I can access its PSP
649
mov [0x18], dh
648
mov [0x18], dx
650
mov [0x19], dl
-
 
651
 
649
 
652
; restore registers and quit the handler
650
; restore registers and quit the handler
653
popf
651
popf
654
pop ds
652
pop ds
655
pop dx
653
pop dx