program test,,globals input: .blkb 500 ~inpt: .word 27,81,0,100,200,65,0,100,250,65,0,120,250,65,0,120,200 .word 65,0,100,200,67,4,81,0,105,205,73,79,50,79,100 .word 27,27,27,27 ~addr: .byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 .byte 0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 .byte 0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 .byte 0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 .byte 0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 .byte 0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 .byte 0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 .byte 0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9 function main[argc,argv] register stat,len,i,ii auto num,num2,num3,color auto ans,stat1,stat2,stat3,x1,x2,x3,x4,x5,x,y external aedinit[*],obyte[*],verbose,printf[*],aeddma[*],scanf[*] external addr,eprintf[*],input,inpt,bobyte[*],aedflush[*] { scanf["%d",#verbose] aedinit[0] ;aed assign and init ; ; verbose := 1 obyte[1,1] ;select terminal 0 obyte[033,0] ; turn on interpreter obyte[72,0] ;select parallel port obyte[`P',0] ; part 2 ; num := #addr-inpt \ bits[num,0,1] := 0 ; loop for x := 0 to (num-1) ; y := 0 \ bits[y,0,8] := inpt[x,w] ; addr[x,b] := y ; next x ; if num3 == 1 ; aeddma[`w',#addr,num2,42] ;write dma command list ; else do forever loop for color := 1 to 8 ; eprintf["doing color=%d%n",color] obyte[67,0] obyte[color,0] loop for x := 0 to 511 aedmove2[0,483] aedline2[x,x] next x loop for x := 1 to 511 aedmove2[511,0] aedline2[x,x] next x aedflush[0] next color od ; fi } function readcap[s] register x1,x2,x3 { if s == 0 s := "" fi obyte[106,0] ;read cap x1 := bits[obyte[0,4],0,10] x2 := bits[obyte[0,4],0,10] x3 := bits[obyte[0,4],0,10] eprintf["%s cap is now %o %o %o %n"s,,x1,x2,x3] } function moveto[x,y] register high { high := 0 obyte[81,0] bits[high,0,4] := bits[y,8,4] bits[high,4,4] := bits[x,8,4] obyte[high,0] obyte[bits[x,0,8],0] obyte[bits[y,0,8],0] eprintf["moveto: %d %d (%o %o %o)%n" \ ,x,y,high,bits[x,0,8],bits[y,0,8]] } .end