home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / resetp / resetprn.asm next >
Assembly Source File  |  1993-07-09  |  3KB  |  85 lines

  1.  
  2. ; RESETPRN.ASM    --- Tony Doimeadios - 12/07/92
  3.     
  4.     DOSSEG
  5.     .MODEL SMALL
  6.     .STACK 100h
  7.     .DATA
  8. Message DB  'RESETPRN 1.0',13,10
  9.         DB  '(C) 1992 Tony "Sandy" Doimeadios',13,10
  10.         DB  'Tony Doimeadios',13,10
  11.         DB  'Post Office Box 1345',13,10
  12.         DB  'Fernandina Beach, FL  32035-1345',13,10
  13.         DB  13,10
  14.         DB  'Released to the Public Domain',13,10
  15.         DB  13,10
  16.         DB  13,10
  17.         DB  'This program will reset a HP Compatible Laser Printer',13,10
  18.         DB  'to a monospaced Courier font, and letter-sized paper.',13,10,'$'
  19. CR      DB  27,'&l0O',27,'(','1U',27,'(s0p10h12v0s0b3T' ;Courier 10 point reg
  20. CRB     DB  27,'&l0O',27,'(','1U',27,'(s0p10h12v0s3b3T' ;Courier 10 point bold
  21. Letter  DB  27,'&l2A'
  22. Legal   DB  27,'&l3A'
  23.  
  24.  
  25.     .CODE
  26.     mov ax,@Data                    ;set DS to point to the data segment
  27.     mov ds,ax                       ;put it in ds
  28.  
  29.     mov dx,OFFSET CR                ;get offset of string to print
  30.     mov cx,26                       ;it's 26 characters long
  31.     call LPrint                     ;print it to the printer
  32.  
  33.     mov dx,OFFSET Letter            ;get offset of string to print
  34.     mov cx,5                        ;it's 5 characters long
  35.     call LPrint                     ;print it to the printer
  36.  
  37.     mov bx,OFFSET Message           ;get offset of string to print
  38.     call PrintString                ;print the string
  39.  
  40.     jmp short Done                  ;bail out
  41.  
  42.  
  43. ;-------------------------------------------------
  44. LPrint PROC
  45.  
  46. ;setup: cx = length of string to print
  47. ;       dx = OFFSET of string to print
  48.  
  49.     mov ah,40h          ;DOS write to device function #
  50.     mov bx,4            ;printer handle
  51.     int 21h             ;call DOS to do it
  52.     ret                 ;return
  53.  
  54. LPrint ENDP
  55. ;-------------------------------------------------
  56.  
  57.  
  58. ;---------------------------------------------------------------------
  59. ; Subroutine to print a string on the display.
  60. ;
  61. ; Input:
  62. ;       DS:BX = pointer to string to print
  63. ;
  64. ; Output: None
  65. ;
  66. ; Registers destroyed: None
  67. ;
  68. PrintString     PROC
  69.         push    ax
  70.         push    dx                         ;preserve registers in this sub
  71.         mov     ah,9                       ;DOS print string function #
  72.         mov     dx,bx                      ;point DS:DX to the string to print
  73.         int     21h                        ;invoke DOS to print the string
  74.         pop     dx                         ;restore registers we changed
  75.         pop     ax
  76.         ret
  77. PrintString     ENDP
  78. ;---------------------------------------------------------------------
  79.  
  80.  
  81. Done:
  82.     mov ah,4Ch                      ;DOS terminate program function #
  83.     int 21h                         ;terminate the program
  84.     END
  85.