TRIPOS PDP-11 Assembler version 1.4


                                      ; GT40 demo program.
                                      ; Generate test pattern 4-14 for adjustment of DPU display board.
                                      ; Adjust R131 on A320 module until vectors meet the vertical line
                                      ; Martin Guy, June 1988.

                                      ; Constants about machine.

              040000                  COREND	= 40000		; First unusable word
              002000                  WIDTH	= 1024.		; Height of display
              001400                  HEIGHT	= 768.		; Width of display

                                      ; Address of registers.

              172000                  DPC     = 172000        ; VT40 Program counter
              172002                  DSR     = 172002        ; VT40 Status register
              172004                  XSR     = 172004        ; X status register
              172006                  YSR     = 172006        ; Y status register

                                      ; Recommended mnemomics

              100000                  CHAR    = 100000        ; Character mode
              104000                  SHORTV  = 104000        ; Short vector mode
              110000                  LONGV   = 110000        ; Long vector mode
              114000                  POINT   = 114000        ; Point mode
              120000                  GRAPHX  = 120000        ; Graphplot X mode
              124000                  GRAPHY  = 124000        ; Graphplot Y mode
              130000                  RELATV  = 130000        ; Relative point mode

              002000                  INT0    = 2000          ; Intensity modes
              002200                  INT1    = 2200
              002400                  INT2    = 2400
              002600                  INT3    = 2600
              003000                  INT4    = 3000
              003200                  INT5    = 3200
              003400                  INT6    = 3400
              003600                  INT7    = 3600

              000100                  LPOFF   = 100           ; Light pen off
              000140                  LPON    = 140           ; and on

              000020                  BLKOFF  = 20            ; Blink off
              000030                  BLKON   = 30            ; and on

              000004                  LINE0   = 4             ; Solid line
              000005                  LINE1   = 5             ; Long dash
              000006                  LINE2   = 6             ; Short dash
              000007                  LINE3   = 7             ; Dot dash

              160000                  DJMP    = 160000        ; Display jump
              164000                  DNOP    = 164000        ; Display NOP

              170000                  STATSA  = 170000        ; Load status A
              173400                  DSTOP   = 173400        ; Display stop and interrupt

              001400                  SINON   = 1400          ; Stop interrupt on
              001000                  SINOFF  = 1000          ; Stop interrupt off
              000200                  LPLITE  = 200           ; Light pen hit on
              000300                  LPDARK  = 300           ; and off

              000040                  ITAL0   = 40            ; Italics off
              000060                  ITAL1   = 60            ; and on

              000004                  SYNC    = 4             ; Halt and resume in Sync

              174000                  STATSB  = 174000        ; Load status B
              000100                  INCR    = 100           ; Graphplot increment

              040000                  INTX    = 40000         ; Intensify vector or point
              001777                  MAXX    = 1777          ; Max delta-x
              001377                  MAXY    = 1377          ; Max delta-y

              020000                  MINUSX  = 20000         ; -ve delta-x
              020000                  MINUSY  = 20000         ; -ve delta-y

              017600                  MAXSX   = 17600         ; Max delta-x in short mode
              000077                  MAXSY   = 77            ; Max delta-y

              020000                  MISVX   = 20000         ; -ve delta-x
              000100                  MISVY   = 100           ; -ve delta-y

              000000'                 	.PSECT

                                      ;       Simple PDP-11 program


      000000' 012706  037776          	MOV	#COREND-2,SP	; Set up stack

                                      	; Constants held in registers for quick access
      000004' 012705  172000          	MOV	#DPC,R5		; Address of DPU program counter

                                      	; Set up interrupt vectors
      000010' 012737  000364' 000320  	MOV	#STOPINTR,@#320	; DPU DSTOP instruction	(priority level 4)
      000016' 012737  000200  000322  	MOV	#200,@#322	; new CPU priority = 4 - no nested intrs

      000024' 004767  000016          	JSR	PC,GENDPROG

      000030' 012715  000410'         	MOV     #DPROG,(R5)	; Start graphics processor
      000034' 000001                  LOOP:	WAIT			; Mouch about...
      000036' 000776                  	BR	LOOP

                                      	

                                      ; display 0: figure 4-14: Horizontal Vector Angle Pattern
                                      ; display 1: figure 4-15: Vertical Vector Angle Pattern
                                      ; display 2: figure 4-12: Octagons pattern

                                      ; Locations of the three display files,
      000040' 000001                  DISP0:	.WORD	1
      000042' 000001                  DISP1:	.WORD	1	; display1: figure 4-15
      000044' 000001                  DISP2:	.WORD	1

              000002                  NDISP	= 2		; number of display patterns we have

                                      	;		Create display program
      000046'                         GENDPROG:
                                      	; R0 - next DPU program address to write to
                                      	; R1 - Y coord for RHS of sloping vectors

      000046' 012700  000416'         	MOV	#END,R0	; start of new code

              000040                  STEP	= 32.		; y increment.  Must be exact divisor of HEIGHT(=768)
              001740                  XSIZE	= WIDTH-STEP
              001340                  YSIZE	= HEIGHT-STEP

      000052' 010037  000040'         	MOV	R0,@#DISP0	; remember address of display 0

                                      	; draw all lines in both directions: they should coincide.

      000056' 012720  114000          	MOV	#POINT,(R0)+
      000062' 012720  001740          	MOV	#XSIZE,(R0)+			; Line from Bottom right
      000066' 012720  000000          	MOV	#0,(R0)+

      000072' 012720  110000          	MOV	#LONGV,(R0)+	
      000076' 012720  040000          	MOV	#INTX+0,(R0)+			; to top right
      000102' 012720  001340          	MOV	#YSIZE,(R0)+

      000106' 012720  061740          	MOV	#INTX+XSIZE+MINUSX,(R0)+	; to top left
      000112' 012720  000000          	MOV	#0,(R0)+

      000116' 012720  041740          	MOV	#INTX+XSIZE,(R0)+		; and back to top right
      000122' 012720  000000          	MOV	#0,(R0)+

      000126' 012720  040000          	MOV	#INTX+0,(R0)+			; and to bottom right
      000132' 012720  021340          	MOV	#YSIZE+MINUSY,(R0)+

                                      	; loop to draw sloping vectors
      000136' 012701  001340          	MOV	#YSIZE,R1

      000142' 012720  114000          	MOV	#POINT,(R0)+		; Move to bottom left
      000146' 012720  000000          	MOV	#0,(R0)+
      000152' 012720  000000          	MOV	#0,(R0)+

      000156' 012720  110000          L5:	MOV	#LONGV,(R0)+		; line to rhs of screen
      000162' 012720  041740          	MOV	#INTX+XSIZE,(R0)+
      000166' 010120                  	MOV	R1,(R0)+

      000170' 012720  061740          	MOV	#INTX+XSIZE+MINUSX,(R0)+	; and back
      000174' 010110                  	MOV	R1,(R0)
      000176' 052720  020000          	BIS	#MINUSY,(R0)+

      000202' 162701  000040          	SUB	#STEP,R1
      000206' 100363                  	BPL	L5

      000210' 012720  173400          	MOV	#DSTOP,(R0)+	; End of DPU loop - check switches again

                                      	;		Display1: vertical sloping lines

      000214' 010037  000042'         	MOV	R0,@#DISP1	; remember address of display 1

      000220' 012720  114000          	MOV	#POINT,(R0)+
      000224' 012720  001740          	MOV	#XSIZE,(R0)+			; Line from Bottom right
      000230' 012720  000000          	MOV	#0,(R0)+

      000234' 012720  110000          	MOV	#LONGV,(R0)+	
      000240' 012720  040000          	MOV	#INTX+0,(R0)+			; to top right
      000244' 012720  001340          	MOV	#YSIZE,(R0)+

      000250' 012720  061740          	MOV	#INTX+XSIZE+MINUSX,(R0)+	; to top left
      000254' 012720  000000          	MOV	#0,(R0)+

      000260' 012720  041740          	MOV	#INTX+XSIZE,(R0)+		; and back to top right
      000264' 012720  000000          	MOV	#0,(R0)+

      000270' 012720  040000          	MOV	#INTX+0,(R0)+			; and to bottom right
      000274' 012720  021340          	MOV	#YSIZE+MINUSY,(R0)+

                                      	; Loop
      000300' 012701  001740          	MOV	#XSIZE,R1

      000304' 012720  114000          	MOV	#POINT,(R0)+	; Move to bottom left
      000310' 012720  000000          	MOV	#0,(R0)+
      000314' 012720  000000          	MOV	#0,(R0)+

      000320' 012720  110000          L3:	MOV	#LONGV,(R0)+	; line to top of screen
      000324' 010110                  	MOV	R1,(R0)		; no ()+ -- need to intensify it as well
      000326' 052720  040000          	BIS	#INTX,(R0)+
      000332' 012720  001340          	MOV	#YSIZE,(R0)+

      000336' 010110                  	MOV	R1,(R0)		; and back
      000340' 052720  060000          	BIS	#INTX+MINUSX,(R0)+
      000344' 012720  021340          	MOV	#YSIZE+MINUSY,(R0)+

      000350' 162701  000040          	SUB	#STEP,R1
      000354' 100361                  	BPL	L3

      000356' 012720  173400          	MOV	#DSTOP,(R0)+	; End of DPU loop - check switches again

                                      	;		End of DPU code generator
      000362' 000207                  	RTS	PC


                                      ; What to do on a Display Stop interrupt
      000364'                         STOPINTR:
      000364'                         L2:	; test switch register and select appropriate test program
      000364' 032737  000001  177570  	BIT	#1,@#177570
      000372' 001003                  	BNE	L4
                                      	; display 0
      000374' 013715  000040'         	MOV	@#DISP0,(R5)
      000400' 000002                  	RTI

      000402' 013715  000042'         L4:	MOV     @#DISP1,(R5) 	; Restart graphics processor
      000406' 000002                  	RTI


                                      ;		Display program
      000410'                         DPROG:
                                      	; Set up, point mode, intensity 4, no light pen or
                                      	; blink and solid lines. Move to (500, 500). Enter
                                      	; long vector mode

      000410' 116524                  	POINT+INT2+LPOFF+BLKOFF+LINE0
      000412' 171240                  	STATSA+SINOFF+LPLITE+ITAL0
      000414' 173400                  	DSTOP	; cause it all to happen

      000416'                         END:	.END

No errors detected

Assembly statistics (words):

           Absolute   Relocatable
Code            0         135
Reloc. info     0           7

Space used for symbol table: 1080 words
Total workspace used: 1349 words
Assembly complete
