QUOTE(FlierMate @ Nov 21 2022, 04:44 PM)
Very nice! I am aware that you know low-level stuff, but I didn't know you can code in Assembly (i8086)! Fantastic!
I didn't look up interrupt list, how did you get command line argument in DOS? Through "di" register? I know in Windows (through API) and Linux (through stack), but don't know about DOS.
150 bytes is not the smallest,
Because it wrap it with MZ header.
I think you already knew, you can produce .COM in FASM by changing the first line to:
CODE
org 100h
Now it is 118 bytes! Yeah.
I notice the largest size is 12 (turn to 25 rows), because you understand that the DOS terminal window is only 25 rows. It shows you pay attention to detail.
Again, nice one! (Mine is in C#, I am reluctant to do any algorithmic coding using Assembly)
I wasn't used to FASM. Was a TASM/MASM dude. Had to relearn a lot of things. Plenty of things I can do to optimize it further, but it was just a quick hack.
There was a few magic memory locations you'd need to know for asm in DOS: CS:80h is the len of the args, CS:81h onwards is the command line argument. 255 (Edit: 20h, not 100h) max chars, of course. 0B800h is the text mode buffer, etc.
This post has been edited by angch: Nov 21 2022, 07:59 PM