Subversion Repositories SvarDOS

Rev

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

Rev 1872 Rev 1873
Line 478... Line 478...
478
int 0x21        ; segment of the original PSP is in BX now
478
int 0x21        ; segment of the original PSP is in BX now
479
 
479
 
480
; set DS to the original PSP
480
; set DS to the original PSP
481
mov ds, bx
481
mov ds, bx
482
 
482
 
483
; load the pointer to the JFT and save it on stack
483
; load the pointer to the JFT, save it on stack, and set DS to the JFT seg
484
mov bx, [0x34] ; offset
484
mov bx, [0x34] ; offset
485
mov dx, [0x36] ; seg
485
mov ds, [0x36] ; seg
486
push dx
486
push ds
487
push bx
487
push bx
488
 
488
 
489
; switch DS to the JFT seg
-
 
490
mov ds, dx
-
 
491
 
-
 
492
; save the original process stdin and stdout on stack
489
; save the original process stdin and stdout on stack
493
mov dx, [bx]   ; original stdin and stdout (from the JFT)
490
mov dx, [bx]   ; original stdin and stdout (from the JFT)
494
push dx
491
push dx
495
 
492
 
496
; overwrite the original process stdin and stdout with stderr, in case stdout
493
; overwrite the original process stdin and stdout with stderr, in case stdout
497
; or stdin was redirected.
494
; or stdin was redirected.
498
mov dl, [bx+2]   ; the process stderr (3rd entry of the JFT in original PSP)
495
mov dl, [bx+2]   ; the process stderr (3rd entry of the JFT in original PSP)
499
mov dh, dl
496
mov dh, dl       ; dup DL so I can overwrite stdin and stdout with one write
500
mov [bx], dx
497
mov [bx], dx
501
 
498
 
502
; set DS to myself so I can reach (and display) my messages
499
; set DS to myself so I can reach (and display) my messages
503
push cs
500
push cs
504
pop ds
501
pop ds