There are 3 areas where display files are used
(1) Refresh Displays
(2) Storage displays for "erasures"
(3) Data image preservation/transportation
If the computer has to draw the image repetitively then it
must have some list of the commands to output to the graphics screen.
This list is called a Display file.
(1) The host computer gets the command and sends out the correct
characters to the device (dependent on move, draw, print, etc).
Obviously, not over a terminal line since each character could
take 1 millisec => 30 characters before flicker sets in.
Could be sent over a parallel output port at data rates of 40,000
characters/sec or more. Even this is normally too slow. Also host
must process list at 25 micro-seconds per character!!
(2) The host indicates to the Display Processing Unit ( D.P.U. -
the processor in the graphics refresh display unit) the start address
of the list of commands and tells it to access them itself.
Therefore, both host and D.P.U. can access the list or display file in
memory. The list is in a format that D.P.U. can "interpret" directly.
D.P.U. could get/process 1 command every 1 or 2 microseconds = 20,000
commands without flicker.
The D.P.U. takes first "symbolic" instruction
0: move_abs X,Y from display file (= in reality it is memory
1: draw_rel DX,DY storage ) and executes it, it then gets next
2: draw_rel DX,DY one , etc. Finally , in this case, it gets a
: jump to 0 , where upon it starts to process
n: jmp 0 the list once more.
Hence refresh display.
A storage tube does not need to be refreshed but when
updating a picture by erasing a small part of it, the entire
screen must be cleared and the image rebuilt minus the deleted
line segments. A display file can be used to hold a "copy" (in
symbolic form) of the image.
0: move_abs X,Y To remove the 3 line segments just:
: (1) change them to NO-OPs i.e. no operation
20: draw_rel is performed by D.P.U.
21: draw_rel OR remove them by compacting display file.
22: draw_rel (2) erase screen.
: (3) "execute" the display file.
n: jmp 0 Image is rebuilt.
For design work (= interactive work) an image can be built
up on the screen, changed, etc. and then finally a hardcopy may
be required. If a hardcopy device is attached to the screen then
the bit contents of screen may be directly copied onto the
hardcopy device.
Use video signal from Raster scan. Why is this no good for T4010?
Because it is not a RASTER SCAN device. No memory to scan for video signal.
Of the 3, the commonest use for display files is for refresh displays but since we have no refresh display we will be concerned with the concepts and the rebuilding of an image.
How is display file built up? When routines such as plot, symbol, setwindow, etc are called commands such as move_abs(x,y), display_text(x,y) and jmp addr are entered into the display file. New segments will (perhaps ) be surrounded by header information and jmp's to the next segment. Remember that each addition to the end of the display file must be terminated by a jmp 0 or a command that indicates that the end of the display file has been reached.
Therefore the routines used will add to the display file rather than sending commands such as "V[124,334]" to a device: obviously the commands sent to the device are in the display file. So our device driver takes commands and creates a binary bit pattern that is sent to the D.P.U.
The D.P.U. can use the commands in the display file as instructions. It doesn't need a program which looks at the commands one by one, figures out what it means and does the correct thing. The program can be the commands themselves! So a display file is just a machine language program for the D.P.U. and the D.P.U. is just a special computer with "strange" instructions.
Just as the PDP11 has a "cmp op1,op2" command, the Z80 has a "call nz,addr", and the DEC10 has a "jrst addr" instruction, so our D.P.U. may have a "move_abs x,y" instruction or a "call circle" instruction. This is why the D.P.U. can be so fast - it is just executing a machine language program.
It is a common and very useful practice to break up a
picture into segments (NOT line segments in particular). The
image on the screen can then be looked at as being made up of
many segments or distinct images, i.e. a circle, a triangle, a
square or a little man perhaps.
Fig. 17.1 : Segments in a display file.
Each of these segments can be isolated in the
display file and even named in some way to
distinguish it. It may even be in the form of
a display file subroutine.
If we have to display 6 circles why not a circle drawing subroutine that can
be called and returned from (with infinite nesting). Might also be useful
to have parameters.
Lets look at two typical D.F. layouts for the above.
0 : CALL CIRCLE 5: : : :
1 : CALL TRIANGLE Circle Square
2 : CALL SQUARE Routine Routine
3 : CALL LITTLEMAN
4 : JMP 0 RETURN RETURN RETURN RETURN
Display files with 4 calls plus the subroutines themselves.
(We could add a counter to the triangle routine which indicates how many
calls there are to this routine.)
To delete the triangle:
Fig. 17.2 : Implementation of segments in a display file.
To add another segment, we create our new code at a particular "address", finish it with a jmp 0 and then change the jmp 0 in the littleman segment to jmp to the particular address of new segment.
QUESTIONS:
What type of code is in display file?
What commands do we need to manipulate these segments within our
display file?
What of storage allocation for the segment creation/deletion?`
In high level situations where we may be using a display
file for a refresh display, the follow segment management
commands would be useful:
create-segment(name) = open(name)
close-segment(name) or just close-segment
delete-segment(name) and reclaim space
rename-segment(old,new)
set-visibility (name,on/off) = post/unpost(name)
translate-segment(name,dx,dy):
append-segment(name) <--- useful but can lead to problems with
too many jumps
Storage allocation for segments is complicated by
(1) Amount of memory needed is not known beforehand.
i.e. appending to a segment, creating a new segment.
(2) Re-allocation or disposal of segments cannot be done in a
simple manner
iff the display file is being used for refreshing a
display.
Fig. 17.3 : Storage allocation of segments in a display file.
Suppose we have a two segment display file (0) and (1).
At some time during execution of the display file we
want to replace segment (1) by (2).
We must create (2). Add the jmp 0 and then link it into
display file by changing jmp N at location M to a jmp Q.
In the latter case we can immediately reclaim the space
allocated to segment (1) if the only entry point is at n: since
it is never used again but in the former case we cannot reclaim
(1) until it is finished with by the D.P.U. Otherwise we may
alter code that the D.P.U. is executing as we re-use that space.
We must wait until D.P.U. signals "all finished".
This is usually a flag in a register but in a dedicated system it could
cause an interrupt which goes to a routine which does garbage collection.
Use the blocks of storage of a fixed length and allocate these for segment
storage.
Size of a page which gives the number of D.P.U. instructions must be
determined empirically in order to reduce wastage since not all pages
within a segment will be full.
Fills up 3 pages plus 1 instruction = 4 pages. Notice last page has 7 wasted instructions in it that can't be used.
Fig. 17.4 : Storage allocation of pages.
In Pascal, we can use pointers and linked lists and the facilities offered by dynamic storage = HEAP.
In FORTRAN, we only have static storage therefore, we must use a large (gigantic?) array or arrays.