^D vs ^Z as EOF and DOS dinosaurs talking (was: open() and EOFError)

Chris Angelico rosuav at gmail.com
Tue Jul 8 18:20:05 CEST 2014

On Wed, Jul 9, 2014 at 1:57 AM, Tim Chase <python.list at tim.thechases.com> wrote:
> On 2014-07-09 01:49, Chris Angelico wrote:
>> Have you ever used COPY CON to create a binary file?
> No, for that I used DEBUG.EXE (or DEBUG.COM on older versions of DOS)

I never used a DOS version so old it had DEBUG.COM, but I used
DEBUG.EXE extensively. It was, for years, the only means I had of
building assembly language programs - no C compiler, no proper
assembler, nothing. One of my greatest triumphs, at the time, was the
development of an absolutely insane (even at the time I knew it was
insane) system that let me build an assembly program with line labels
in it; it would pipe commands into DEBUG and pipe the output back out,
and drive DEBUG's mini-assembler. When it came to a label, it would
look at what the prompt said would be the next address, and save it.
When the label was used, it would patch in the actual address. And
forward references were handled, too - it'd put in a placeholder, and
then go and assemble over it afterward. (I'm not sure what happened if
the placeholder resulted in the wrong size of jump command being
assembled. It was a definite consideration, as conditional jumps had
to be relative, but unconditional jumps could be relative (two-byte
command) or absolute (three-byte command). Maybe it just always put in
a distant target, and patched in a NOP if it didn't need the third
byte, or something. I don't remember.)

Sadly, there was a period when all my programming was either in BASIC
or assembly, and even more sadly, I would write low-level code using
DEBUG, save it into the format needed by BLOAD, and then CALL ABSOLUTE
the routine from BASIC... in order to, for instance, access the mouse.
Life got ever so much better when I moved to OS/2, and started using
REXX for most of my work. (And then eventually got a C compiler,
albeit a Windows one. Was years and years before I actually got a
decent build system for OS/2.)

There was a time when, just for the fun of it, I started memorizing a
whole lot of 8086 opcodes in hex, just so I could COPY CON PROGRAM.COM
and make something actually work. I don't think there was ever any
purpose in it at all, but it was fun. I guess that's a purpose... some
people play Tetris, some people have girlfriends/boyfriends, and some
people learn to write machine code at COPY CON...


More information about the Python-list mailing list