Article View: comp.lang.asm370
Article #439Re: Testing to see if screen is in MORE status
From: Eric Thomas SUNET
Date: Tue, 02 Oct 1990 20:06
Date: Tue, 02 Oct 1990 20:06
44 lines
2495 bytes
2495 bytes
In article <9010021416.AA24712@ucbvax.Berkeley.EDU> IBM 370 Assembly
Programming Discussion List <ASM370@OHSTVMA.BITNET> writes:
>Since the screen write instruction keeps testing until the screen is clear,
>it won't receive any more data from the CTC, tying the other end up.
That is where the problem is, it shouldn't do that. Your write-line-to-screen
routine should first check if the terminal is ready, if so do the SIO now,
otherwise copy the message to a buffer (ideally a chained list from dynamically
allocated storage with some self-imposed limit on the number of entries to
avoid running out of memory if the program goes crazy). When you get the device
end from the console, send the next message, and so on. A more "practical"
description of the algorithm would be:
Write-a-line routine:
1. If you have more than N messages waiting, ignore request.
2. If you have exactly N messages waiting, alter address/length registers
to point to a hardcoded message saying additional lines had to be
discarded.
3. Increment the number-of-messages counter, get a chunk of storage to hold
the message, copy it over, add to bottom of chained list.
4. If the chained list was not empty when you added, return.
5. See if the terminal is ready; if so, start the I/O for the first message
in the chain (that's a subroutine you will call from the interrupt
level as well).
Interrupt level:
A. On a channel end, dispose of the first message in the chained list and
decrement N.
B. On a device end, call the subroutine mentioned in (5) if the chained list
is not empty.
This should all take place with interrupts disabled of course; the logic I
quoted assumes you are the only one doing I/O to the console, if you mix up
CMS I/O with your I/O you need another routine to wait until you're done
printing your stuff before calling CMS.
Eric
Technical Details
Message-ID:
<9010030717.AA16343@ucbvax.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!wuarchive!decwrl!ucbvax!BLOOM-BEACON.MIT.EDU!eru!hagbard!sunic!ericShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!wuarchive!decwrl!ucbvax!BLOOM-BEACON.MIT.EDU!eru!hagbard!sunic!eric
From: eru!hagbard!sunic!eric@BLOOM-BEACON.MIT.EDU (Eric Thomas SUNET)
Newsgroups: comp.lang.asm370
Subject: Re: Testing to see if screen is in MORE status
Message-ID: <9010030717.AA16343@ucbvax.Berkeley.EDU>
Date: 2 Oct 90 20:06:12 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: IBM 370 Assembly Programming Discussion List
<ASM370@OHSTVMA.BITNET>
Distribution: inet
Organization: The Internet
Lines: 44