Text impossible of catch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Text impossible of catch

#1 Post by carlos » 14 Feb 2014 11:08

Hello.
I'm beginning learn assembly and I write a simple code for write the argument line.
It uses the undocumented dos interrupt 29h.

this is a 16 bit program:

Edit: bugfix: replaced: mov al,[bx] by mov ax,[bx]
Edit2: bugfix: replaced: echo mov cl,[bx] by echo mov cx,[bx]

createwri.bat

Code: Select all

@echo off
(
echo a 100
echo mov bx,0080
echo mov cx,[bx]
echo inc bx
echo cmp cl,00
echo jz 0114
echo inc bx
echo mov ax,[bx]
echo int 29
echo dec cl
echo jmp 0106
echo ret
echo(
echo rcx
echo 15
echo n wri.com
echo w
echo q
) | debug




Code: Select all

C:\dev>WRI.COM hello >file.txt
hello
C:\dev>



It always print the text argument, but is impossible for me redirect that text to a file. It always is printed on screen even redirecting to file.

Seems that cmd not have code handle for text printed using that interrupt.

einstein1969
Expert
Posts: 976
Joined: 15 Jun 2012 13:16
Location: Italy, Rome

Re: Text impossible of catch

#2 Post by einstein1969 » 14 Feb 2014 14:10

I think that int 29 write to CON:(or direct to screen) device instead of STDOUT:

A question:
What is the "write on screen" faster method in dos batch?

EDIT: seem that use the int 10 (0E) that write to screen directly.

einstein1969

Post Reply