
.sp .7i
.ps 10
.vs 11
.nf
\fL100 DEFINT J,K:DIM J(5)' Important - integer array only for SVC interface
200 CLS:PRINT TAB(25)"SVC Demonstration Menu"
210 PRINT:PRINT TAB(25)"1) Set Scroll Protect"
220 PRINT TAB(25)"2) Toggle Caps Lock"
230 PRINT TAB(25)"3) Show DOS Version"
240 PRINT TAB(25)"4) Check Drive Ready"
250 PRINT:PRINT TAB(25);:INPUT "Make a selection ";A$
260 IF A$ < "1" OR A$ > "4" THEN 200
270 A=VAL(A$):ON A GOSUB 1000,2000,3000,4000
280 GOTO 200
1000 CLS:PRINT"Set number of scroll protect lines 0-7"
1010 PRINT:PRINT"0 will cancel scroll protect ";:INPUT A
1020 IF A < 0 OR A > 7 THEN 1000
1030 J(3)=&H700 + A 'Register B=7, Register C=line count
1040 J(0)=15:X=USR11(VARPTR(J(0))) 'Execute @VDCTL SVC
1050 IF A=0 THEN RETURN
1060 FOR K=1 TO 100:PRINT K;"Testing scroll protect to 100":NEXT:RETURN
2000 CLS:J(0)=101:X=USR11(VARPTR(J(0))) ' @FLAGS SVC to get keyboard flag
2010 K=PEEK(J(4)+10)' Get KFLAG value
2020 POKE (J(4)+10), K XOR 32 'Toggle Caps lock bit
2030 INPUT"Type some characters to check Caps lock, press ENTER to end ";A$
2040 RETURN
3000 CLS:J(0)=101:X=USR11(VARPTR(J(0)))' Get flag table base, @FLAG SVC
3010 K=PEEK(J(4)+27)' Peek out version number, base+27
3020 K=K-(&H60)' Earliest version was 6.0, K will be 0 to 3
3030 PRINT "This is DOS version 6 .";K
3040 PRINT:INPUT"Press ENTER to return"; A$:RETURN
4000 CLS:INPUT"Enter drive # to check 0 to 7 ";K
4010 IF K < 0 OR K > 7 THEN RETURN
4020 J(3)=K' Set drive number for SVC
4030 J(0)=33:X=USR11(VARPTR(J(0)))' @CKDRV SVC
4040 PRINT:PRINT"Drive";K;"has ";
4050 IF (J(0) AND 64)=0 THEN PRINT"no disk mounted.":GOTO 4080
4060 PRINT"a disk mounted."
4070 IF (J(0) AND 1)=1 THEN PRINT"The drive is write protected."
4080 PRINT:INPUT"Press ENTER to return ";A$:RETURN\fR

.ps 12
.vs 12
.fi
This example program shows several methods of accessing information not
normally available from BASIC.  To make effective use of the SVC interface,
you will need to have the \fIModel 4 Technical Reference Manual\fR.

The @CKDRV routine (lines 4000-4080) shows how the return status of an SVC
can be checked.  The Z flag can be tested by doing an "AND 64" against the
array(0) position.  If the result is zero, the Z flag was NOT set.  The
CF (carry flag) can be tested in the same manner by doing an "AND 1".
Again, a zero result means the flag was not set.

The Caps lock and DOS Version subroutines show how information can be
referenced in the system flag area with the @FLAGS SVC.  There are several
other flags and system storage areas than can also be referenced off
of the flag table base.

Certain SVCs, such as @CMNDI, @CMNDR, or setting the high memory pointer
must NOT be done.  Generally speaking, anything that can be legally be
done from BASIC with @CMNDR can be done with the \fBSYSTEM "\fIcommand\fR"
statement, and should not be attempted through the SVC interface.

.sp 1.3i
.ce
Page 13
.bp
.sp .5i

.ps 16
.vs 17
New BASIC Cross Reference Utility
.ps 12
.vs 12

BREF/CMD is a cross reference utility for BASIC programs.  It is executed
at the \fLDOS Ready\fR prompt, not from inside of BASIC.  The BASIC program must
NOT have been saved in ASCII.  The syntax is:

        \fBBREF\fI filespec \fR[\fB(\fRparm,parm,...\fB)\fR]

Parameters are:

.nf
        \fBVAR=\fION\fR|\fIOFF\fR  -  Default is on
        \fBLINE=\fION\fR|\fIOFF\fR \^-  Default is off
        \fBP=\fION\fR|\fIOFF\fR      \|-  Default is off
        \fBW=\fIn\fR              \|-  Width for output to printer, Default is 80
.fi

The \fIfilespec\fR is the name of the BASIC program.  The \fBVAR\fR parameter allows
variables to be cross referenced.  The \fBLINE\fR parameter includes a cross
reference of line numbers.  The \fBP\fR parameter allows the listing to go to
a printer rather than the video.  The \fBW\fR parameter can be used to specify
the number of columns for the printer (generally either 80 or 132,
although any value between 32 to 255 will be accepted).

Variable names will be displayed up to 14 characters.  If the variable
is longer than this, the remaining characters will be truncated for
display.  BASIC stores certain keywords in ASCII, and this makes them
indistinguishable from a variable.  For example the "AS" used in
field statements.  This will cause these words to be displayed in a
variable cross reference list.

