home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
assemblr
/
library
/
resetp
/
resetprn.asm
next >
Wrap
Assembly Source File
|
1993-07-09
|
3KB
|
85 lines
; RESETPRN.ASM --- Tony Doimeadios - 12/07/92
DOSSEG
.MODEL SMALL
.STACK 100h
.DATA
Message DB 'RESETPRN 1.0',13,10
DB '(C) 1992 Tony "Sandy" Doimeadios',13,10
DB 'Tony Doimeadios',13,10
DB 'Post Office Box 1345',13,10
DB 'Fernandina Beach, FL 32035-1345',13,10
DB 13,10
DB 'Released to the Public Domain',13,10
DB 13,10
DB 13,10
DB 'This program will reset a HP Compatible Laser Printer',13,10
DB 'to a monospaced Courier font, and letter-sized paper.',13,10,'$'
CR DB 27,'&l0O',27,'(','1U',27,'(s0p10h12v0s0b3T' ;Courier 10 point reg
CRB DB 27,'&l0O',27,'(','1U',27,'(s0p10h12v0s3b3T' ;Courier 10 point bold
Letter DB 27,'&l2A'
Legal DB 27,'&l3A'
.CODE
mov ax,@Data ;set DS to point to the data segment
mov ds,ax ;put it in ds
mov dx,OFFSET CR ;get offset of string to print
mov cx,26 ;it's 26 characters long
call LPrint ;print it to the printer
mov dx,OFFSET Letter ;get offset of string to print
mov cx,5 ;it's 5 characters long
call LPrint ;print it to the printer
mov bx,OFFSET Message ;get offset of string to print
call PrintString ;print the string
jmp short Done ;bail out
;-------------------------------------------------
LPrint PROC
;setup: cx = length of string to print
; dx = OFFSET of string to print
mov ah,40h ;DOS write to device function #
mov bx,4 ;printer handle
int 21h ;call DOS to do it
ret ;return
LPrint ENDP
;-------------------------------------------------
;---------------------------------------------------------------------
; Subroutine to print a string on the display.
;
; Input:
; DS:BX = pointer to string to print
;
; Output: None
;
; Registers destroyed: None
;
PrintString PROC
push ax
push dx ;preserve registers in this sub
mov ah,9 ;DOS print string function #
mov dx,bx ;point DS:DX to the string to print
int 21h ;invoke DOS to print the string
pop dx ;restore registers we changed
pop ax
ret
PrintString ENDP
;---------------------------------------------------------------------
Done:
mov ah,4Ch ;DOS terminate program function #
int 21h ;terminate the program
END