

                  .TITLE   "UNDRLINE.COM"



;       ****  THIS PROGRAM ONLY FOR THE MASTER  ****
;                          ----


;         ENABLE UNDERSCORING FOR THE WANG PRINTER
;               BY DELETING THE "BIT-8" MASK

;               WARN THE USER TO RE-PATCH IT
;                        AFTERWARDS



;                     LISTING CONTROLS:


                            .PABS
                            .PHEX
                            .XSYM

                            .RADIX   16
                            .LADDR


;                       VERSION SELECTOR:


		RELEASE.70  =\  '
			Enter 0 for Release 7.0
			      1 for Release 6.2

				  Version'


;			   CONSTANTS:


		   WARM.BOOT      ==    00000
		   BDOS           ==    00005

                       .IFE   RELEASE.70,              [

                   TRUE.BDOS      ==    0A606
                   FAKE.BDOS      ==    09C06
                   BDOS.REFRESH   ==    0B677
                   MASK.BYTE      ==    09C12
                                                      ] [
                   TRUE.BDOS	  ==    0A706
		   FAKE.BDOS      ==    09E06
                   BDOS.REFRESH   ==    0B774
		   MASK.BYTE      ==    09E12
                                                       ]

                   CRET		  ==	0D
                   LFEED	  ==	0A
                   HOME		  ==	0C
                   BEEP		  ==	07
                   SPACE	  ==	20
                   NULL		  ==	00
                   ZERO		  ==	00
                   CLEAR	  ==	00
                   SET		  ==	0FF



                         .LOC   0100


BEGIN:

                         JMP   START


PROG.ID:

		  .ASCII  ' UNDRLINE.COM'

                       .IFE   RELEASE.70,         [

		  .ASCII  'Version:   2.00a'
                                                 ] [
		  .ASCII  'Version:   1.00a'
                                                  ]
		  .ASCII  'Date:   04/26/90'


;           EXECUTE ONLY IF WANG PATCH INSTALLED:

START:

;             ***********************************
;             DISTINGUISH BETWEEN UN-PATCHED BDOS
;              AND NON-MASTER  EXECUTIVE MACHINE
;             ***********************************

	LHLD	BDOS.REFRESH
	LXI	D, TRUE.BDOS
	XRA	A
	DSBC	D
	JRZ	REFUSE

	LHLD	BDOS.REFRESH
	LXI	D, FAKE.BDOS
	XRA	A
	DSBC	D
	JRZ	DO

	LXI	D, NOT.MASTER
	MVI	C, 9
	CALL	BDOS	

	JMPR	EXIT

DO:

	MVI	A, 0FFh
	STA	MASK.BYTE

	LXI	D, DONE
	MVI	C, 9
	CALL	BDOS

	JMPR	EXIT

REFUSE:

	LXI	D, NO.WAY
	MVI	C, 9
	CALL	BDOS

EXIT:

	RET



;                          MESSAGES:
;                          --------


DONE:

	.BYTE	CRET, LFEED
	.ASCII	'                       ** UNDRLINE.COM **'
	.BYTE	CRET,LFEED
	.BYTE	LFEED

                                .IFE   RELEASE.70,                   [

	.ASCII	'               Version  2.00a    for Release 7.0'
                                                                    ] [
	.ASCII	'               Version  1.00b    for Release 6.2'
                                                                     ]

	.BYTE	CRET, LFEED
	.BYTE	LFEED
	.ASCII	'                      Underscore  Enabled'
	.BYTE	CRET, LFEED
	.BYTE	LFEED
	.ASCII	'             Reset The Printer When Job Is Finished'
	.BYTE	CRET, LFEED
	.ASCII	'                       ("WANG"  Command)'
	.BYTE	CRET, LFEED
	.BYTE	LFEED

                          .BYTE   '$'


NOT.MASTER:

	.BYTE	CRET, LFEED
	.ASCII	'                     This Program Executes'
	.BYTE	CRET, LFEED
	.ASCII	'                      On The  MASTER Only'
	.BYTE	BEEP
	.BYTE	CRET, LFEED
	.BYTE	LFEED

                          .BYTE   '$'


NO.WAY:

	.BYTE	CRET, LFEED
	.ASCII	'                    WANG Patch Not Installed'
	.BYTE	CRET, LFEED
	.ASCII	'                           Forget It!'
	.BYTE	CRET, LFEED
	.BYTE	LFEED

                          .BYTE   '$'



;                       END OF PROGRAM:
;                       --- -- -------


LAST:

                         .END   BEGIN