If there are more references than can be displayed on a single line, they
will wrap to the next line.  This line will have an asterisk in column one
to denote the overflow.

Examples

BREF PROG/BAS                       - Sends only variable references to the video.

BREF PROG/BAS (LINE,VAR=OFF) \|- Sends only line number references to the video.

BREF PROG/BAS (LINE,P,W=132) \|\^- Sends variables and line numbers to a 132
column printer.

Possible errors

There are three error messages that may be generated by BREF:

        \fLNot a BASIC program\fR

The general cause of this error is trying to use a program saved in ASCII,
a program saved in the protected mode, or a non-BASIC program file.

        \fLOut of memory - can't cross reference\fR

This will occur is the program is too large to fit into your available memory.
The cure is to change your configuration to free up some memory.

        \fLLine nnnn, Error in original program\fR

This message may occur if there is a syntax error in the original BASIC
program.  The line number should correspond to that line in the program.

.sp .5i
.ce
Page 14
.bp
.sp .5i

TECHNICAL INFORMATION CHANGES

Changes to directory structure

GAT - The disk type byte (GAT+CDH) now assigns bit 3 as the date type bit.
If this bit is set, the disk is assumed to use the new time/date fields.

DIR+2 - This byte continues to hold the day in bits 3-7 as documented for
earlier versions.  However, bits 0-2 should no longer be considered the
primary year field.  For compatibility with earlier versions, these bits
should remain untouched by the user as certain system routines will
modify this area.

DIR+18,19 - These two bytes are no longer assigned as the user password.
Instead, they contain the new style time/year information as follows:

.nf
        DIR+18 - bits 3-7 contain the hour.
                    bits 0-2 contain the most significant bits of the minute.
        DIR+19 - bits 5-7 contain the least significant bits of the minute.
                    bits 4-0 contain the year offset from 1980.
.fi

Changes to SVCs

@CKDRV - This SVC now adjusts the appropriate bit in the Y flag to reflect
GAT+CDH, bit 3 (the old or new style date bit) for the drive being accessed.

@FLAGS - The 'Y' flag byte has been assigned to mark the dating style of
a disk.  Bits 0 to 7 correspond to drives 0 to 7.  If the bit is set, the
drive is assumed to use the new style time/date information.  The setting
and resetting of this bit is handled by the @CKDRV SVC.  The operating
system version (flag table base+27) has been set to 63H.
The release number (flag table base-47) has been set to 00H.

@HEXD - NEW SVC, number 95.     (Similar to @HEXDEC SVC, number 97)

.nf
        Converts a binary number in HL to decimal ASCII.
        Entry conditions:
                A = 95 (X'5F')
                B = expected number of output digits
               HL = number to convert
               DE = pointer to buffer to hold converted number

        Exit conditions:  Success always.
               DE = pointer to end of buffer+1
               AF, BC, HL are affected by this SVC

.fi
This SVC is the same as @HEXDEC except that a 5 character buffer
is not required.  Instead, the B register should contain the
maximum number of output characters expected, and DE should
point to a buffer of at least that size.  If the conversion
exceeds this number of characters, the overflow will be placed
in memory below the buffer pointed to by DE.

@INIT - If a file is created with a password, the protection level will
now be set to NO.  This means that no future access will be given without
the use of the password.

@VDPRT - NEW SVC, number 107.  This SVC performs a screen print.  If the
printer is not ready, the SVC will abort in approximately 20 seconds.

.nf
        Entry conditions: A=107 (X'6B')
        Exit conditions: Success always.
                BC, DE, HL are changed.  No status is returned.
.fi

.sp .2i
.ce
Page 15
.bp
.sp .5i

.ps 16
.vs 17
.ce
SOFTWARE LICENSE AGREEMENT
.ps 12
.vs 12

The LS-DOS 6.3 software update provided by Logical Systems, Incorporated
(LSI) is intended only for legitimate owners of a TRSDOS 6.x operating
system.  By accepting this software license, the buyer expressly warrants
and represents that he is a legitimate owner of a TRSDOS 6.x operating system.

The LS-DOS 6.3 software update and documentation is copyrighted with all
rights reserved by Logical Systems Incorporated.  The buyer is granted
a license to use this software on one computer system, and may make copies
for personal use and archival purposes only.
Copying this software for sale or other distribution is expressly prohibited.

.ps 16
.vs 17
.ce
LIMITED WARRANTY
.ps 12
.vs 12

LSI warrants the diskette media on which the LS-DOS 6.3 is recorded to
be free from defects under normal use for a period of 30 days after the
date of original purchase.  If during this 30 day period a defect in the
diskette media should occur, you may return the diskette to LSI for
replacement without charge.

Except as provided for above, LSI makes no warranties, either expressed
or implted, with respect to this software or its fitness for any purpose.
LSI software is provided "as-is".  Should the software prove defective,
the buyer assumes the entire cost of all necessary servicing, repair,
or correction and any incidental or consequental damages.  LSI assumes
no liability for direct, indirect, incidental or consequental damages
resulting from any use of or any defects in the software.






.sp 4.8i
.ce
Page 16
 