News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Examples of pipes for the Win32 console

Started by Larry Hammick, November 27, 2007, 09:38:59 PM

Previous topic - Next topic

Larry Hammick

The zip contains three asm programs that read standard input and write standard output, so that they can be used as "pipes".
stdio.asm
is little more than a stub to illustrate the buffered file i/o and the get/put loop. It just capitalizes every byte in the input. When it's assembled, try e.g.
echo Hello|stdio
and out comes "HELLO", or enter
stdio<sometextfile
and the capitalized file is written to the screen.

The other two
8-7.asm
7-8.asm
are a little fancier. 8-7 slightly compresses any text that contains only lower ascii and no zeros, and 7-8 uncompresses the result. So if you go
type somefile|8-7
or
8-7<somefile
you see gibberish, but if you go
type somefile|8-7|7-8
or
8-7|7-8 <somefile
then out comes "somefile".



[attachment deleted by admin]

donkey

Nice work Larry,

Very clear and useful example code covering a topic that seems to come up regularly here.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable