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.