Re: Problems posting to CLAX...



On Feb 4, 3:29 am, Frank Kotler <fbkot...@xxxxxxxxxxx> wrote:
Evenbit wrote:

...

// Usage: txt2com < bomb.hex > bomb.com
program txt2com;
...
w.WriteFile( hOUT, Obuf, 1, got, NULL );

Does this work for you? I thought, "I'll show Nathan, I'll knock off a
dos version in a couple dozen bytes!". Sleepy as I was, I went to work
on it. Gave up in total frustration and went to bed. After fixing a
number of stupid errors, it was *almost* right. Finally figured it out.
When I got to "mov ah, 9", for example, the damn TAB was converted to
spaces! Kinda breaks the Sacred OneToOne! This may be a "special
feature" of dosemu - I don't recall encountering the problem - I'm not
sure I've written a binary file to stdout and redirected it to an
executable... Doesn't work with dosemu, in any case. The obvious
solution is to write to a "real file", not stdout, but I was trying to
be lazy...

Nice touch, writing the result to stderr!


Yes, this works... er, seems to anyway. The count reaches 699 bytes
and a DIR shows bomb.com as 699 in size. I can also verify that
running the bomb makes it go KABOOM! If dosemu is expanding TABs in
StdOut, that could be a bug. Or, maybe this is standard behavior for
DOS, and the Windows API changed the nature of the game. Wouldn't
surprise me. Maybe something to do with POSIX compliance??

Openning a _regular_ file calls for parsing arguments ( isn't that the
domain of alt.debate ?? ) .. but, doesn't Herbie always preach that
command-line proggies _should_ be "filter programs" using StdIn/StdOut
redirection, piping, and stuff? [don't catch STD kiddies, practice
safe hex]

I initially was going to code this for DOS .. "I'll show Frank" .. but
decided Hella would be faster (for *me*). Added the 'count' when I
realized that this resembled my suggestion to somebody ( c.l.a.x?? )
about counting words. Kinda 'cheated' there because I should have
stayed consistent with the theme and showed
"w.GetStdHandle( w.STD_ERROR_HANDLE )" and such.

I laughed at myself after posting this and realising what I did. I
mean, I was 'half-way' to the finish-line and then I make a call to
some function (a crutch). Idiot. :)

Nathan.

.



Relevant Pages

  • Re: File I/O using NASM in 32-bit mode
    ... easily done as a Win32 console application as it is a DOS application. ... int21 version for writing a charater to stdout ... An assembly program is a sequence of CPU instructions. ... the same knowledge about assembly programming independent from the ...
    (alt.lang.asm)
  • Re: get tclapp-wrapped app to display output in DOS console?
    ... If I run this program from a cygwin bash shell, the output appears as expected and all is well. ... I recently discovered, however, that the same executable run with the same command line from a DOS shell doesn't display any output in the DOS window. ... The program appears to run in the background and I have no idea where stdout is going. ...
    (comp.lang.tcl)
  • get tclapp-wrapped app to display output in DOS console?
    ... We have an application wrapped with tclapp that runs on windows. ... If I run this program from a cygwin bash shell, the output appears as expected and all is well. ... I recently discovered, however, that the same executable run with the same command line from a DOS shell doesn't display any output in the DOS window. ... The program appears to run in the background and I have no idea where stdout is going. ...
    (comp.lang.tcl)
  • Re: How to script DOS app that doesnt use stdout
    ... > There's a DOS console application I am trying to script (in Python), ... The good-ole DOS app could be doing many things. ... One would think that if it did a DUP of stdout that it might get captured, ...
    (comp.lang.python)
  • Re: ESP corruption bug - what CPUs are affected?
    ... > blamed dosemu itself and that was it. ... > to spend weeks traceing the DOS programs under dosemu, ... V86 is affected too, no? ... > yet decided to make it a part of the specs... ...
    (Linux-Kernel)