home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / disasm / md86.zip / PRN2LPT1.ASM < prev    next >
Assembly Source File  |  1990-06-13  |  896b  |  30 lines

  1. cseg    segment
  2.     assume     cs:cseg,ds:cseg
  3.     org    100h
  4. start:    mov    al,byte ptr ds:[5dh] ;CHGPRN P changes to PRN
  5.     cmp    al,'P'                 ;CHGPRN L changes to LPT1
  6.     je    toprn                 ;Get address of correct device
  7.     cmp    al,'L'             ;Name in SI
  8.     je    tolpt             ;Error if parameter not P or L
  9.     jmp    error
  10. toprn:    mov    si,offset toprnstr
  11.     jmp    short patch
  12. tolpt:    mov    si,offset tolptstr
  13. patch:    mov    cx,8             ;Patch all eight bytes of name
  14.     xor    ax,ax
  15.     mov    es,ax
  16.     mov    di,82eh             ;This address must change if
  17.     cld                 ;PRN not located at 0:82E
  18.                      ;Hex
  19.     rep movsb
  20.     int    20h
  21. error:    mov    dx,offset errormsg
  22.     mov     ah,9
  23. toprnstr db'PRN          '
  24. tolptstr db'LPT1          '
  25. errormsg db 0dh,0ah,'Usage:chgprn x',0dh,0ah
  26.     db        'x=L    Change to LPT1',0dh,0ah
  27.     db        'x=P    Change to PRN',0dh,0ah,'$'
  28. cseg    ends
  29.     end start
  30.