

NOVELL TECHNICAL INFORMATION DOCUMENT

DOCUMENT PROCESSING INFO:  THIS DOCUMENT REPLACES FYI-M-1115
TITLE:  Using SID instead of DEBUG to create UTILITY
DOCUMENT ID:  TID800040
DOCUMENT REVISION:  A
DATE:  16AUG94
AUTHOR:  KBANTA;CEREKSON
ALERT STATUS:  Yellow
DISTRIBUTION:  Public
INFORMATION TYPE:  Symptom Solution
README FOR:  NA
NOVELL PRODUCT CLASS:

Desktop Products

NOVELL PRODUCT and VERSION:

DR DOS 6.0

CATEGORY:

Kernel

ABSTRACT:

NA

-----------------------------------------------------------------
DISCLAIMER
THE ORIGIN OF THIS INFORMATION MAY BE INTERNAL OR EXTERNAL TO NOVELL. 
NOVELL MAKES EVERY EFFORT WITHIN ITS MEANS TO VERIFY THIS INFORMATION. 
HOWEVER, THE INFORMATION PROVIDED IN THIS DOCUMENT IS FOR YOUR INFORMATION
ONLY.  NOVELL MAKES NO EXPLICIT OR IMPLIED CLAIMS TO THE VALIDITY OF THIS
INFORMATION.
-----------------------------------------------------------------

SYMPTOM

NEED TO TRANSLATE DEBUG INSTRUCTIONS INTO SID

ISSUE/PROBLEM

Many publications and bulletin board services distribute scripts written
in DEBUG to create various utilities.  To make use of these scripts in DR
DOS the script must be generated in SID.

SOLUTION

Below is a generic listing of a typical DEBUG script and the steps that
are used to adjust it so that the DR DOS SID utility will produce the same
results.

Typically, DEBUG scripts follow this pattern: DEBUG first establishes the
name of the file.  The "A" command is used to start assembling the
instruction. DEBUG defaults to an offset of 100.  Then the instructions
for the utility itself are listed. Finally, using the "RCX" command DEBUG
is instructed as to how many bytes of information should be saved.

SID does not require the name of the file until the file is actually
saved. In SID, the "A100" command is the instruction that begins assembly

at offset 100. The instructions for the utility itself are listed next.
These instructions are the same under both DEBUG and SID.  When a file is
saved using SID, the beginning and ending addresses must be specified. The
beginning address is 100. The ending address is 100 + the number of bytes
to be saved minus 1 (In the example below, the ending address is
represented by the word END).

The arithmetic is in hexadecimal values, but it is possible to do the
calculations in SID using the "H" command.  (See the HEX NOTE below). The
last command is Quit. It is the same under both utilities.

GENERIC SCRIPT

DEBUG SCRIPT    SID SCRIPT              COMMENTS
-----------------------------------------------------------------
N filename.ext  (not required)         -SID uses file name when it is
saved.
A               A100        ---------+ -Begin assembling instructions.
(instructions   (instructions        | -Use the original commands.
go              go                   |
here)           here)                |
                                     |
<CR>            <CR>                 | -<CR> to exit assembling
RCX             (not required)       | -DEBUG is preparing to save y bytes
y               (not required)       |   of data. +----------------+
W               Wfilename.ext,100,END| -SID writes|from offset 100 to END
                                     |    ( 100 + y - 1 = END )
                                     |       |
                                     +-------+
Q               Q                       -And Quit.


Below is an example of a script that will build BEEP.COM, a program that
simply beeps the speaker once. Notice again that the arithmetic is in
hexadecimal. (Ifthat is something with which you are unfamiliar, see the
HEX NOTE at the end of this example.)


DEBUG SCRIPT    SID SCRIPT      COMMENTS
-----------------------------------------------------------------N
BEEP.COM
(not required)          SID saves file name at end
A               A100        --------+   Begin assembling instructions
MOV AH,2        MOV AH,2            |   Use the original commands
MOV DL,07       MOV DL,07           |
INT 21          INT 21              |
MOV AH,4C       MOV AH,4C           |
INT 21          INT 21              |
<CR>            <CR>                |   <CR> to exit assembling
RCX             (not required)      |   DEBUG is preparing to save 10 (A
Hex)
A               (not required)      |   of data.  +----------------+
W               WKEYD.COM,100,109   |   SID writes|from offset 100 to 109
Q               Q                   |     ( 100 + A - 1 = 109 )
                                    |        |
                                    +--------+

HEX NOTE:  SID can do the hex math for you. In the above example,  to do
the first addition ( 100 + A ), load SID and type


                H100 A

                SID will respond:

                + 010A   - 00F6   * 00000A00   / 0019 (0006)

The first value, 010A, is the sum. Use that value in the next command:

                H10A 1

                SID will respond:

                + 010B   - 0109   * 0000010A   / 010A (0000)

The second value, 0109, is the END value you want to use.

ADDITIONAL REFERENCES:  DR DOS 6 User Guide, Appendix D & FYI-M-1114

-----------------------------------------------------------------
Any trademarks referenced in this document are the property of their
respective owners.  Consult your product manuals for complete trademark
information.
-----------------------------------------------------------------
