News for hackers. Stuff that matters.
Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by ataylor284_ on Sunday October 30, 2022 @09:53PM (#33401147)
Ah, debug. I used debug extensively for machine code programming on DOS. I couldn't afford MASM and certainly didn't have access to free assemblers. My first hello world program was almost exactly this.

However, I always ended my programs with INT 20 instead of RET, or INT 21 with AH = 0. RET worked both for standalone programs or in debug, but there was one exception: if you ran your code repeatedly in debug with G 100. It would work the first time, but IIRC the stack wasn't reinitialized to return to the correct place on subsequent G commands. I spent a lot of time typing, running and patching in a single session and INT 20 always worked correctly.

Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by neilv on Monday October 31, 2022 @12:51AM (#33402198)
Eventually, Borland came out with the Turbo Debugger and Turbo Assembler, "only" $100, which was a steal compared to Microsoft tools.
Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by shric on Monday October 31, 2022 @01:36AM (#33402399)
AH = 0? I only recall AH = 4C?

That would exit the program with AL being the exit value. I'm not aware of AH = 0?

Sadly, I used to write these kinds of programs with a hex editor, so "B4 4C CD 21" is etched into my brain even though "CD 20" was shorter.

Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by ataylor284_ on Monday October 31, 2022 @02:24AM (#33402607)
4C is correct. My INT 21 function codes memory is a bit fuzzy.
Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by bonzini on Monday October 31, 2022 @02:49AM (#33402724)
AH=4C is new in MSDOS 2.0, AH=0 dates back to CP/M (the low DOS calls are compatible with CP/M, hence the use of FCBs for example) and always sets the exit status to 0.
Re:A 28-byte “hello, world” program assembled with DEBUG.EXE... by aricz on Monday October 31, 2022 @03:08AM (#33402818)
int 20h for .com, and ah=4ch; int 21h; for .exe