Guti

14.09.2022, 09:11 |
VERIFY reimplementation (Announce) |
I am not sure if it could be useful for anyone, but I have just reimplemented VERIFY.COM by Peter Mikalajunas -1995- (https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/verify/) in pure assembler. It is not a big deal, but was a personal challenge. With this main .COM executable gets reduced from 5,444 bytes to just 653 bytes.
Also I noticed that "original" VERIFY was not compatible with the internal command, allowing only /ON or /OFF. My implementation works with ON and OFF, but also with 1 or 0.
Source code and binaries are available at: https://sourceforge.net/projects/nikkhokkho/files/VERIFY/
------------------------------------------------------
Javier Gutiérrez Chamorro
https://www.javiergutierrezchamorro.com --- Visit my personal blog at https://www.javiergutierrezchamorro.com |
rr

Berlin, Germany, 14.09.2022, 20:48
@ Guti
|
VERIFY reimplementation |
> I am not sure if it could be useful for anyone, but I have just
> reimplemented VERIFY.COM by Peter Mikalajunas -1995-
> (https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/verify/) in
> pure assembler. It is not a big deal, but was a personal challenge. With
> this main .COM executable gets reduced from 5,444 bytes to just 653 bytes.
>
> Also I noticed that "original" VERIFY was not compatible with the internal
> command, allowing only /ON or /OFF. My implementation works with ON and
> OFF, but also with 1 or 0.
>
> Source code and binaries are available at:
> https://sourceforge.net/projects/nikkhokkho/files/VERIFY/
Thanks for sharing!
I gave it a try and would like to give some feedback:
1. I recommended to add CRLF after ON/OFF, because that is what people expect. Might be not relevant for output on screen, but when redirected to a (log) file or for further processing.
2. Also (for redirected output) I recommend to always use CRLFCRLF, not just CRLFLF. Some text editors are other tools might be confused otherwise.
3. A source code comment reading "Show status" for a function called "ShowStatus" is simply a waste of space and time.
4. Naming a function "DoIt" is bad style. Do WHAT? "It" could mean "print the help screen", "exit the program", "calculate something", or whatever.
5. Your source code uses a mixture of tabs and spaces for indenting, e.g., in ShowStatus. I recommend to enable showing whitespace and control characters in your text editor and clear up the mix. I came across this just yesterday: Why does Zig force me to use spaces instead of tabs?. Maybe it helps you do decide.
6. Trailing whitespace, e.g., in lines 52 and 63, should be removed too.
7. Not sure about the ".stack 64" line, because I don't use MASM-style assemblers, but at least on execution it's meaningless, because .COM files don't have a header for such information.
8. Also not sure about your command-line parsing. There might be situations, where options are preceded by whitespace (spaces, tabs, ...). I recommend to create a loop for skipping those.
HTH, but feel free to ignore me!  --- Forum admin |
glennmcc

North Jackson, Ohio (USA), 14.09.2022, 21:26
@ Guti
|
VERIFY reimplementation |
> I am not sure if it could be useful for anyone, but I have just
> reimplemented VERIFY.COM by Peter Mikalajunas -1995-
> (https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/verify/) in
> pure assembler. It is not a big deal, but was a personal challenge. With
> this main .COM executable gets reduced from 5,444 bytes to just 653 bytes.
>
> Also I noticed that "original" VERIFY was not compatible with the internal
> command, allowing only /ON or /OFF. My implementation works with ON and
> OFF, but also with 1 or 0.
>
> Source code and binaries are available at:
> https://sourceforge.net/projects/nikkhokkho/files/VERIFY/
>
>
> ------------------------------------------------------
> Javier Gutiérrez Chamorro
> https://www.javiergutierrezchamorro.com
Q: Does your implementation verify source/destination byte-for-byte
or simply source/destination being of equal filesize ? --- --
http://glennmcc.org/ |
rr

