Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: CMD fun  (Read 114974 times)

0 Members and 1 Guest are viewing this topic.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: CMD fun
« Reply #45 on: March 26, 2016, 09:58:28 AM »
Weren't the MS-DOS utilities as well as COMMAND.COM written in assembler?

The page linked says up to MSDOS V1.xx

My impression is that the later versions weren't.  3.3 and onward is what I had experience with.

Salmon Trout

  • Guest
Re: CMD fun
« Reply #46 on: March 26, 2016, 10:19:09 AM »
Right up to and including version 6, MS-DOS was written in 8086 assembler. If you look at the source (which is around on the web) you can read modification histories in the various modules starting in 1983 and ending in 1992

A little bit of the source for one of the modules of MS-DOS 6

;*  Compare names
        mov     si,dx                   ; ds:si -> guest name
        mov     cx,bx                   ; Length of guest name
        repe    cmpsb                   ; Do names match?
        jz      fglx                    ;   YES, return success

;*  Now we either ran past the end of the string in the list, or we are not
;   at the end, but found a difference.  We back up one character, since
;   repe cmpsb advanced one character past the difference, and then scan
;   the string in the list to find its end.

        dec     di                      ; es:di -> character that did not match
        mov     cx,-1                   ; Make sure we look far enough ahead
        repne   scasb                   ; Find tail of name in list

;*  Now es:[di] is first character of the next name in the list (or 00)

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: CMD fun
« Reply #47 on: March 26, 2016, 10:42:40 AM »
The page linked says up to MSDOS V1.xx

My impression is that the later versions weren't.  3.3 and onward is what I had experience with.

The only version reference I can find on those pages is the one describing when Patterson was responsible for the program. "Tim Paterson, wrote the first versions -- up through MS-DOS 1.25".

MS-DOS Version 2.0 was written primarily in Assembly. Microsoft made the source available (alongside Word for Windows 1.1) to an online museum and it is available for download there.


MS-DOS 3.0 was released less then a year after 2.1, and it seems unlikely that it was rewritten in another language in that time frame. Rewriting it would have been detrimental anyway. Aside from the additional time needed to do so, there wouldn't be much of a benefit. Obviously those working with it already knew Assembly and compilers had not yet advanced beyond the performance of skilled assembly programmers, so at the time hand-written assembly was usually much faster and smaller than the output from any compiler. (And continued to be well into the 90's, even) The only change visible in the product would be much larger files and much slower execution; not really bullet points to put on the box. Later tools added in later versions might have been written in C; but the core OS and external commands very likely remained written in Assembly throughout the software's lifespan.

(I've been Ninja'd, oh well)

I was trying to dereference Null Pointers before it was cool.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: CMD fun
« Reply #48 on: March 26, 2016, 12:01:10 PM »
I see your points that a re-write into another language would surely break a spitload of stuff, and my impression is clearly wrong.


It's interesting to note the growth of command.com in size over the years.

Code: [Select]
COMMAND.COM    18,016    01/01/1980 01:10  V2.11
COMMAND.COM    25,276    23/07/1987 23:00  V3.3
COMMAND.COM    47,845    09/04/1991 04:00  V5.0
COMMAND.COM    52,925    10/03/1993 06:00  V6.0
COMMAND.COM    54,619    30/09/1993 05:20  V6.2
COMMAND.COM    54,645    31/05/1994 15:22  V6.22




DaveLembke



    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: CMD fun
« Reply #49 on: March 26, 2016, 03:32:46 PM »
COMMAND.COM    18,016    01/01/1980 01:10  V2.11
COMMAND.COM    25,276    23/07/1987 23:00  V3.3
COMMAND.COM    47,845    09/04/1991 04:00  V5.0
COMMAND.COM    52,925    10/03/1993 06:00  V6.0
COMMAND.COM    54,619    30/09/1993 05:20  V6.2
COMMAND.COM    54,645    31/05/1994 15:22  V6.22



DOS 2.11 with a date year of 1980 stood out as wrong... I started with DOS for IBM compatible computers in 1984 and GW-Basic I had so much fun with at school.

https://en.wikipedia.org/wiki/Timeline_of_DOS_operating_systems

Salmon Trout

  • Guest
Re: CMD fun
« Reply #50 on: March 26, 2016, 05:47:28 PM »
COMMAND.COM    18,016    01/01/1980 01:10  V2.11
DOS 2.11 with a date year of 1980 stood out as wrong...
Microsoft didn't even buy 86-DOS until December 1980. The date & time 01/01/1980 00:00 represents the start of time for the MS-DOS epoch/date system however. Files get this time stamp when they are corrupted or not fully copied. 86-DOS was about 4,000 lines of assembler code, written in 6 weeks, allegedly, by Tim Paterson.



foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: CMD fun
« Reply #51 on: March 26, 2016, 07:04:44 PM »
Microsoft didn't even buy 86-DOS until December 1980. The date & time 01/01/1980 00:00 represents the start of time for the MS-DOS epoch/date system however. Files get this time stamp when they are corrupted or not fully copied.

True, or if the system time and date wasn't set the timestamps can be nuked.


BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: CMD fun
« Reply #52 on: March 26, 2016, 08:34:03 PM »
I get a date of 10/20/83 for MS-DOS 2.1
I was trying to dereference Null Pointers before it was cool.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: CMD fun
« Reply #53 on: March 28, 2016, 04:47:07 AM »
A little bit of the source for one of the modules of MS-DOS 6

;*  Compare names
        mov     si,dx                   ; ds:si -> guest name
        mov     cx,bx                   ; Length of guest name
        repe    cmpsb                   ; Do names match?
        jz      fglx                    ;   YES, return success



Thank you kindly!

Your post was clear too, with the source code, that it's assembler in MSDOS.   Windows 10 would run well on a 486 if they had continued that style. ;)

Cheers

pm's are broken