On Wed, 14 Sep 2022, Bitácora de Javier Gutiérrez Chamorro (Guti) wrote:

Dear Jim,   There is no practical purpose on my mind, just the challenge of rapidly and efficiently convert it. As you said, both CLS and VERIFY are internal commands.

What surprised me about your ANSI fallback is that DOSBox, MS-DOS and DR-DOS already work it that way, but not the command console in Windows 11. It seems that with time we are losing capabilities instead of gaining.

In fact any argument passed to CLS will trigger the help screen no matter if it is -h, /? or whatever. It was simply silly to check for it, since CLS should not expect any argument. BTW, your implementation does the same, checking argc > 1 which is smart too.

At least in your 2.01 and 2.1 versions there is no possibility of changing colors, maybe they were lost in previous versions. But as you said, this does not matter, just a curiosity.   Kind regards.

I myself only implemented cls at the same level as MS-DOS, and the most basic cls looks something like this (NASM):

; Copyright 2001, 2002, 2003, 2022 S. V. Nickolas.
;
; Redistribution in whole or in part, with or without modification, is
; hereby permitted without restriction.  This software is provided "as is"
; and all warranties, express or implied, are hereby disclaimed.

          cpu       8086
          org       0x0100
entry:    mov       ax, 0x4400
          mov       bx, 1               ; stdout
          int       0x21
          jc        .2
          test      dx, 0x0010          ; is CON:
          jz        .2
          mov       byte [maxrow], 24
          mov       ah, 0x12            ; do we have an EGA?
          mov       bx, 0xFF10
          mov       cx, 0xFFFF
          int       0x10
          cmp       cx, 0xFFFF          ; unchanged = MDA or CGA
          je        .1                  ;   = always 25 lines
          mov       ax, 0x0040          ; otherwise, lines-1 is stored at
          push      es                  ;   0040:0084
          mov       es, ax
          mov       ah, [es:0x0084]
          pop       es
          mov       [maxrow], ah
.1:       mov       ah, 0x0F            ; this, OTOH, works on anything
          int       0x10
          dec       ah
          mov       [maxcol], ah
          mov       ax, 0x0600          ; method used by MS-DOS COMMAND.COM
          mov       bh, 0x07
          xor       cx, cx
          mov       dx, [maxcol]        ; pulls in maxrow also
          push      bp                  ; BUG WORKAROUND
          int       0x10
          pop       bp
          xor       dx, dx
          mov       ah, 0x02
          xor       bh, bh
          int       0x10
          jmp short .3
.2:       mov       dx, eansi
          mov       ah, 0x09
          int       0x21
.3:       mov       ax, 0x4C00
          int       0x21                ; EXIT CODE 0

maxcol:   db        79                  ; Must be in this order
maxrow:   db        24

eansi:    db        27, "[2J$"
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to