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)