🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.misc
Article #9207

Re: Printing with Pascal

#9207
From: Fredrik Knoph Kvamme
Date: Sat, 13 Apr 1991 20:14
40 lines
1506 bytes
In his article Sid writes he couldn't get the compiler to accept my code. I
must agree with him, the error was mine.

> IF ((port[$379] and 16)==16) THEN PRN_OnLine:=TRUE
                          ^
That line should have been :

IF ((port[$379] and 16)=16) THEN PRN_OnLine:=TRUE

It was my fault. I have been away from PASCAL too long. The == is the way
we do it in C.

Now, how do we check the other status-bits?

I got the number 16 because the Select bit is bit number four in the status port.
2 to the power of 4 is 16.

The numbers for the other is :
Error 		: 8
Select(Online)	: 16
Paper out 	: 32
Acknowledge	: 64
BUSY		: 128

So in order to write a routine checking for out of paper do this:

FUNCTION PaperOut: BOOLEAN;
BEGIN
IF ((port[$379] and 32)=32) THEN PaperOut:=TRUE
   ELSE PaperOut:=FALSE;
END;

I hope this helps.
(Next time I shall proofread my article better.)

Fredrik Kvamme
fredrik@lise.unit.no
NTH, Norwegian Institute of Technology
Trondheim, Norway
Technical Details
Message-ID: <1991Apr13.201440.12854@ugle.unit.no>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!kth.se!ugle.unit.no!siri.unit.no!fredrik

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!kth.se!ugle.unit.no!siri.unit.no!fredrik
From: fredrik@Siri.Unit.NO (Fredrik Knoph Kvamme)
Newsgroups: comp.sys.ibm.pc.misc
Subject: Re: Printing with Pascal
Message-ID: <1991Apr13.201440.12854@ugle.unit.no>
Date: 13 Apr 91 20:14:40 GMT
Sender: news@ugle.unit.no
Reply-To: fredrik@Siri.Unit.NO (Fredrik Knoph Kvamme)
Organization: Norwegian Institute of Technology
Lines: 40