Berlin, Germany, 14.09.2022, 22:00
@ glennmcc
|
VERIFY reimplementation |
> Q: Does your implementation verify source/destination byte-for-byte
> or simply source/destination being of equal filesize ?
It doesn't verify anything at all. It just sets/reads the verify flag for the DOS kernel. --- Forum admin |
glennmcc

North Jackson, Ohio (USA), 14.09.2022, 22:21
@ rr
|
VERIFY reimplementation |
> > Q: Does your implementation verify source/destination byte-for-byte
> > or simply source/destination being of equal filesize ?
>
> It doesn't verify anything at all. It just sets/reads the verify flag for
> the DOS kernel.
DUH... now I get it.  --- --
http://glennmcc.org/ |
Guti

15.09.2022, 06:28
@ rr
|
VERIFY reimplementation |
> > I am not sure if it could be useful for anyone, but I have just
> > reimplemented VERIFY.COM by Peter Mikalajunas -1995-
> > (https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/verify/)
> in
> > pure assembler. It is not a big deal, but was a personal challenge. With
> > this main .COM executable gets reduced from 5,444 bytes to just 653
> bytes.
> >
> > Also I noticed that "original" VERIFY was not compatible with the
> internal
> > command, allowing only /ON or /OFF. My implementation works with ON and
> > OFF, but also with 1 or 0.
> >
> > Source code and binaries are available at:
> > https://sourceforge.net/projects/nikkhokkho/files/VERIFY/
>
> Thanks for sharing!
>
> I gave it a try and would like to give some feedback:
> 1. I recommended to add CRLF after ON/OFF, because that is what people
> expect. Might be not relevant for output on screen, but when redirected to
> a (log) file or for further processing.
> 2. Also (for redirected output) I recommend to always use CRLFCRLF,
> not just CRLFLF. Some text editors are other tools might be confused
> otherwise.
> 3. A source code comment reading "Show status" for a function called
> "ShowStatus" is simply a waste of space and time.
> 4. Naming a function "DoIt" is bad style. Do WHAT? "It" could mean "print
> the help screen", "exit the program", "calculate something", or whatever.
> 5. Your source code uses a mixture of tabs and spaces for indenting, e.g.,
> in ShowStatus. I recommend to enable showing whitespace and control
> characters in your text editor and clear up the mix. I came across this
> just yesterday:
> Why
> does Zig force me to use spaces instead of tabs?. Maybe it helps you
> do decide.
> 6. Trailing whitespace, e.g., in lines 52 and 63, should be removed too.
> 7. Not sure about the ".stack 64" line, because I don't use MASM-style
> assemblers, but at least on execution it's meaningless, because .COM files
> don't have a header for such information.
> 8. Also not sure about your command-line parsing. There might be
> situations, where options are preceded by whitespace (spaces, tabs, ...). I
> recommend to create a loop for skipping those.
>
> HTH, but feel free to ignore me! 
Thank you for your suggestions. Being honest, all of them makes sense. --- Visit my personal blog at https://www.javiergutierrezchamorro.com |
Guti

15.09.2022, 06:29
@ glennmcc
|
VERIFY reimplementation |
> > I am not sure if it could be useful for anyone, but I have just
> > reimplemented VERIFY.COM by Peter Mikalajunas -1995-
> > (https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/verify/)
> in
> > pure assembler. It is not a big deal, but was a personal challenge. With
> > this main .COM executable gets reduced from 5,444 bytes to just 653
> bytes.
> >
> > Also I noticed that "original" VERIFY was not compatible with the
> internal
> > command, allowing only /ON or /OFF. My implementation works with ON and
> > OFF, but also with 1 or 0.
> >
> > Source code and binaries are available at:
> > https://sourceforge.net/projects/nikkhokkho/files/VERIFY/
> >
> >
> > ------------------------------------------------------
> > Javier Gutiérrez Chamorro
> > https://www.javiergutierrezchamorro.com
>
> Q: Does your implementation verify source/destination byte-for-byte
> or simply source/destination being of equal filesize ?
It simply enables DOS verification flag. Is at the level of the driver to do the verification itself. --- Visit my personal blog at https://www.javiergutierrezchamorro.com |