;From rowan_crowe - OS detection
; Note- Rowan released the com file only, it was disassembled and re-posted.
;

.model tiny
.data
db 13,10," Use Shellchk.com to detect whether you're running under:"
db 13,10," DOS - errorlevel 0"
db 13,10," Desqview - errorlevel 1"
db 13,10," Windows,OS/2 - errorlevel 2"
db 13,10," Shellchk.com written by Rowan Crowe (3:635/727)"
.code
org             100h
start:
                mov     ax, 1680h
                int     2Fh             ; - Multiplex - MS WINDOWS -
                                   ; RELEASE CURRENT VIRTUAL MACHINE TIME-SLICE
                                   ; Return: AL = 00h if the call is supported
                                   ; AL = 80h (unchanged) if not supported
                or      al, al          ; Logical Inclusive OR
                jnz     loc_0_10E       ; Jump if Not Zero (ZF=0)
                mov     al, 2
                jmp     loc_0_11F       ; Jump
loc_0_10E:
                mov     ax, 2B01h
                mov     cx, 4445h
                mov     dx, 5351h
                int     21h             ; DOS - SET CURRENT DATE
                                        ; DL = day, DH = month, CX = year
                                        ; Return: AL = 00h if no error
                                        ; FFh if bad value sent to routine
                cmp     al, 0FFh        ; Compare Two Operands
                jz      loc_0_123       ; Jump if Zero (ZF=1)
                mov     al, 1

loc_0_11F:
                mov     ah, 4Ch
                int     21h             ; DOS - 2+ - QUIT WITH EXIT CODE
                                        ; AL = exit code

loc_0_123:
                xor     al, al          ; Logical Exclusive OR
                jmp     loc_0_11F       ; Jump

                end    start

