home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 181.img / TASM-101.ZIP / CHAPXMPL.ARC / MODCHAR.ASM < prev    next >
Assembly Source File  |  1989-05-02  |  3KB  |  41 lines

  1.      DOSSEG                         ;segment-order directive
  2.      .MODEL  SMALL                  ;near code and data models
  3.      .STACK  200h                   ;512-byte stack
  4.      .DATA                          ;start of the data segment
  5. DisplayString  DB   13,10           ;carriage-return/linefeed pair
  6.                                     ; to start a new line
  7. ThreeChars     DB   3 DUP (?)       ;storage for three characters
  8.                                     ; typed at the keyboard
  9.                DB   '$'             ;a trailing "$" to tell DOS when
  10.                                     ; to stop printing DisplayString
  11.                                     ; when function 9 is executed
  12.      .CODE                          ;start of the code segment
  13. Begin:
  14.      mov  ax,@data
  15.      mov  ds,ax                     ;point DS to the data segment
  16.      mov  bx,OFFSET ThreeChars     ;point to the storage location
  17.                                     ; for first character
  18.      mov  ah,1                      ;DOS keyboard input function #
  19.      int  21h                       ;get the next key pressed
  20.      dec  al                        ;subtract 1 from the character
  21.      mov  [bx],al                   ;store the modified character
  22.      inc  bx                        ;point to the storage location
  23.                                     ; for the next character
  24.      int  21h                       ;get the next key pressed
  25.      dec  al                        ;subtract 1 from the character
  26.      mov  [bx],al                   ;store the modified character
  27.      inc  bx                        ;point to the storage location
  28.                                     ; for the next character
  29.      int  21h                       ;get the next key pressed
  30.      dec  al                        ;subtract 1 from the character
  31.      mov  [bx],al                   ;store the modified character
  32.      mov  dx,OFFSET DisplayString   ;point to the string of
  33.                                     ; modified characters
  34.      mov  ah,9                      ;DOS print string function #
  35.      int  21h                       ;print the modified characters
  36.      mov  ah,4ch                    ;DOS end program function #
  37.      int  21h                       ;end the program
  38.      END  Begin                     ;directive to mark the end of the source
  39.                                     ; code and to indicate where to start
  40.                                     ; execution when the program is run
  41.