Overview of DOS Command Line by hft13158

VIEWS: 0 PAGES: 11

									1                                debug.exe        Microprocessors I   2                                            debug.exe                        Microprocessors I




                                                                                                     DOS Command Line
                                                                      Text-oriented window
                                                                      In windows, click
                                                                          Start —> Programs —> Accessories —> Command Prompt

              Overview of DOS
                                                                      Provides prompt — typically as drive-letter:\directory>
                                                                      Accepts commands typed in keyboard
                                                                                    Internal DOS commands
               Command Line                                                           Perform system calls to DOS kernel
                                                                                    Program name
                                                                              Calls on DOS loader to run program
                                                                      Up to 127 characters in command line

                                                                      Example
                                                                                    C:\>dir /on /l /s

Spring 2009                    Hadassah College    Dr. Martin Land    Spring 2009                                Hadassah College                    Dr. Martin Land




3                                debug.exe        Microprocessors I   4                                            debug.exe                        Microprocessors I




                           Redirection                                                            Command Line Services
Standard Input (stdin)                                                ATTRIB          Displays or changes file attributes.
                                                                      CD              Displays the name of or changes the current directory.
   Source of character input                                          CLS             Clears the screen.

   Usually keyboard
                                                                      COMP            Compares the contents of two files or sets of files.
                                                                      COPY            Copies one or more files to another location.
Standard Output (stdout)                                              DATE            Displays or sets the date.
                                                                      DEL             Deletes one or more files.
    Destination for display output                                    DIR             Displays a list of files and subdirectories in a directory.
    Usually screen                                                    ECHO            Displays messages, or turns command echoing on or off.
                                                                      EXIT            Quits the CMD.EXE program (command interpreter).
Use < and > character to change stdin / stdout                        FIND            Searches for a text string in a file or files.
Example                                                               FORMAT          Formats a disk for use with Windows.
                                                                      HELP            Provides Help information for Windows commands.
   C:\>debug < script.src > list.txt                                  MD              Creates a directory.
   Runs debug                                                         MORE            Displays output one screen at a time.
                                                                      PATH            Displays or sets a search path for executable files.
   Reads instructions from file script.src                            RD              Removes a directory.
   Writes output into file list.txt                                   REN
                                                                      SET
                                                                                      Renames a file or files.
                                                                                      Displays, sets, or removes Windows environment variables.
                                                                      TIME            Displays or sets the system time.
                                                                      TYPE            Displays the contents of a text file.


Spring 2009                    Hadassah College    Dr. Martin Land    Spring 2009                                Hadassah College                    Dr. Martin Land
5                                 debug.exe                      Microprocessors I     6                                         debug.exe               Microprocessors I




                            Batch Files                                                                      Batch File with Control Structure
Collection of DOS commands in a file called *.bat                                      File: which.bat
    DOS executes commands in order                                                                   @echo off
    Permits replacement of variables %1, %2, … by input parameters                                   for %%q in (%path%) do if exist %%q\%1.* dir %%q\%1.*
Example
    File: move.bat                                                                     echo On                 display commands before executing
         md %2                                                                         echo Off                no display of commands before executing
         copy %1\*.* %2
                                                                                       @                       no display of this command
         del %1\*.*
         rd %1
                                                                                       for %%q in (%path%)
    Run: c:\>move dir1 dir2
                                                                                          Evaluate expression in ()
         Assigns %1 = dir1
         Assigns %2 = dir2                                                                Parse expression into terms separated by spaces
         Creates dir2                                                                     Loop through terms assigning each term to q
         Copies all files from dir1 to dir2                                            do execute command block
         Deletes all files in dir1                                                     if test condition
         Deletes dir1
Spring 2009                     Hadassah College                     Dr. Martin Land   Spring 2009                             Hadassah College           Dr. Martin Land




7                                 debug.exe                      Microprocessors I     8                                         debug.exe               Microprocessors I




                      Running Batch File                                                                              DOS System Calls
F:\>which scandisk
Directory of c:\WINDOWS\COMMAND                                                        DOS Operating System services:
08/16/1999     10:22p            143,818 SCANDISK.EXE                                                   Disk and file system management
08/06/1999     10:22p              7,329 SCANDISK.INI
07/28/2001     07:37a            650,208 SCANDISK.ALT
                                                                                                        Screen display and printing
                  3 File(s)       801,355 bytes                                                         Keyboard entry
                  0 Dir(s) 12,873,023,488 bytes free
                                                                                                        Other I/O management
    Directory of c:\DOS
                                                                                                        Date and time
