; PRINTQQ.ASM
;
; Intended for use with Fortran 5.1.
;   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
;


MY_DATA segment para public 'FAR_DATA'          
	assume ds:MY_DATA
MY_DATA   ends             


MY_CODE segment para public 'CODE'
	assume cs:MY_CODE
	public  printqq

PRINTQQ  proc    far
	push bp
	mov  bp,sp
	 
	;Put service in ah and check to see if legal
	xor  ax, ax
	mov  ax, [bp+6]     ; service
	cmp  al, 01h
	je   go
	cmp  al, 02h
	jne  badret
go:
	mov  ah, al
	mov  dx, [bp+0ah]   ; port
	int  017h  
	mov  al,ah          ; return status bits in AL, not in AH
	xor  ah,ah
	xor  dx,dx
	jmp  quit

badret:
	mov  ax, 0ffffh     ; -1 == error
	mov  dx, 0ffffh

quit:
	pop  bp
	ret

PRINTQQ     endp
MY_CODE     ends

	end


