;======================================================
;Code that determines whether a command line
;was present or not.  Have a look and see how it works
;The program segment prefix (PSP) contains information
;about the program  including the number or characters
;in the command tail at 80h and the command tail
;which begins at 81h and is 127 bytes long.
 bompile into a .COM file
;======================================================
.MODEL TINY
.8086
.CODE
.STARTUP

START:

	xor cx, cx			; cx = 0
	mov cl, byte ptr es:[80h]	; Get length of command tail from PSP
                                        ; MASM sets ES to point to PSP
        cmp cl, 0
        je nocmln                       ; There isn't a command line - exit! 
                                        ; Knows where the end is. 
        mov ah, 9  
        mov dx, offset Hello  
        int 21h                         ; Print the string 
	mov	ah,4ch
	int	21h

	nocmln:
	mov	ah,9
	mov	dx,offset NOC
	int	21h

	mov	ah,4ch
	int	21h


Hello	db	'Command line detected',0ah,0dh,24h
NOC	DB	'No command line detected',0ah,0dh,24h


END		       ; Set end of program

 
