Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ FORTRAN graphics on the PDP15Simple complete FORTRAN program using FOGFOG subroutinesFOG errorsInput routines for use with graphics programsLoading and overlaying FOG □ Appendices □ A: Summary of FOG subroutinesB: VT15 instruction setC: 7-bit ASCII character codesD: Display orders generated by FOG routinesE: The structure of FOG display filesF: The VTA handler
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureICL 1906A manualsFOG
ACLLiteratureICL 1906A manualsFOG
ACL ACD C&A INF CCD CISD Archives
Further reading

FORTRAN graphics on the PDP15
Simple complete FORTRAN program using FOG
FOG subroutines
FOG errors
Input routines for use with graphics programs
Loading and overlaying FOG
Appendices
A: Summary of FOG subroutines
B: VT15 instruction set
C: 7-bit ASCII character codes
D: Display orders generated by FOG routines
E: The structure of FOG display files
F: The VTA handler

2. SIMPLE COMPLETE FORTRAN PROGRAM USING FOG

2.1 Simple Example

This example is the simplest possible FOG program that can draw a line on the screen and maintain it. The line is drawn from the top left hand corner to the bottom right hand corner of the major image area. The annotation numbers refer to the notes below the example.

C 1
      INTEGER D(8)
C 2
      D(1) = 0
      CALL DCHOOS (D, 1)
C 3
      CALL DINIT (D,1)
C 4
      CALL SETPT (0,1023,0)
C 5
      CALL LINE (1023,-1023,1)
C 6
      PAUSE
      STOP
      END

Notes

  1. The programmer must provide an integer array (or arrays) where the display file is (or display files are) to be generated. The size of the array to be provided depends on:
    1. the number of display files that are to occupy the array (1 in this example);
    2. the number of calls to routines which generate display orders (in this example one of SETPT and one of LINE);
    3. the number of display orders generated by each routine (the programmer can find out the number of display orders generated by each routine by reference to Appendix D).
    In this example 8 locations are required, made up of 4 (minimum size) + 2 (for SETPT) + 2 (for LINE). (On the ACL PDP15 with arbitrary vector hardware, SETPT and LINE never generate more than 2 display orders.)
  2. The program must specify, using DCHOOS, in which locations subsequent FOG routines are to generate a display file. In this example, the display file will start at the array element D(1). If D(1)=0 on entry to DCHOOS as in this example, then DCHOOS ensures that on exit there is a minimum executable file for the VT processor to obey. A fuller definition of DCHOOS is contained in Section 3.1.
  3. The program calls DINIT to command the VT15 processor to execute the specified file; in this example the display file starts at the array. element D(1). On exit from DINIT, the VT15 is executing a display file which is valid (because DCHOOS has been called) but which contains no display orders that can generate a visible image. Therefore, the screen is blanked if it is not already blank.
  4. The effect of the SETPT call is to create display orders which set the plotting position at the point (0,1023) with respect to an origin (0,0) at the bottom left-hand corner of the screen. The screen remains blank (because of the third argument being 0). Orders are being added to the display file while the VT15 processor is executing it. FOG ensures that this will not cause problems.
  5. The effect of the LINE call is to create display orders which draw a visible vector with, in this example, an X-increment of 1023 and a Y-increment of -1023 (from point (0,1023) to (1023,0)). The line appears at this time (on the first VT15 cycle after LINE is called).
  6. The PAUSE is necessary in this example otherwise the program will exit and the image will disappear as soon as control is returned to the disc operating system (DOS). In PDP15 FORTRAN, the PAUSE statement waits for the user to type ctrl P on the system teletype. In a typical interactive graphics program a steady image is maintained when the program is waiting for the next user-input so a PAUSE would not be necessary.

Variations

  1. Although DCHOOS must be called before any of the other FOG routines in this example, DINIT need not be called before the image-generating routines. If DINIT is called after all the image-generating routines, the picture will not appear on the screen until the complete display file is present, instead of individual lines appearing as they are called. With a complex picture, this would make a noticeable difference.
  2. If the SETPT call is omitted, LINE would start from a new plotting position (the endpoint of the previous LINE) on each VT15 cycle.
⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site