05/11/1999     01:18p            134,738 SCANDISK.EX~
                                                                                                        Program run and terminate
09/17/1994     09:13a                152 SCANDISK.BAT
                  2 File(s)       134,890 bytes                                                         Command arguments
                  0 Dir(s) 12,873,023,488 bytes free

Spring 2009                     Hadassah College                     Dr. Martin Land   Spring 2009                             Hadassah College           Dr. Martin Land
9                               debug.exe                                Microprocessors I   10                                debug.exe        Microprocessors I




              DOS System Calls in Assembly Programs
System call
   Standard function to perform standard service
   Function written in 8086 instructions
   Services are complex and detailed ⇒ functions are long                                                          Overview of
; code segment
Access memory locations                          ;   8086 instructions
                                                                                                                  DEBUG.EXE
                                                                                                                 for the IBM PC
Access register locations                        ;   8086 instructions
ALU operations                                   ;   8086 instructions
Read data from disk file                         ;   DOS system call
Write data to disk file                          ;   DOS system call
Read data from keyboard                          ;   DOS system call
Display data on screen                           ;   DOS system call
Finish execution                                 ;   DOS system call


Spring 2009                   Hadassah College                            Dr. Martin Land    Spring 2009                     Hadassah College    Dr. Martin Land




11                              debug.exe                                Microprocessors I   12                                debug.exe        Microprocessors I




                     Features of debug.exe                                                                          Starting/Stopping DEBUG
Examine and change 8086 registers                                                            Start at DOS command prompt
Examine and change 8086 memory and I/O space                                                    C:\>debug <ENTER>

Write and assemble assembly language code
                                                                                             Open a file with DEBUG
Disassemble, display, and change machine code                                                  C:\>debug clock.com <ENTER>
Run and debug programs                                                                       Or
Store .com programs (cannot create .exe header)                                                            C:\>debug <ENTER>
                                                                                                              -n clock.com   ; sets filename
.exe file contains header with starting values for                                                            -l             ; loads file
   CS, IP, SS, SP
.com programs have CS = DS = SS = ES                                                         DEBUG prompt is hyphen (-)
   and starting IP = 0100                                                                    -q <ENTER> quits
Spring 2009                   Hadassah College                            Dr. Martin Land    Spring 2009                     Hadassah College    Dr. Martin Land
13                                                debug.exe                                   Microprocessors I   14                                debug.exe                          Microprocessors I




                                             Load                                                                                         Display Registers
For .COM and .EXE files                                                                                           -r <ENTER>
              Program is loaded and registers are set                                                             Displays registers and instruction pointed to by CS:IP
              CS:IP set to the first instruction in the program
              Example
                 -n clock.com
                                                                                                                  AX=0000 BX=0000    CX=0446 DX=0000 SP=FFFE         BP=0000 SI=0000 DI=0000
                 -l                                                                                               DS=6897 ES=6897    SS=6897 CS=6897 IP=0100          NV UP DI PL NZ NA PE NC
                                                                                                                  6897:0100 E96B01         JMP    026E
                     Load clock.com into memory
                     Set IP to the entry point of 0100
                     CX contains 0446 (size of program file)
       Program ready to run
Can also load absolute sectors from disk

Spring 2009                                   Hadassah College                                 Dr. Martin Land    Spring 2009                     Hadassah College                      Dr. Martin Land




15                                                debug.exe                                   Microprocessors I   16                                debug.exe                          Microprocessors I




                                         Flag Codes                                                                                     Changing a Register
CX opens with length of loaded file                                                                               Enter r and the register name
If file size > 64K, BX contains high order                                                                        Debug responds with register name and contents
                                                                                                                  : is prompt for entering new contents
                 OF           DF          IF            SF            ZF     AF     PF       CF
              Overflow    Direction   Interrupt        Sign          Zero   Aux   Parity   Carry
                 NV           UP          DI            PL            NZ     NA     PE       NC
                 OV           DN          EI            NG            ZR     AX     PO       CY                   -r AX <ENTER>
          NV     =   No Overflow                       OV        =   Overflow
                                                                                                                  AX 0000
          UP     =   Direction Up                      DN        =   Direction Down                               : 1234 <ENTER>
          DI     =   Disable Interrupt                 EI        =   Enable Interrupt                             -
          PL     =   Plus (non-negative)               NG        =   Negative
          NZ     =   Non-zero                          ZR        =   Zero
          NA     =   No Auxiliary Carry                AX        =   Auxiliary Carry
          PE     =   Even Parity                       PO        =   Odd Parity
          NC     =   No Carry                          CY        =   Carry




