On Wed, Sep 14, 2022 at 6:24 AM Javier Gutiérrez Chamorro
<guti.bitacoras....@gmail.com> wrote:
>
> And now it is the turn of CLS (sorry Jim ;-) It reproduces the same
> CLS.C behaviour, including the redirection detection, but instead of
> a 9,080 bytes CLS.EXE it creates a 380 bytes CLS.COM.
>
> What I did not like about the original C implementation was the use
> of the non-portable clrscr() which is not available in OpenWatcom. So
> I guess that this ASM implementation would be also more portable.
>
> It is available at
> https://sourceforge.net/projects/nikkhokkho/files/CLS/


I don't mind. :-) I wrote that version of CLS long ago, back when I
wasn't sure if CLS should be an internal or external command. CLS is
now an internal command, so my original CLS is dead anyway.

With the original external CLS, I made an update that could also set
the text foreground and background colors, but I mainly did this
because rewriting CLS as an external command didn't make much sense if
all it did was clear the screen and reset the cursor. Changing the
colors justified (in my mind) making this an external "extended"
command. I think the usage was like "CLS white on blue" to set the
colors to 7,1 and "CLS bright white on blue" to set the colors to
15,1.

You are right, the original CLS external command used the clrscr()
function from Borland's conio library to clear the screen. I recall
the program detected if the user was on a console, and used clrscr()
to clear the screen - otherwise, it used an ANSI sequence to clear the
screen (such as a terminal). The equivalent console function in
OpenWatcom is _clearscreen(_GCLEARSCREEN) from graph.h. IA-16 GCC has
an i86 library that I believe implements clrscr() as well.

I'm curious: why does your CLS use "-h" for help instead of "/?"


_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to