Ob links

consonant (896763)
The Motherlode
The Cult


Please direct questions and comments (both yours and /.!) to the email address on the /. user page.

Listed on BlogShares


Friday, February 06, 2009

Nice story... almost!

Re:Yeah, I know... (Score:5, Interesting)

by Anthony_Cargile (1336739) Alter Relationship on 8:59 Wednesday 04 February 2009 (#26720761) Homepage

I feel this is a good time to discuss my signature.

Years ago, when MS-DOS was just entering version 5, I worked for Micro(-)soft, and I was on the shell team. One little optimization could be made to the PAUSE function, I thought, so I added it in, and even when I told my manager of the patch, he said surely a promotion would soon ensue, and Dave Cutler might even consider me for this project called "Windows NT"!

So everyone approved, and the patch was added. It was written in assembly language, by the way. So the patch was added, and soon the final build of MS-DOS 6 shipped. However, soon we started getting calls from users saying their batch files crashed DOS, and a thorough code inspection went under way. While inspecting the last couple of patches, many bugs were found, some even I fixed, and we were sure MS-DOS 6.21 was the final solution.

How wrong were we! The test batch files still crashed the OS, and upon further inspection, it was found that the PAUSE() function would crash just after printing the characters to the screen. They inspected my patch, found an erroneous jz mnemonic (despite our getch setting the eax [return] register to a non-zero ASCII character).

The log showed it was my patch, and I was soon speedily fired before the compilation of MS-DOS 6.22, which corrected the PAUSE function I messed up so bad. I have since regretted that function every day of my life, and I put it in my .sig as just a reminder of that horrible incident. So, think not of my signature as a juvenile C joke intended to frustrate an experienced DOS user, but instead the C port of the subroutine patch that costed me a Microsoft job at the time when, as a company, they were just about to reach their peak. Layoffs are not funny, even if caused by such a humorous-at-first-glance patch.

Never forget, slashdot, never forget.
void PAUSE(){ printf("\nPress any key to continue. . ."); while(1) getch(); }


Re:My Ambition (Score:4, Interesting)

by Anthony_Cargile (1336739) Alter Relationship on 7:55 Tuesday 06 January 2009 (#26338469) Homepage

I get sick of explaining this, but the sig (which could not completely fit because of /.) is supposed to infinitely loop like that. I'm fully aware that getch() is only found in DOS's conio.h (and the ncurses lib), but even The C Programming Language references it, without providing the code for it (or even a header inclusion, for that matter). The full code snippet (forgive me, mods) is this:

void PAUSE(){ printf("\nPress any key to continue. . ."); while(1) getch(); } // enforce the 'any' key

And this was used in an old app I wrote (a long time ago) - a fake COMMAND.COM/cmd.exe used to prank anyone who used it religiously, mainly a teacher I had that pinged something every about five minutes.

Now can we move on? (And if thats you, peter, then you obviously are new here).

void PAUSE(){ printf("\nPress any key to continue. . ."); while(1) getch(); }

Comments: Post a Comment