Spring 2009                                   Hadassah College                                 Dr. Martin Land    Spring 2009                     Hadassah College                      Dr. Martin Land
17                                        debug.exe                   Microprocessors I   18                                                       debug.exe                                         Microprocessors I




                        Display (Dump) Memory Data                                                                                    Dump Example
Display areas of storage
                                                                                          -d
-d <ENTER>                                                                                0BE3:0100     96   B4   40   CD   21   1F   BA   D4-89    73      03    E9   4E   FF   2B   C8   ..@.!....s..N.+.
                                                                                          0BE3:0110     74   D0   F6   06   61   98   80   74-39    F6      06    61   34   00   D2   0B   t...a..t9..a4...
Defaults                                                                                  0BE3:0120
                                                                                          0BE3:0130
                                                                                                        80
                                                                                                        D2
                                                                                                             3E
                                                                                                             87
                                                                                                                  1E
                                                                                                                  D1
                                                                                                                       99
                                                                                                                       B8
                                                                                                                            00
                                                                                                                            01
                                                                                                                                 75
                                                                                                                                 42
                                                                                                                                      BB
                                                                                                                                      CD
                                                                                                                                           49-74
                                                                                                                                           21-A3
                                                                                                                                                    B8
                                                                                                                                                    2B
                                                                                                                                                            BA
                                                                                                                                                            99
                                                                                                                                                                  57
                                                                                                                                                                  89
                                                                                                                                                                       8B
                                                                                                                                                                       16
                                                                                                                                                                            EB
                                                                                                                                                                            2D
                                                                                                                                                                                 23
                                                                                                                                                                                 99
                                                                                                                                                                                      33
                                                                                                                                                                                      80
                                                                                                                                                                                           .>...u.It..W..#3
                                                                                                                                                                                           .....B.!.+...-..
   Starts at DS:00                                                                        0BE3:0140
                                                                                          0BE3:0150
                                                                                                        3E
                                                                                                        1A
                                                                                                             11
                                                                                                             C3
                                                                                                                  96
                                                                                                                  E8
                                                                                                                       00
                                                                                                                       CE
                                                                                                                            74
                                                                                                                            0F
                                                                                                                                 9C
                                                                                                                                 FE
                                                                                                                                      B4
                                                                                                                                      06
                                                                                                                                           40-CD
                                                                                                                                           1E-96
                                                                                                                                                    21
                                                                                                                                                    80
                                                                                                                                                            72
                                                                                                                                                            3E
                                                                                                                                                                  5F
                                                                                                                                                                  1D
                                                                                                                                                                       C6
                                                                                                                                                                       96
                                                                                                                                                                            06
                                                                                                                                                                            00
                                                                                                                                                                                 2F
                                                                                                                                                                                 74
                                                                                                                                                                                      99
                                                                                                                                                                                      48
                                                                                                                                                                                           >...t..@.!r_../.
                                                                                                                                                                                           ..........>...tH
   Shows 80h (128) bytes (8 lines of 16 bytes)                                            0BE3:0160
                                                                                          0BE3:0170
                                                                                                        8B
                                                                                                        99
                                                                                                             1E
                                                                                                             8B
                                                                                                                  5F
                                                                                                                  C1
                                                                                                                       98
                                                                                                                       0B
                                                                                                                            83
                                                                                                                            C2
                                                                                                                                 FB
                                                                                                                                 74
                                                                                                                                      00
                                                                                                                                      21
                                                                                                                                           7E-33
                                                                                                                                           B8-00
                                                                                                                                                    8B
                                                                                                                                                    42
                                                                                                                                                            0E
                                                                                                                                                            CD
                                                                                                                                                                  2D
                                                                                                                                                                  21
                                                                                                                                                                       99
                                                                                                                                                                       33
                                                                                                                                                                            8B
                                                                                                                                                                            C9
                                                                                                                                                                                 16
                                                                                                                                                                                 B4
                                                                                                                                                                                      2B
                                                                                                                                                                                      40
                                                                                                                                                                                           .._....~3..-...+
                                                                                                                                                                                           .....t!..B.!3..@

   Repeating d shows the next 8 lines
                                                                                          -


              If byte is ASCII text character, it is shown at right




Spring 2009                             Hadassah College               Dr. Martin Land    Spring 2009                                          Hadassah College                                       Dr. Martin Land




