home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / wasm.arc / PRES.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-02-19  |  1.6 KB  |  51 lines

  1.            TITLE     'Wolfware Sample Program','Printer Reset'
  2.  
  3. ;-----------------------------------;
  4. ;            Printer Reset          ;
  5. ;                                   ;
  6. ; Initialize parallel printer port  ;
  7. ; one through the BIOS routine.     ;
  8. ; Once assembled, to reset the      ;
  9. ; printer, type:                    ;
  10. ;                                   ;
  11. ; PRES                              ;
  12. ;                                   ;
  13. ; This routine have the effect of   ;
  14. ; initializing the printer to its   ;
  15. ; power on characteristics.         ;
  16. ;-----------------------------------;
  17.  
  18.            PROC      FAR
  19. PORT       EQU       1              ;printer port to initialize
  20. ERROR_BITS EQU       00101001B      ;printer error bits
  21.  
  22. ;----- print message to inform user on screen
  23.  
  24.            MOV       DX,OFFSET PRESMESS ;message location
  25.            MOV       AH,9           ;string output
  26.            INT       21H            ;execute
  27.  
  28. ;----- reset printer port
  29.  
  30.            MOV       DX,PORT        ;port number
  31.            MOV       AH,1           ;initialize port
  32.            INT       17H            ;execute
  33.  
  34.            TEST      AH,ERROR_BITS  ;check if error
  35.            JZ        PDONE          ;jump if OK
  36.  
  37. ;----- error
  38.  
  39.            MOV       DX,OFFSET PRESERR  ;message location
  40.            MOV       AH,9           ;string output
  41.            INT       21H            ;execute
  42.  
  43. PDONE      INT       20H            ;exit
  44.  
  45. ;----- data
  46.  
  47. PRESMESS   DB        10,'Printer ', PORT + '0' ,' reset', 13,10,'$'
  48. PRESERR    DB        10,'Error in printer', 13,10,'$'
  49.            ENDP
  50. 
  51.