0% found this document useful (0 votes)
119 views2 pages

Following Are The Operations On Segment Creating The Segment

The document discusses operations for segments in a display file, including creating a segment by giving it a unique name, closing a segment by changing the currently open segment name to 0, and renaming a segment to allow for double buffering where a new segment is prepared invisibly before making it visible and deleting the prior segment.

Uploaded by

abhishek125
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views2 pages

Following Are The Operations On Segment Creating The Segment

The document discusses operations for segments in a display file, including creating a segment by giving it a unique name, closing a segment by changing the currently open segment name to 0, and renaming a segment to allow for double buffering where a new segment is prepared invisibly before making it visible and deleting the prior segment.

Uploaded by

abhishek125
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

following are the operations on segment

creating the segment

 We Must give the segment name so that we can identify it.


 For example say that there is segment no. 3, then all following
MOVE and Line commands would belong to segment 3. We could
then close segment 3 and open another.
 First thing to create a segment is to check whether some other
segment is open. We cannot open two segments at the same time
because we would not know to which segment we should assign
the drawing instructions. If there is segment open, we have an
error
 Next we should select valid segment name and check whether
there already exists a segment under this name. If so, we again
have an error.
 The first instruction belonging to this segment will be located at
the next free storage area in the display file. The current size of
the segment is zero since we have not actually entered any
instructions into it yet.

Closing a Segment
• Once the drawing instructions are completed, we should close it.
• NOW-OPEN variable indicates the name of the currently open
segment.
• To close a segment it is necessary to change the name of the
currently open segment. It can be achieved by changing the name
of currently open segment as 0.
• We don’t have two unnamed segments around because we shall
show only one of them and the other would just waste storage.
• If there are two unnamed segments in the display file one has to
be deleted.

Renaming a Segment

• The display processor is continuously reading the display file and


showing its contents
• Suppose we wish to use this device to show an animated
character moving on the display.
• To display a new image in the sequence we have to delete the
current segment and re-create it with the altered character. The
problem in this process is that during the time after the first image
is deleted and time before the second image is completely
entered, only a partially completed character is displayed on the
screen.
• We avoid this problem by keeping the next image ready in the
display file before deleting the current segment.
• Segment which is to be deleted and segment which is to be
replaced with must exist in display file at the same time.
• We do this by building the new invisible image under some
temporary segment name. When it is completed, we can delete
the original image, make the replacement image visible, and
rename the new segment to become the old segment to achieve
apparent motion.
• The idea of maintaining two images, one to show and one to
build or alter, is called double buffering.

You might also like