19                                        debug.exe                   Microprocessors I   20                                                       debug.exe                                         Microprocessors I




                               Full Dump Syntax                                                                    Enter Data (Display/Modify)
-d start l length <ENTER>                                                                 Syntax: -e address <ENTER>
                                                                                          Displays current byte (default DS)
start can be                                                                              Enter hex byte <space> to modify
   seg:offset                                                                             Enter <space> moves without modifying
   offset (within current DS)                                                             Hyphen (-) backs up one byte

l (small letter L) indicates length specifier
                                                                                           -e 0
                                                                                           0BE3:0000                        23.af                      20.43                      FF.21
length can be
                                                                                           -e0
   1 to FFFF                                                                               0BE3:0000                        AF.                        43.                        21.
   0 is 10000h                                                                             -

Spring 2009                             Hadassah College               Dr. Martin Land    Spring 2009                                          Hadassah College                                       Dr. Martin Land
21                             debug.exe                Microprocessors I   22                           debug.exe                        Microprocessors I




                 Enter Data (Replace)                                                             Unassemble
Syntax                                                                      Takes machine code and shows it as instructions
   -e address data <ENTER>                                                  Syntax
   Data can be                                                                 -u start l length <ENTER>
      HEX bytes                                                                Default segment is CS
      Quoted strings                                                        Example
      Separated by spaces
Example                                                                      -u 26E
   'My name' followed by a hexadecimal 00 starting at                        6897:026E    8D167802                        LEA     DX,[0278]
       location 103                                                          6897:0272    B409                            MOV     AH,09
   -e 103 'My name' 0                                                        6897:0274    CD21                            INT     21
                                                                             6897:0276    EB05                            JMP     027D


Spring 2009                  Hadassah College            Dr. Martin Land    Spring 2009                Hadassah College                    Dr. Martin Land




23                             debug.exe                Microprocessors I   24                           debug.exe                        Microprocessors I




                        Assemble                                                              Assemble Example
Converts assembler language instructions to machine code                     -a
Syntax -a address <ENTER>                                                    0BE3:0100 mov ax,bx
                                                                             0BE3:0102 lea [bx+si+1]
                                                                                              ^ Error
Can't handle:                                                                0BE3:0102 lea dx,[bx+si+1]
   Line labels                                                               0BE3:0105 push bp
                                                                             0BE3:0106 pop sp
   Symbolic variable names                                                   0BE3:0107
   Macros                                                                    -
   .exe program header                                                       -u 100
                                                                             0BE3:0100 89D8           MOV                       AX,BX
                                                                             0BE3:0102 8D5001         LEA                       DX,[BX+SI+01]
Provides message "^ Error " on bad instruction                               0BE3:0105 55             PUSH                      BP
                                                                             0BE3:0106 5C             POP                       SP
                                                                             0BE3:0107 D489           AAM                       89
Spring 2009                  Hadassah College            Dr. Martin Land    Spring 2009                Hadassah College                    Dr. Martin Land
25                                       debug.exe                Microprocessors I   26                                   debug.exe            Microprocessors I




                    Assemble ⎯ Entering Data Strings                                                                    Write
The DB directive causes debug to enter raw data bytes                                 Syntax:             -w
Example:
-a 100
   0B21:0100           mov ax,bx                                                      Opposite of Load command
   0B21:0102           jmp 106
   0B21:0104           db 66, 67
   0B21:0106           mov bx,104                                                     BX.CX = Number of bytes to write
   0B21:0109           cs: mov ax,[bx]
-u
   0B21:0100           89D8         MOV                 AX,BX                         (BX containing high-order file size)
   0B21:0102           EB02         JMP                 0106
   0B21:0104           66           DB                  66
   0B21:0105           67           DB                  67
   0B21:0106           BB0401       MOV                 BX,0104
   0B21:0109           2E           CS:
   0B21:010A           8B07         MOV                 AX,[BX]

The DW directive causes debug to enter raw data words
Spring 2009                          Hadassah College              Dr. Martin Land    Spring 2009                        Hadassah College        Dr. Martin Land




27                                       debug.exe                Microprocessors I   28                                   debug.exe            Microprocessors I




                                         Go                                                                    Go With Breakpoints
Execute program                                                                       -g = start_IP breakpoint … breakpoint <ENTER>
   Go CANNOT be terminated by CNTL-Break
