ctty/dup2 in DOS4 (Developers)
In the DOS4 source code, I can see:
cmd\command\tcmd2b.asm
ICLLOOP: ; Close basic handles
MOV AH,CLOSE
INT int_command
INC BX
LOOP ICLLOOP
POP BX ; Get handle
MOV AH,XDUP
INT int_command ; Dup it to 0
MOV AH,XDUP
INT int_command ; Dup to 1
MOV AH,XDUP
INT int_command ; Dup to 2
MOV AH,CLOSE ; Close initial handle
INT int_command
Now according to RBIL:
https://www.ctyme.com/intr/rb-2931.htm
BX should have the file handle. But I see 3 executions of Int int_command,
and I don't see BX changing from 0, to 1, to 2, between executions.
Any idea how this works?
Note - I'm trying to get "ctty com1:" to work on PDOS-generic, and I
don't really have the concept yet.
Thanks. Paul.
Complete thread:
- ctty/dup2 in DOS4 - kerravon, 26.12.2025, 20:08 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- ctty/dup2 in DOS4 - ecm, 26.12.2025, 21:39
Mix view