; PRINTQQ.ASM
;
; Intended for use with Fortran Powerstation.
;   PRINTQQ: Checks status of printer.
;
;
; INTERFACE TO INTEGER*4 FUNCTION PRINTQQ(port, service)
;   integer*4 port[VALUE]     ! 0 = lpt1, 1 = lpt2, 2 = lpt3
;   integer*4 service[VALUE]  ! we do init = 1 and status = 2
; end
;

.386
.model FLAT, STDCALL

PRINTQQ PROTO   STDCALL, port:SWORD, service:SWORD

.CODE

PRINTQQ    PROC    STDCALL, port:SWORD, service:SWORD
			   
	push dx           

	;Put service in ah and check to see if legal
	xor  ax, ax
	mov  ax, service
	cmp  al, 01h
	je   go
	cmp  al, 02h
	jne  badret
go:
	mov  ah, al
	mov  dx, port
	int  017h  
	mov  al,ah       ; return status bits in AL, not in AH
	xor  ah,ah
	jmp  quit

badret:
	mov  eax, 0ffffffffh

quit:
	pop  dx

	ret
PRINTQQ    endp

	end