Syntax                                                                                Debugging feature
                                                                                          Stop at any of ten program addresses in list
   -g = start_IP <ENTER>
                                                                                      If no breakpoints set or breakpoints are not executed
   Starts program execution at the address CS:start_IP                                    Execution continues until termination
              Equal sign before address is required                                       Message "Program terminated normally" is sent
              Without start_IP, execution starts at CS:IP                             If a breakpoint is reached
                                                                                          Execution stops just before instruction is executed
                                                                                          Current registers are displayed
                                                                                                debug prompt is displayed
                                                                                                Any debug commands can be executed
                                                                                                go command continues execution

Spring 2009                          Hadassah College              Dr. Martin Land    Spring 2009                        Hadassah College        Dr. Martin Land
29                                   debug.exe                          Microprocessors I   30                                           debug.exe           Microprocessors I




                       Breakpoint Example                                                                                             Trace
                                                                                            Debugging feature
-g 276 47c 528 347 <ENTER>                                                                     Executes N instructions at a time
Starts at CS:IP                                                                                Displays registers after each instruction
Sets breakpoints at CS:276, CS:47C, CS:528                                                  Parameter indicates how many instructions to execute
       and CS:347
Execution stops if IP ← 276, 47C, 528, or 347                                               Syntax
                                                                                               -t = start instructions <ENTER>
                                                                                               start is start address
                                                                                               instructions is number of instructions to execute




Spring 2009                      Hadassah College                        Dr. Martin Land    Spring 2009                                Hadassah College       Dr. Martin Land




31                                   debug.exe                          Microprocessors I   32                                           debug.exe           Microprocessors I




-r
                          Trace Example                                                                                             Proceed
AX=0000 BX=0000    CX=0000 DX=0001 SP=FFEE          BP=0000 SI=0000 DI=0000
DS=0BE3 ES=0BE3
0BE3:0100 B83412
                   SS=0BE3 CS=0BE3 IP=0100
                         MOV    AX,1234
                                                     NV UP EI PL NZ NA PO NC
                                                                                            Debugging feature
-t=100 1
                                                                                               Very similar to Trace
AX=1234 BX=0000    CX=0000 DX=0001 SP=FFEE          BP=0000 SI=0000 DI=0000
DS=0BE3 ES=0BE3    SS=0BE3 CS=0BE3 IP=0103           NV UP EI PL NZ NA PO NC                                 Executes N instructions at a time
0BE3:0103 BB7856
-t
                         MOV    BX,5678
                                                                                                             Displays the registers after each instruction
AX=1234 BX=5678    CX=0000 DX=0001 SP=FFEE          BP=0000 SI=0000 DI=0000                               CALL and INT procedures are treated as one instruction
DS=0BE3 ES=0BE3    SS=0BE3 CS=0BE3 IP=0106           NV UP EI PL NZ NA PO NC
0BE3:0106 87C3           XCHG   AX,BX                                                       Syntax
-t
AX=5678 BX=1234    CX=0000 DX=0001       SP=FFEE    BP=0000 SI=0000 DI=0000
                                                                                               -p = start instructions <ENTER>
DS=0BE3 ES=0BE3
0BE3:0108 50
                   SS=0BE3 CS=0BE3
                         PUSH   AX
                                         IP=0108     NV UP EI PL NZ NA PO NC
                                                                                               start is start address
-t
                                                                                               instructions is number of instructions to execute
AX=5678 BX=1234    CX=0000 DX=0001       SP=FFEC    BP=0000 SI=0000 DI=0000
DS=0BE3 ES=0BE3    SS=0BE3 CS=0BE3       IP=0109     NV UP EI PL NZ NA PO NC
0BE3:0109 59             POP    CX
-t
AX=5678 BX=1234    CX=5678 DX=0001 SP=FFEE          BP=0000 SI=0000 DI=0000
DS=0BE3 ES=0BE3    SS=0BE3 CS=0BE3 IP=010A           NV UP EI PL NZ NA PO NC
0BE3:010A 03E9           ADD    BP,CX
Spring 2009                      Hadassah College                        Dr. Martin Land    Spring 2009                                Hadassah College       Dr. Martin Land
33                                   debug.exe           Microprocessors I   34                            debug.exe                 Microprocessors I




                              Script Trick                                                          Output Listing
Prepare source file: file.src                                                c:\>debug < file.src > file.lst
   Include all input for debug
   Example:                                                                  c:\>type file.lst
       n file.com                                                            -n file.com
       a                                                                     -a
       mov ax, bx                                                            0B0E:0100 mov ax, bx
       add ax, cx                                                            0B0E:0102 add ax, cx
                                                                             0B0E:0104
              r cx                                                           -r cx
              100                                                            CX 0000
              w                                                              :100
              q                                                              -w
                                                                             Writing 00100 bytes
