Hacker Newsnew | past | comments | ask | show | jobs | submit | martindale's favoriteslogin

Author here.

Due to popular request, I extracted the text from the PDF, it's in a gist at the bottom.

A funny (on my account) story:

After three days with little sleep, the last half-day spent finding just one more byte to remove so it fits in a nice rectangle[1], I was finally done. I sent the complete .asm to Oded Margalit, an IBM researcher who organizes the CodeGuru programming competitions in Israel, and he immediately responded "I can shave 5 bytes off".

It turns out instead of the "quit" system call all the books tell you to write:

    ;;; the program has finished
    quit:   
        mov     ah, 04ch        ; quit with return code
        mov     al, 0
        int     021h
You can just put a "ret", and DOS loads an address containing these commands to the bottom of your stack so it works.

You had to see my reaction.

[1] it was supposed to be 32x13 characters at the bottom, after it was done I decided to make it 8x52 characters on the right because it looked better. Had I known I would do it, I could've gone to sleep much earlier...


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: