First post, by verelse
Int 21h function 01h does not echo input characters to the console. I built the attached TASM code using Turbo Assembler 5.0 under DOSBox 0.72 on these machines:
Dell D630, Windows XP 64 bit, sp3, 4GB RAM, Quadro NVS 135 128MB.
Dell Precision 490, Dual Xeon Dual-Core 3.2, 24GB RAM, Vista 64-bit
Dell GX270 P4 HT, 2GB DDR2 RAM, Intel GMA cruddy video card
Got same results, no echo from function 1 int 21h. Compiled under MS-DOS 6.22 running on Compaq Deskpro XL Pentium Pro 200 MHz with 64MB RAM, under MS-DOS 6.22 on VMWare Workstation 6 and Virtual PC 7 got correct results, echo'd characters from function 1.
I am aware I can workaround this, but this function is fairly integral to DOS and was even inherited from CP/M if I remember rightly.
Can't seem to get attachment to work so including code below.
;--------------------------------------------------------------------; program: echoout; function: reads until nothing left or eof char; owner: *****; date: changes; 1998/04/15 original version;--------------------------------------------------------------------ideal ;use turbo ideal modemodel small ;64k code and 64k datap8086 ;only allow 8086 instructionsstack 256 ;reserve 256 bytes for the stack;---------------------------------------dataseg ;start the data segment;---------------------------------------eof_char db 1ah ;byte variable dos eof char;---------------------------------------codeseg ;start the code segment;---------------------------------------start: ;mov ax,@data ;establish addressability to themov ds,ax ;data segment for this program;---------------------------------------; do the dew before the dew does you;---------------------------------------dowhile: mov ah,0bh ;set int 21h function check bufferint 21h ;check for character in streamcmp al,00h ;check for lack of dataje exit ;term on no datamov ah,01h ;set int 21h function read w echoint 21h ;ask dos for character from streamcmp al,[eof_char] ;is character eof?je exit ;term on eof characterjmp dowhile ;;---------------------------------------; terminate program execution;---------------------------------------exit: ;mov ax,4c00h ;set dos code to terminateint 21h ;return to dosend start ;mark the end of the source code;....specify start execution;---------------------------------------