Run from command line:                                                       -q
C:\> debug < file.src > file.lst <ENTER>
                                                                             c:\>
Spring 2009                      Hadassah College         Dr. Martin Land    Spring 2009                 Hadassah College             Dr. Martin Land




35                                   debug.exe           Microprocessors I   36                            debug.exe                 Microprocessors I




                           Output Executable                                                               Fill
c:\>debug       file.com                                                     Stores many addresses with data
-u
0B67:0100       89D8          MOV                AX,BX
                                                                             Syntax
0B67:0102       01C8          ADD                AX,CX                          -f start l length data
0B67:0104       1E            PUSH               DS                             Data: HEX bytes or quoted strings separated by spaces
                                                                             Example



                                                                              -f 0 L 8000 00 12 34 ‘1234’
                                                                              Fills 8000h (32KB) data locations with 00 12 34 31 32 33 34
                                                                              (ascii ‘1’ is 31, ascii ‘2’ is 32, etc)



Spring 2009                      Hadassah College         Dr. Martin Land    Spring 2009                 Hadassah College             Dr. Martin Land
37                              debug.exe                 Microprocessors I   38                                          debug.exe        Microprocessors I




                             Move                                                                                     Search
Moves data from with the starting address to the ending                       Find occurrence of a byte or series of bytes
    address                                                                   Syntax:
Syntax:                                                                          -s start l length string <ENTER>
-m start l length destination <ENTER>
                                                                                            start and length
Example                                                                                       SEGMENT:OFFSET
                                                                                              OFFSET
              -m 100 l 200 ES:100                                                           string
              Moves data from DS:0100 to DS:02FF                                              Hex bytes separated by spaces
                 (Length 200) to ES:0100                                                      Single quoted strings (case sensitive)
                                                                                              Example
                                                                                                  -s 0 l 100 12 34 'abc' 56 <ENTER>
                                                                              Produces list of occurrences (starting offsets)
Spring 2009                   Hadassah College             Dr. Martin Land    Spring 2009                               Hadassah College    Dr. Martin Land




39                              debug.exe                 Microprocessors I   40                                          debug.exe        Microprocessors I




                        Search Example                                                                              Compare
                                                                              Compare two blocks of memory, byte for byte
                                                                              Syntax
     -s 0 l 1000 'q'
     0BE3:0C0C                                                                              -c start_1 l length start_2 <ENTER>
     -s 0 l 1000 'qu'
     -                                                                                      start_1 and start_2
                                                                                              SEG:OFFSET
                                                                                              OFFSET


                                                                              If two addresses do not match
                                                                                  Both addresses are displayed
                                                                                  With their respective data bytes
                                                                              If addresses match, they are skipped
Spring 2009                   Hadassah College             Dr. Martin Land    Spring 2009                               Hadassah College    Dr. Martin Land
41                             debug.exe                    Microprocessors I   42                                   debug.exe                Microprocessors I




                     Compare Example                                                                              Name
Compare DS:0100 with DS:0200 for a length of 8                                  Specifies file name
                                                                                Can specify any parameters on the same line
              -c 0100 l 8 0200
              6897:0100 E9 65                   6897:0200
              6897:0101 6B 70                   6897:0201                       Example
              6897:0102 01 74                   6897:0202                          -n chkdsk.com /f
              6897:0104 4C 6D                   6897:0204
              6897:0105 4F 62                   6897:0205                                     Prepares DEBUG for loading program CHKDSK.COM
              6897:0106 43 65                   6897:0206                                     Passes /f switch to program
              6897:0107 4B 72                   6897:0207
6897:0103 matched 6897:203 so line was skipped




Spring 2009                  Hadassah College                Dr. Martin Land    Spring 2009                        Hadassah College            Dr. Martin Land




43                             debug.exe                    Microprocessors I   44                                   debug.exe                Microprocessors I




                       Input/Output                                                                       Arithmetic Commands
Read/Write a byte of data from/to I/O ports                                     Syntax
1 or 2 byte port address                                                        -h hex_num_1 hex_num_2 <ENTER>
Example — read port 03fd                                                        Returns sum and difference


 -i 3fd                                                                         -
                                                                                -h 1234 111
 7D                                                                             1345 1123
 -                                                                              -




Spring 2009                  Hadassah College                Dr. Martin Land    Spring 2009                        Hadassah College            Dr. Martin Land

								
To top