<--- Turn the page     (contents page)     Turn the page --->


Questions and Answers




How do you pause your program and make it pause the same amount on a fast or slow machine?
        A DOS User


You have to pause using the internal clock rather than looping so many times. DOS provides a misc interrupt service just to do this. It is INT 15h, service 86h.

  ; CX:DX = milliseconds
  mov  ah,86h
  mov  cx,???
  mov  dx,???
  int  15h

How do I use variables in my Batch files?
        Charles

  To set a variable in a batch file:
  SET VAR1 = 1
  To change this variable:
  SET VAR1 = 2
  To delete this variable:
  SET VAR1=
  To check this variable:
  if %Var1% == "1" then goto do1

What are the register values on entry to a .COM file?
        Another DOS User

  AX,BX       = 0000h
  CX          = 00FFh
  DX,SS,DS,ES = CS
  SP,DI       = FFFEh
  SI,IP       = 0100h
  BP          = 09xxh (the lower byte is unknown)


Where are the command line parameters located?
        [FAQ]


The command line is located at offset 82h in the PSP with the count located at offset 80h. Be sure to check the count before you get the command line. Even though the count might be zero, there is usually something in the command line area.


How can I tell if the ALT key has been pressed?
        [FAQ]


There are two bytes in memory that have bit representations of each of these type keys.

0040:0017h 76543210
           X         Insert state 1=active
            X        Caps Lock 1=active
             X       Num Lock  1=active
              X      Scroll Lock 1=active
               X     1 = alt pressed
                X    1 = Ctrl pressed
                 X   1 = L shift pressed
                  X  1 = R shift pressed
0040:0018h 76543210
           X         1 = Ins Pressed
            X        1 = Caps Lock pressed
             X       1 = Num Lock pressed
              X      1 = Scroll Lock pressed
               X     1 = pause pressed (Ctrl num lock)
                X    1 = Sys Req pressed
                 X   1 = L Alt pressed
                  X  1 = L Ctrl pressed
¥


<--- Turn the page     (contents page)     Turn the page --->

Page 7