REL..T M. L,:i. b r". y o f, o u t,:i n i s. e d i R e::a' T i T e iM. c: h i n e C o r' 1 A p p 1 i. c::'t i o n s b 1F. d. L.a u d e. r b,. u rhi L. + I%' L'L e rb'du:1e A G+ U. l soy "' e: hs i: c: 1:.: e p o'{ t N ) rI b e. r t h i - M ". 84.. 4. 24 I) r t r p. t s e e c: ri E. tc'. n, i n e 3ri n - a r'i l A p p i:1.:i. e Cd M i e c h -,. n 3i c: s U':i. e:r. s y.. o.: M c: I. i'.:. 1,a n A o t, M I' 481. 09 — 1.. 2 5 M'a,:l y "9 8'4.

RELTIM L:IBRARFY DOCUMENT ATION P'AGE 2 TAPBLE OF CONTENTS Chtapter 1 Introductionr 1 - Chlapter 2 D:iLital to Anal.o~ and n r. o to I:t i gi i ta 1 Con ve rs ion R o u t i. n es 2,0 Intr ci d u c t ion 2-1 C h a p t eIr 3 P a r a 1_1 t Ve R r n. t t. i n c'. CIi'"apter' 3 F'''ra.lI el Input/ChiOtp It Rou.Ptinres4 3 n Introd uction 3 —1: 3. 1 DRFVWRT 3-6 3.2 DRVRED -7 C l. ap t e tr 4 F' ro rs ta m m ia bl 1 e FR e, a l. T i. m e Cl. o c: K FR out i n e 4. 0 I n t r o d u c t i )o n 4 -- 1 4 1 STRCLK 4-3 4.2 STF'CLK 4-4 4.3:3E.:F'T I: M 44 44. SETTIM 4 M C:: h a p e t. 5 F' e, e K a n d F:' K e F ou:i. ne s 5. 0 I n t rod u:c't i on -1 5. F:' EEK 5-2 5.2 F'OKE 5 3 hF p p e n d r i e F. B D i e The sc rp i pt:i. on o. ib ra r y F o u. L i. n e. s Ap p e ndi. i B H1ia rd wa: r I n a 1. H a,t ion Na ot e s (is p p e n d i x C Ha r d w a re I ri to r' i o R e f e r e n c: e s Ap:,pen di.'x D Librtary Devel.. op men t Histo:' ry A r pen dcl i.: E Li b ra ry S-our. c:e C. ode L j. st ji. s <.

CHAPFTER 1: rnt ro d uct: t' i cr n Thi-s:doculim.:-ent describes'a library of FORTRAN callable routines.- cial.led RFELT' I M LI: ] B f t. t a t.' we re ci c'v'. c oP ed.Fr Co'. use i n r e a]. t i me rf,'cl i. n e c on t ro 1 a p p 1. i,::k t io n s. The (fou r eneral. cte:: te or i es o.f r o u t i n le. and la b ri ef' desc: ri. p tion j. r'e i'-. ven h bel.ow,+. A more detailed descri.pt:i.on of each clatiagory of tlou t:i. nei. is j:i.ve (. In i.n the succeed in g chap ters Chapter 2 d i. s scus. es the D i. i. tax.:1. t.,: An a. ( X:, IAC) C and A rilt. o, to I i. i t al. C onversion ( A IDC ) R ou t i ne s C( h:t p t cl u s e 3 d i s c u s e' F a r 1 e 1 I p. t / 0 u'. p.u t (I / 0C ) R. o ut i n e s ^ C h I:p te r 4 d i. c u s s e h. l F' i:,rr! ab r Rer! a b.. ime 1 c lo K R o u t i n e s And fin a 3.. y' Ch apter 5:!i..:: u..s. ii: e s t h e e.? eK a n d 1P o K. e R, ut.t:i. n e Cs. iD A C: /- i:()1'. C':::, Ru t i. n e'-s; Tf h eise r' C) u t,. i n e s. o p er te r t h e Di ii. t a. Eq u i p' m i n t Cr o r p o r a'. cn (i EC ) A I 1. - A i:L t. a t o A. n la I o'5 C o n v e rtery a n d t i 1h e ADV:L.. -A A n a l. o'a t I. i'a 1 C o n ve rt e r "T' hr e uti n es,: l. lo t h e u s er to s.e n cl a vol.t, e c:u t through a. iven cthannel,of thle -DAC i(y or rea:lad a vol.'ta.e.e in F'rom a 11 iv en c. h annel o f th|e A IC, i:: r 1cl. 1. e.' I n::. t / 0 u' t p u t t F.. o u t i. n e s Th es.s e Tu:) t:i. n esT p e erat p e t h e iC. DRyi. C, 1 — J H:i. Lh nI e s it 1 y F' 1: r,a 1. 1 n', e rI ter- c eP T i e e'r I.':.'n 3..a W. t. o t h e r to w r i t e c:. u t, o r e ad. i a 16 b i t b:i. n a r: y n u m b -' t'yo:: r o onm,, r'i e: of f o. 1r c~ h'a n n els P:' o S a: 1, Rr,:: 1' i: C.. i... t.i n e: T' hi e e u t.:. i. n.e. s'. )r.e 1. ecl'to c. o p e riate Lt- le t. DEC KV 1 - C RPof.' ra ma,: b i e e,]:. i L T me C: o' c: K. T h e r:: u t i. n e s a:33..I. w t h e u i. e r to.'a, t a C r o a' p t p'e' c 3. o( c: K I y e e p't r'a c K o F,y ac r i e et:. h i m e y i n hi o u r s y m:i. n utes s. ecs:r c o n d s,, n d m:.i.1:i c o n d s e F' c: e K a n d F'K - F c, u.. i. t-in e s These rout3 ines' llow th e user r';c.' mb er toyv o r rea. d'a. ru.lm be r Y' r om,'a i. v: e'r a, c Cd re e- t: ssi i. n m e mr o Tr y

CH F'T E R 2 DI:i.gittl to Anralo].o,ard Antalo]. to I:ig.ital Conversion RFoutines 2 L 1. In troduct i on T-hii.s c:ht, ap t er lis cu sses t.wo r.out ine.s. t" h,:t'a e usecl to o pe,ate tL I e I)EC AAV1.:I. -- A 4 Channel 1:2-Bit ID/A Converte'r amnid the AD.V11. —A An,.al.o —3'to Disital C1 o. rn v e r t. e rT n: i. sc, iscs l. on o r t h i s c.s i e c r:. is:i.i e n i s t h i s, n. tr o d ucti, on. (Lr mo're deta:i.led c es:: rip t,:ion i s con t.'.ained in th e f':: olowtin:L sec tiorns. c tion 2..2 dciscusses DAC and Section 2.+-3 di.:scusses ATIDC+'S. c.: c:. i. t + n c2 i. >c.....,. ci:,>! c: t i. cr/; 2... c.., ses I:.+ 2.1. s:!. 4 (.r ( r:. C,:po. bJ' i a. l ~p i.' ie The e:neTraCl ciapab ilities of the two routines lare D:IIAC A DC D)l.t.1.-Y1y which is p.rop::'ortiona:1l'to the vo.lta.'.ae'appli.e: to the chan — n e l +

Dii. jit'al to Anialo5t,and Analo- to Di'ital Conversion F.Routines PAGE 2-2 2. 1. 2 u t.:i. n re Ah T' c u m e tts The largtumernts u.sed by Df'C'and ADC a ret C: HI AN N N O' lThie ch nlnel thalt the us;er wiants to o write to or rTead from. In rout. mine IDAC CiIHANNO can,assume the values 0, ly 2, or 3, corres:.F pondirin to chiannels 0 1 2 P and 3 T'espetctive 3.y Irn routine AIDCI CHANNO can a:ss.ume the values 0 th rough. 7, cor respondin' g to chtannelsl 0 thr'ough 7 rerspectivel y+ No e'.rror checKing is done to ensure th II at CHHANNO 0h al s lan Ila c cep t abl: 1e v:al ue. CH!.. ANNO i s Lan I NTEGEC.'S2 va'ri abl e DACV.AL 1Thle cldj:i. ita rnumbe r th a:t is sent to the AAV 1.-A f or c.onve rsion. nto o.n.ana"::l.o(:t volt.a-e * The tanalo1 voltiage is di.rec:tly proporti.onial to the c. i i t,:l. nuumrrbero: (iAC.VAL. c'an r'an:'.e from 0 to 4095:, w h i c h will. c a u se vo lt'aes o(f -5 +.1 v and +5,12 vy respective yy -to'appe"ar on th.e selected channel. The chart below sthows the rane. of dCiit%,:al v a: lu e.,,: n d the co rr espon d i n a: alo ]. O v ol't' a es D AC'VAL is an I NTE GER: v ia i. i. le I'Di,:ita3. Nu. mber.! 0000! 2048! 4095 F'rci: c:,or t;ionac.'Voltge3 -. 5+12 v! 0 0 v! + 5 3. 2 v Two us.eful FO" 0F.TRN ormul.as. for use wit.h DACAL are iv en-. b e l. o w The first formulRa calcu. c. l -ates t the.s t e o ut t o.'te ( 0 U tV t 1i s iS ener d by'a i ven valu 1 of ACAL.. e sec: on d fo rmu.. cal cui. a t' e's the va 1.u e oF D C V A IL r e q u. T't e t o - e in e rT: t e'a a i v e n o u tp u t v o i j. t:. +e (:OUTVOL.) ( Dl A CV'L. -. 2048 ) / 400 ( )) DACVL.:::: IFIX ( L (IYUTVL > 400' * + 2048 ) (2) X:1: A L.. T h e d:i. i a.i:.. v 1. u e r e'a cl f' o m he:.: V 1I.. A A n'a l1:: tC o D i. i t ta 3. C o n v e r t,e r *+. D C V A I... is d i r e c: 1. t y pi r' p o r t.. i o a: 1. t o't h 1 l.e vo.'t e': p et:: r i n o. t t he s e 1 e c: t e d c(:: i an n: 1. s "' h. n u. m L.b e. t o v o. t,a. e c: o: n r, i o n c h a zr t s how o 1t, n.I b o v e f) L so I s f o r A C V A.. 1 so s A D C. V A L. T w o. t e f u 1 F 0 R - TRA N f o r mu.. I -.... w i t h A I C V A L.. ar e i v e n b e:. ow T' h e f i'. st for mu 1,a c: a 1. c u. 1 I ae s the i vo: 1. t (e ( I N V 0 1 T ) t h,a t.. e n e.rtat e d t h e - i v e n v. ue c. F, Al CT, A 1... * T h er.: e c: Con d i c:. r mu 1 a. c a. ce s t h e va 3,. i ue of A I CA.v A L. tt h l woul. d be ene r a ted b:: ) y ta iven inp.t volt:a1.e *. A DCVAL is'. 3: N 7 T EE R~.'2 va,r 7' i,,a b'. 1 e I:NVJOL...T:= ( DLACVfAL -. 2048 ) / 400 * (3 ):CVA.. ^ -: F'IX ( ( IN VOL.T *. 400 ).. 2048 ) ( 4 )

D:i.Sit:ail t o Aniralo. and Antalo to Digital Conversion Routines PA IGE 2 -3 2.. 3 Sou re 1 Code The source code for the routine DAC is iKLDAC.MAC. Tlhe source code for the routZine ADC is LKL'LAtDC.MAC. 2 <..:. I 4: nstallation Notes Tihe'addresses of the regi.sters of the AAV11 —PA anc the ADV l-A should be lat the fiactory confil.uration for the, routines to wor'K proper"ly, IPf the register adldresses hIave been chanreed, the routines must'also be c:hf'naried The f~actory c.on fiur.ation for the register taddresses is AAV11 —A Ii, ittal to An alo1 Converter Factory Con.fi.urlation of,Reister A dd resses. Re5i.ster! PRegister l Mnrr temorn ic! Oct t l.! Symbol! Addres.- s I DAC 0! 170440!! DAC 1 170442 \ DAC 2! 170444! D! C 3! 170446 ADt l-1 1 A Analo to D:i. ital -Converter F a c t o r y C o r f i s u 1r ai t i', i o tf R e i r.Stse s' tAdd Ts e se! ReEist r. t! e:i.st Ter!! Mn emIf on i.c! O c tIal.!! S y mb o 3. A ct d r% es!! (.CS F.:!P 1.70400!! L:'BIPR! P.;'170402 2. * 1 5 F u rt t h e I n f o r mt i I:' r t e:i. n {'formta:tio n o on thie A t' l.1.-(Ay:l'nd the ADlJ. 1.-A 1: i. s a,:vai laibl. e in th e f:o ]..w i n. p u I::, ].. c lt i on t Dt G I TI A -- M i c roc.opu o p t e r: n te r F'ac e s IH-an ci b oo1k

Di:i.itl]. to An1alo and Anal.o to Di:ital. C[onversion Routines FPAGE 2-4 2. 2 DAC The FeFORTRANi calla].,ble MACRO-11 subrocutinje DAC iis used to wrTi.te at diSital nu1mber (DACVAL) to,a user selected cha:nnel (CIHANNO) of the AAV11 —A. At the AAYl'. 1.-A, a n output voltaJe:i.s gener ated which is directly proportional to DIACVAL DACVAL cia.n rrange in value frrom 0 to 4095, corresponding to voltage values of -. 5.12 v and + 5 12 v respectively The volta'e val ue co:rresponding to oany digital. n.umlber can be c.al.culated by linear interpolation (see for-lmul3as 1,and 2'above) The chlannel. nrurribery CHANNO, can ranre in vtal.;ue f.rom 0 to 3y corresponding to channels 0 through 3 of thire AAV11-A r. e sp ec t:i. ve ly. + Thle syntax of'a c'all to DAC ist I'NT:EGER CHANNO,'DACVAL CALL. 1.:IC ( CH ANNO DACVAL Some s'amp l e calls'are CALL DA C ( 0,: 4 T'his c:: &a13. ca uaii es a volta e of' 5'!2 volts to'appear on ch'annel 0 of the CALL... I:AC (:1 024 )'T Ii'-:.::,:]3...cau s,: v'olta Se cof -. 256 vol.ts tco,app ela ocr c h ann e 3]. of th e AI X:i V 1.:i. - 1, +

IX:li.gital to Analog anil d Analo]g to I:giittal Conversion Routines FAGE 2-5 2.3 A 1-DC The FO:RTRAN calliable MACRO —11 subroutine ADC is used to re adcl a digital number (ADCVAtL,) fr*om a user selected channel (CHANNO) of the ADV11-A Anialog to Dil.ital. C.onverter, ADCVAL is directly proportional. to the voltage'appel-earirn on the channel of the ADV11l-A, ADCVAL ctan rtanre in value from 0 to 40095, correspondcing to vol.ta.lges of - 5, 12 v,and + 5+12 v respe.ctively. The vo 3. ae vae lue corresponldinc to any ADCVAI_ can be calcul:ated by line'ar inte rpolation (see forlmul].as 3 andri 4'above) The channe]. numbery CHANNO, canlr rTan5e in value f rom 0'to 7y correspodi t chranpoding to channels 0 othroul h 7 of the AA11.-A respective.ly The syntl'La of a cal. l to AlDC is. INTECGE:R CFHiANNOY AI:ICVAL CALL.. ADC ( CHANNO AD:CVAL ) Some sample cealls a re+ C(;ALL AICC ( 4y Ai:C'VAL. ) Th:iJ.1 ca1 l,reads the di.S'it.al n.umber correspondin to thle vot a. tl: ie ap ppe arin onr c:lhtannere. 4, r'and assi.gr'ns the nlumber to AI:CVAL. If -the vc:,l.t:xaLe was + 2 56 v AIDCV'fALs woult.d be equal'to 3072+ CAl...L. AD:tIC ( 7 NUMBE:R ) Th": i. s (:,:ll'a?. r e'(: t he c i. s i. tl:iL "a:i: r o- l.lL co'i.n i to the v o L ta- e a p p e'a r i. n o)n:c: h i'a n I e]. 7 and a. ss:i.r c s th e v:.al ue to N UMBIEiR If- the vo:].tale was + 3 + 84 vy NU i E wLo.l. d be eq, l. l:L to 3 584.+

CHFlFAPTER 3'a ra 1:el e1 Ir put./Ou.t' p ut R o.'It iu nes 3 n1'I t r Iod uc t i (o n "T i:li. s c::i i: t,: p Tc'.i sc ut s t e oi Sro ut t. e two n e s u s et to o p e re' a ti e:) E C ti R y 1 -J Hi-i-h - 2ensity F Pari. l. l. el I n' te trf c e + A eneral d i. sccu.ssio.in o.f thi e routines is:. i v e i n h i s i nn t,. t r d u c t i o n m c T e c e t a i 1. e ci d e s cT' 3i. p t. on oC C t!h" e two T, rtit:i.ines. is iven i. n the i.fo'( w: i.w n sect i.ons, S'Sect ion 3, 1 dc i sc.isses DR VW RT Y a n d S e c: ti. a n 3 2 ci. s c:. s s e s I t) V r E I: 3.1 < 1 i General Cl aptb iliL ties Ti.he s.:jner'a.e. l cap abiliti. i i es of' t,hle two' rou'tines aTre+ Di 1. W 11: T Wr i te. s a 1.6 b i b j n a ry number ou t t o a useT' se 3. ect e cl c h a nne 1l o f th e: RV. E: X: R e ta s'a 1.6 b i t b i n: a ry n u m b e i r o m ta u s -l r; e i c h a. - n e o f thi e D:R i. F.t -.-.!

F' ar,.'?.. e. Inp u t/Outtput t Rout ines F'AGE 3-2 3*1.2 Rou. t ine ArSlument.s The: two-:, formal,.Iargum-erents for both LIFRVWRT'and DPRVRED:I,arT e Ci 4ANEL.'The chiarnnel thlat the user wants to rT'ite top or retad from. CHANEL c:tan tassum e the vallues oF, 2, 3, or 4 which ~irepresent ch1annels Ay By Cy C'r DI respective.ly0 No error r: 1hecKin. T is done by the routines to ensure thaLi"t CHtANEL itas li'n laccep'table vl.ue Ie CtHANEL is,an INTEGER:2 variJab.le N.i jB Ei" R F The number th at the user wnts h t. e o write to th e selec ed channel. or the number thtat:is -rea.d from the;se:l.ected ch.an r inel + NUMBER is,: n I N TE 2 vi ria an i:b 1 e,i n d1 i. s. r e p resen e t ed b the L.S -. 1. /23 i n Ltw c' c o m p l e m e enti t o forrm:i.f i;ts v al. ue:i.s n e Iega tive * The tabl e below shows the p') atte r'rn oif c in ver si o. l 1.etween 1a deci maj.r l i. n te.e r v alue,. n d i.t t o s c o p 1 e ml e n t b i n.ar i y land c t a1 r ep'er e se n t't io' n s The two s c omrp.eer1ie t:i,'ry cr' o he ntu. ifmn il: e'm re i. wh alt ap p peta rs at the p a. r aie1 i/L I/ p or t r i.n,. A rTeadcl o r w rite oper ta':i.. c) i on

a:' a r:1el. I n pfu t / 0 u'tp u t R o utines PAGE 3-3!SIGNED! TWO'S COMP'LEMENT! DECIMAL.! BINARY OCTAL VALUE! REPRESENTATION REPRESENTATION! 0! 0 000 000 000 000 000 000000! 1 0 000 000 000 000 001! 000001!! 2! 0000 000 000 000 010! 000002!,, t,!,!! 7! 0 000 000 000 000 111! 000007 18 0 000 000 000 001 000! 000010!9 0 000 0 0000 001 001. 000011.'::2764 0 111 1 11 11 1 100! 077774! 32765! 0 111 111 I 1. 1:11 101 1 077775! 32766! 0 11: 111 111 111 110! 077776!'3'.767! 11 1 1 111 1 111 111! 077777 -- 327638:! 01 000 0000000 000 000 100000.... 2767:1 000 000 000 000 001' 100001 27- 7:1. 60 000 000 000 010! 100002.- 1 006 000 00 000 0 0001. 1.:100003....-......... i! I 1 - 4:I.1.:1 111.. 111.:1.1 100 1.77774!-I 1.:.1. 3:1.1.1. 1.1. 1 1. 1.::. 1.077775!!.-2!11..1 111. 111J.:.:1.0!77776 f',:: 3::. 1 I:l e c: i m::1. / B i:n a:: r' y / 0:: t 1. C o n v e r s:i. o nr

F' araI, l. lel Inpu.t/Output Routines P AGE 3-4 3 +1. 3 Protocol The plartallel I/0 routines allow the LSI-11 to c:ommunrJ:i.c:ate with ex>terior hardw are devices through the.DRV l -J Highi Density P arallel. Interf'ace. Since the DRV11-J is triansrceivin.5 electric'al si'gnals to and. f romt ex terior hiardw'are devicesY the timing of those sisnals is very ismportant It would be pTrudent to miaKe sure thiat the device is ".istening' when thle DIRV'l-J is "t.alKin" n and vice verssa The DRtV.1-3J comes with 4 protocol signals to ensure thiat siSnhal synch roniziation Since DRVWRT land DRVRED were not written with tany specific h'ardware device in m:i.ndy they maKe virtulil.l y no use of the protocol sigrnals* The only protocol siSnal used is the USER RDY (user device relady).i.in'al* The USER RDY pin (pin 23) of the c:hlrannel. in use must be.grounded( (by the user/user's device) for the DRV11-J to be able to WRITE out'a number Note tha lt the DITRVF.'-J can READ whether or not the USER RDY si.gnal is. c:rounded Another protocol si.ign al which is rea.dily. av'ail'ab.e f'or use by'a user device i.s the DRyVIJ 1 RD Y sig,:nal].* The DRVI J RDY si..nral (pi.n 24) of the selected channel goes hish (+ 3 v) when a write oper'ation is performed The DRV11J RI:'Y s:i.na] remaainrs high until. a read ope r.at ion i.s pe'rf o'rc. mey at which point it is -oes low (0 v) In,e ral, the use i. rs j. p espo n-si. b. e f or s i r n a:l s]. y c h con:i. zla t i. on. Th le u ser' s devi.ce must be relady to. receive or send la number wheln thIe DRV:11..-J is wrTit — i. r oC' re'ad in s o. number r esp ec t i vel y Ful rth e r info rm:iat ion on s i n a11 l p r o otoc1 s aol i. ailal:b e i.n e D11 — — J Use r' Guide listed below. 3. 1 < 4 Si.' n,1al Levels The vo:)1 ltage values th alt must axppelar on t he pa rta lle..I/. C p o' rt p ilns. for p r op — er' op>er at ion -. Tae I n p ut, / 0 ut p ut S i, a 1 s 1::= + v 0:::: r u. nd P r ot oc ol S i -n r,:.. s:1. g round 0 + 3 v 3:..5 Souce Co d e The so:.rc:e cc: oe C for th e rouI:tnes DRVWRT,and Dl V R E. D i.; s 1 c:'at e d in. th e. i 1 e XDt::.:.J *MACP

FPa' al. el put/Ou tput Routines. PeAGE 3-5 3 *:L + 6 Install].atio N otes The taddresses of the rei;isters: of the DRV1J1-, should be inrsta.ll.ed at the ~Fiactory conf-'iu. irlatiorn for the routines to work properly+ If the resister ac ddrTeesses have been ch.an ed, thie routines must also be c:hanged+ The factorTy co C Pur n F F. o i u r 1:r the re fis ter add. esses is Dr V11 H ih'Jen:sit y P arall el. I n t e' a c e F ac1i to y Co n f i. ur at i on of Ret i ister Ad t r - es ses!Reti.ster! Register!! Mnemc:nic! Octal!! M r e Xc ro ni. c: n,] L! Symb3ol! Address s CSR A! 764160! DBR I! 7641.62!! CSR B! 764164! DBR, B! 764166!! CSR C! 764170!! DBR C! 764172!! CSR! 764174 I rB;', D!1 764176! 3 +:1. 1'7 F u r t L e:'t I n.F o rn M t t:. Cjo n F u. t h e: i. n o o.:I t:i. on o n ts h e D: l' V:. 1. - I S a v.. la, fr o t h e f o.. ow i. n - p 1.1 bl i. c t i JI. t:; Dl 3: T L... M'i i. c: r' coi c: o m p u't e'' r I n t e r. a c: e 1 a nt cI b:: o K DI (:i" T Ar.. L FV 1.. 1-,-J F'. 1aral Li re:1: I te r.: s es G'i c. e

':a rall.e Input/Output Routines PFAGE 3-6 3. 2 DRVWRT The FORTRAN callable MACRO-1. subroutine DRVWRT is used to write a number (NUMBER) to a user selected cha.nnel (CHANEL) of the DRV11-J par.allel I/O unit T'he 16 bit binary number sent out must be'a vialid INTEGER*2 value (-32768:: NUMBER < 32767). Nelative numbners are represented in. two's c:onplemnent form as shown in Tabl.e 1 above+ CH-ANELy an INTEGER*2 v'ariable, c an tiaKe on the values of y1 2. 3, or 4 to represent ch'annels Ay B, C, or D resp ec tively The USER RDtY bit (bit 23) of th-e selected port tmust be,r ounded if the wri te is to occur, If the USER: RDY bit is not grounded, a:n error message will be printed out on the te'rminal. The syntl.a of a call to DRV WRT is'. INT[E:GER CI-IANEL, NUMBER. C'"ALL. IF-VURWF.:T ( C.HANE:L NUMBER ) Some sample calls,are: CALL LJRVWRJT ( 1 7 ) This- c all.. sends the binary nu.mber 0 000 0 00 000 000 1 1:1. to channel A. CALL i1RVWRT ( 2 32766 ) Thi:s -all:. s;ends the bIi.in.ary n.umber 0) 1..1 111 1. 1..111. 1 10 to cfhl'ann el B CALL. I:Ry' WRT ( 3 — 32767 ) Th..isL call sends th.e bin lYay nl.umbe'r 1. 00 000 000 000 00:1. to( chalnnel C+ CALL I:IRVW!:'.T ( 4 -1 ) T'h:i.s c:. ll sends the binary number.1 1.l 1 1..1 11.. 11... 11 to cha. nnel D

F'a Trial.lel Input/Output FRoutines PAGE 3-7 3.3 ~;DRVREDl The FORTRAN cal].l.able MACRO-11 subroutinte.DRVRED: is used to read a number (NUMBER) fPromn a user selected ch anrnel (CHANEL) of the DRVl1-J parallel I/O unri. t A 1.6 bit bin:ary numberT is read f Trom the se].ected c:ha:nnel, and,assigned'an INTE(GEF>I.' 2 value I.f the most si.nnif.ic,'ant bit (bit 15) is high, th'e l.numTber is,ass.lfumed to be rnegativey and is interpret.eCd as'a two's comfrplement -numt ber (,as in Tiable I1 a.bove), CHANELy an INTEGER,'2 variable, can taKe on th e values of I., 2i, -3. orl 4 to represent chtlanne.ls; A, By Cy or DL respect iv el ]. The syntax:, P'a call. to I RVRFED is: INT:: I E GER F C: FIANEL., NU t.iI i E. R CALL. i:RF'FRE ( C2: I-AN.EL NUMBER ) Tb isD~ c'a 1 1 sre'acld thle I:r:in a ry wov~r:cl th'at, is- p rs er:i t3r. b:'..y on C:: h l'anne I,iy'anc c'ass iln sD S o,i, e. i r p 1 e c: TE. v] a ]. se t, NtriEEF C'AL!.L DIRVF:,',E'D ( 2y NUiMBI?,ER ) T':.i-:. c,a:. e, a d s t- h e i::- n,a' y w o d't.i. s p r e s e r',''y o ir' c: h-i"ie B y.and, s s i. n s 1the equvaet.. INT. E-GER v'2.alue to NUMBER+ CALL TDIVRED:E ( 3y IVALUE ) T l:i. s c 3. ].'e.. cls te b i. n a r y wo C tb h,at i s p e s e n'' 3. y o:: h,a n n e C: y an d, s s i n s the es.: T:i. v:i. en' t il. ]: 3 uT E: G E t.' 2 v,:: 1.u t. ]: V L. L.J E+

CH IAP TER 4 P'ro.riammable Real —Time ClocK Routines 4 * 1. Introduction This chapter d.isc ses the four routines ucsed toC oper:ate the DEC KWV1. -C F roria mmlblt. I.e Real —Tiime Cl.ocK A, eneT'tl d:. sicussion of the clocKI routines..is g iv e n i.n th is i n t r.od ci u c: t i * r. A moe cleta i. ei c e s c: ri i. p t i.:o n o f t h e f our rout:i.ne is is iven in the -Fol(.:Lowing sections. Section 4 1. d:i. scu. sses L STRCLK Secti i. on 42. c sc:usses ST'CL..K. ec tio. 4.3 cli scc:u ses i,;s KEPTIM a:nd Sec: tion 4+4 discusses SETTIM. 4.1. General Capabilities The gener 1al capi:abilities of the.our routines,. re+ ST'RCLK - St,: rt-s t he. c::. oc:K,STFCLK -- Stops the c:locki NKE'TIM -- ieeps the ti.me in hoursy minutes sEec<-ocitsy,a: n millf.]..3isec:oncids SETTIMi - Sets the te time in houLlrs, minutes secon ds c and mi..li seconids 4:. 2 R o u t i n e g u r( e n t s T h" e r ou. t i nes S'TRCLK a:n cdi ST P'CL. 1.: h ave ro.a rS umen ts * The r C:ut:li n e s K EPT I M an d. SE7 T Ti I' ui-se the FO:RTRAN, c:ommon bl ck..oc L BL*cK C i...BL. L..K must al. ppear in. the c: - 1.:i. n g p r:o a r' m n cd is d ees c r ibed b elow t The F'ORT'RA N synta, a. forT' th; e c cr mlmon b. oc: K i s+ 3INTEcGER HOUR, MINUTE SECOND, ti]: L.SEC COMMOiI)N / CLKBi..LK /.COUR MINU TE, S E C Nr I ) i' L': MI!:: It, <*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.

F' ror.lamtmabl].e Rerl.-Time ClocK F Routines PAGE 4-2 Th e commronr block v ar iables are described below' tHOUR + INTEGER*2. The present value of the time in hour s. MINULTE INTEGER* 2, The present valu.e of t t tie tim in minutes SECONI:I INTEGER^*2 The pr esent value of the time in seconds+ MIILSEC: INTEGER*2. The present value of the time in millisecondss. +41 + At ternative Interrup t Service Routines The clocKY when s'tarted by callinS STRCLKY will lenerate tan interrupt every 1. millisecond, A t eCach interrupt, prosr am cc:ontr'ol is trTansferred to an inter.rupt service routine. In our casey the interrupt service routine is KE: TI whic h Kee-.ps tr'ac:k of the time in ho ursl' mr:i. nutes secondsy and mil-:.i. isec::ond:is (note that K-EPTF'TIMi is NOT,a FORTRAN call'.I]...abl e s;ubroutine) It i j s ossib].e tha tt the 1user mi.Lght wan t to use a n int.erY'upt setrvice Toutine other than KETI ir F evx, -am ipiey the user migh1-it use 1a rout ine c al1led SAM — PL..E Y to sIamp ].e cldita.' f rom s -ome ete e. n teT'ral h ta rd wa're d evice eveTy 1. milli second T o i m: p 1 e m e n t L S A M FL tY h e u s e r.m u s t p ut t h e a d d r e- s:f t hF e f i r s t i in st r u.ct i o n of S A M F' L. E i.n t he f i r s t w: r d o f t h e i nte ru' u p t o n o v e rf]o w v e c t o Th is is idoni'e by tch -an:i.n n tlihe f irst ex.ecutlable st'atement of' the routine STRCLK. See th- e sou e codle f'or an exalmp l. e 4,,1*4 Source Code T' h e s o u Tc: c:d e f c.: e c:' te ct u:i. n e S TRC'L SC T PC L. y, a d KPT ETI M is 3. o c a t e d i. n ~th e.Fi i e C (' CMK ~.' A C The'. sourTce for the ro ut,ine SETT [IM is l c iated in the fi e..SE TT ]: M F:' ) 4 *:1. 5,:t'.i. o N ote s T h e,a (:1 d're' s e:::.f''f 1 e T. r-:i. s' e tr s o f th e i..1 - C sh ou Il. d be iat, th e.f ac tory c on -- *F:1 ul.: io,. n'L for' th:: 1i e (rou.. ti. n e s wto wo ri p trper 1. y f t he re i ste' a:id resses. hI, v e been c: h t'rl ie I. th e val r.. e o) f C fSRADRF in ST F::;C l...1' i:: CL.,' d K EP FT 3]: M.a n d t h e v. 1:I u.le c f.: F. I: DR i n S T R C..i K m u s t be (:: h a n e d: c: o r. d i n < 1 y * T h e f a c'Lo ry rc: o nf f:i.'r,::r t i on - F c:t, T., " W V:1. 1. - C Tr e ] i s. t: r'a d d Y: e s. s.. s i. s,

FProsgrammable FReal-Timne Clock Routines PAGE 4-3 KWV1 1-C P roT'oT' frmmrrable Real- 1 Tim. e Cl.ocK Factory Confi.5uration of Resister Addr".esses! Resister! Reister!! Mnemonic! Octal!! Symbol! ddress!! CSR! 170420!! BPR! 170422!! CLK OV! 440 41 +6 Further Informiation Fu r the r i.nforiation t ora i n t he KiWVl. -C Pr'c o T r' amI YiTb. Re l.]..-Ti.me Cl.oclK is lava i - table iln th1e followinig pl.iu:l.iclation' D 1 G IT (L - H. c: Y'o: corp u t e r: te r f a e:: s Hi-an d boot 4 2 STRC. K The FORFTRAN ctal ab,. i].e M A CRO —.1. s u b Troutij.e STRCf'L.K is used to star't the KW V:i.:-C Fa ro r, ammrabl:te Real —Time ClocK Ciall.i.n5 STR;CL...' clauses the cl -cK to b e,ii n operat tir in i.l' Miode ]. ( an ir' terr upt i.fs ce-ern r'ated f' or ever y c].ocK over — l':o w.unt i.l the. c l. oct. is stopped) a:t'a f r''e:lul.enc:y of 1i M-Hzz with a clock.in nter'rupt bein.. eneer'ated once per every 1000 clock c:yc.. es (every I. mi i.lisecond ) T h e fr qu e n c y of t h e c:. o c: K i n t e' r u. p t s ca n b e c: h a n e d, b y,a. t e ri n e i.t.h e' t h e con tr ol stattus r eg:i. s- ter n numb I e r (CSRNU JM) or the bulffer preset recgisterf n u m b e r (B FR N U M)+ Ti h e c:. c) c: K c: c 1 e r q e u ec y c:,: n b c e uc f r o m i t s 1 M I1" z value 1.'. b y (.:: Ih a n, in r, C S RNUJ (, h Ii c hi w i. sl: ow down the in errn te r rul t. ) 0 T the o v er fl ]. o w fr Tec l. en c y c::. n:b e inc.r e: rle as ecl o'r cI dccre l e sed 1: y inc: res:i.n. or cf e c ra si n.I r EF', N U M r e sp e c: t i v e 1 Y y B F'R N.) M i s 1. o a dl e d w i. th t h: nu m b, e r o.f c:. o c Ct c y c 1 es tbef osre,nll i.lteT''tlupt o ov e Tf ]. ow iS n:e.r. lfle'ate d: (:i.rn'two' / c:o lp il. emermn t fo r lm) STF CiL..iK h- tas one oth-er K ey f'e, atu, r e. i t lowers tthe p, i.To:ri. ty o f the processor w " en it servi b o:, aT d y e n e T,-t e dratec int e r ru p t, ]: t c o es t h i.s b y c h ari n i n. thee vlalue oF the p rocessor s.ttal.l.s word which is hstc'or.ed'as Lthe second word fo P th e y b oay r l i. n t e r r.. p t v e c tor+ I1 ta w' as F o u n cl j" e e s: s a r y t o o w e rc the Key - b'o,:rd priority beca.u.::-.e'typ:i.ng r at the Keybolard was cau'l.sin:i some of. the clock o:ve r f.c].w i.nte r rup t.s t o'a b vy uln::;er-vi ced, * -Th isi. s c:,l'usec the c:].oc:K t o "lose" a mil isecond here.an.t there Nr o o Jadverse ef'fects on'the keyboa rdc perf orria nce htave b een ob se rved, A s 1mp e c all].'to S TRCLK is::CAL..... STRCLK

PF' ro'ra- mm'. ab. l e Real -Time C. ock R outin es PAGE 4-4 4 3 STPCLK The FORTRAN cala..ble MA[CRO-1.1 subroutine STF'CL..K is used to shuit off the KWV11-C P:roga riaTmmn Iabe Real.-Tim e ClocK. After STPCL.K is cialledy no further interrupts will.. te gener',ater d the vialue of titime will. re.mlfain'at the vialue it had when STPFCL..K wlas ceall]ed, and the priority of the Keybotard interrupt is returned to the v':alue it hfacl before STRCLK was c:alledo Pi stamlple c'all to STPCLK i.s: CALL S'1PF'CLK; 4.4 l KEFT IM KE':TIM j.is a MA AICRCO,...11 intesrrupt seTrvice roultine that is used to Kceep tracK of t:i. mle, Eve ry 1. mi[i1 secondy the KWVili-C IProTr.Jimrrailble R7eal3. —TiTme Clock *enere'ates ian interr upt',y,arindc pro'-Tr'am control is.-; plassed to iEF: PTIMM KEPTIM perform s r t h T e m'aj ) or t as ts F i rsty K E PT I M che c s thei se F:.- a over.run r b it of ithe KIWV.J-C CSR to see whether more than one cloc: in terr upt h,1as occurred s:i. nce.the.la.st cloc:: i n terr' iupt w tas serviced * I f mor e thian one overf.low hfis oc: Cur edi y r e C:' mr es sa; r1e wi.].]. be p r'inted ouCt Some amtoun r t of t i m e w i. hiave b:een "lost" Nex'tp IKlEF'T]IM i nc:remernts the va.lues of HOUR: MI:NUITE SECONDI,ancnd lMILSEC las lappD rotr,'L te Final ly, KIPF'TI M clelars the CSR's overflow.fl1a,',and overflow overrun fla], t. o tell the c:.ocK thiat its inteTrrupt hias een sesrvic:ed Irn or:) der.fo r the v:al].ule o.f the t:i. mn to be pia. ssed back t o'a mn:lin p' roram,y the m i i. n Fp T' c(S' r l amrf t' c:" n t a i n t h e c or mi o r b ]. oc k C L..; B.. K Ther e is no(: s:..ample FORT c4R A aN coall to %EPFTIM since i.t is not at FOR TReAN calla t 1. e s u b r o u t:i. nr e +

P:rosrrialmmiable Real-Time ClocK Rou.tines PAGE 4-5 4.5 E;ETTIM SETTIM is a FORTRAN slubroutine thiat provides tlhe user with w a c:onvenient w'ay to set the vialue oP the time, SETTIM simply,assi'[ns the vialues of the subroutine,arguments to the equiv'alent common blo.c:K, v ari. bles T 1 hus t he c lommon b:LocVk CLKBLK. must a pp el r in the ca1~lin5 proranm,+ Note tlhlat the subroutine does ro error checKinr (siay to mitaKe s;ure thtat ihe vra.lues of time,are positive) Note 1al so that SETTIM could b:e repl.aced by four FORTRAN,assi.n;'ment statements oPf the formnl HOUR MINUTE SE COND. M: L. S E: C The syntx o.f:'.1.. calto SETTIM ist I NT4EG E7R IHOURF: MI NUJTE SE:CONI:)t MILSEC COMMON / CL.KBLK / HOFUR, MINUlTE, S cECON D MILSEC CL. SETTIM HOUF M INU1TE, SECC',IOND M:ILS EC: ) snamp 1.e ca: l] 1 t s i C(:.LL..SE..TTIM f ( 1. 1.4 51. 76 3 ) Th i s c a I1 sets.I, th va 1l.. e o F H 0OUR to 1. M INUTE t:o 14, SE iC.ON t, 51,: and MI L E.:C to 76 3 *

CHAPTER 5 F'P. e K a nl c F'oKe Rc:ut in e-s 5. 1 I n t r o d u C t:i..) n Th I i s c h a pter d:i. s c: I. ses th e two'r o utin e s F E EEK an d POKE A E. e n e rl, al dis. scuss.ion )o the routines is 3iven in this ilntroductiC. 3on A more detoailed clescri ption of the two rou tines is jiven in the fol.owing secti jons Secti.on 5 d scusse. s PEEKyK and Section 5 * 2 di. s c1J.s ii FPO KE..,5 O J. 1. G re ne, ral CT apIabt) i.. t ti es The ener"al. czapa:bil ities. of th.e two routines,are* F E.: EK R eads,a r, u,mbe f)r f roTm,a user selected memory. oc ati.o n POF'O' E. W rites ia nul.imbe to. r.ser selected me 1. mo r. lca tion01 5 * " Roui t in e (A r umren t s The tewo forma tl. a. r t men'ts o) r both PEEK and F'OKE 1.re ( P, I:I:.' E SE T i e:d cd::I r. e lYi o F' t he memoy t3. ocato,t. i or t:i'ti. the user w,.l ants. to re ad f r o;m:'r w r:i. t e t o. rt.! F E S i s,l n I N T E: G E R, >2 va r i a b i e:a rd m y ni b e ta,:.si.n:.:,, re. d va,le. u s i.n" e iL.' t. e lr c j.i:. o c: t,. ef o r) flm Eo:, x'amrp 3. es of a d d ress..:i. n i.n.ec i. a 1 i al: n oc tl for':.I a e elw i v. i: L o Te' ie u'se r is res e s t l s':.: 3. e -P m r a K i.n sure t ha t'DD Ei.S is a v a 3. i. c c i c n e'a dd tC e r T I e u s e i. s w a r n e d t.. h c::.' p oiK:i. n',a n u m b e r t o:a ln.lK n o w n I e mc o r 3. o c: h't:i o n c: an h,'e sub s:::i.']. I.f e ts o r t h e s yIte s t. e m s NUMIBER-.' h e rn b r t a t - es t't th r wts t o r.; t e t o t h e me.o r y ]. o ca t i n i or t l e va:1.l (o:F f t h e n. mb r re,: d f1 r':: t h e memory.. o c a t i o n N U M BER is:an I:hNrT EGE: *^ v'. r i:ab le

FPeeK a.nd PoKe Routines PAGE 5-2 The user is reminded that netattive numbers'are stored in two's complement form (see section 3 +12). Thus, it mnay be useful to PEEKl toy or PFOKE from'a nesative valued address* For instance, the,address of the CSR of the KWVl. 1-C F'roj raImmabl ee Re al -Time. Cloc is 170420 in octial formy which translates to the s;igned decimr]al. integer' value -38324. The user is a lso reminded that he c an 11. ss s i oct al1 v al ue s to inte gers directly in F'ORCTRsAN FORFTRAN uses the quotation mlarlk syTtmbol. " to siinify t tt the following number is to be interpreted oas'an octial value* Thus the statemeni t ADDRES'170422 is equivialent to+ hADtRES -- 3822 where 1.70422 i.s the addresss of the buffer pr-eset r e -g i ster o the cloc K+ 5 13 + Sourc. e Code Th-e source codle fPro th"e routines PEEK,and F'OKE is. ].ca::,'te.di in the fi e F'EK-:l; F'(O If'MAC, 5. 2:'EEK Th e i:F C FR' TRA N c all able M. sub routine F'EE K is us e dt t o e la ci la num b e r (NUMBER ) -from a use r sel. ected memory loc'ationl The s yn't':a of a C, c ].l1 to P:EE.K is: I N'I( E: G E::R A I: i:; E: Sy i'N l B E: F:; CAL..L. PEEK ( DIDF:.ES: N.UM iBER ) A

Fiee K arnd PoKe Routcji.nes PAGE 5-3 Somf e samp le c.a l1 s to PIEEK are: CALL F:EEK: ( O NtUMBER ) This ciall reeads the contents of meTmory location 0 and stores the vialue in NUMBE:R CALLLI FPEEK ( "60 KEY EC ) This ca.ll..eads e'd the ccrontenrts of rme.mlory location 60 octal. (48 dcecimal p which is the First wor.d of the Keybolard interrupt vector) and stores the value in KEYyEC C. 5 * 3 F' 0: IE.'The F'ORI:TF' FT AN ca i 3... ab 1e i"M A CC R O — 11 s ub, cJrout i n e'POK sE: is u.sd to write'a n umber (N UMBtJi:BE. to,a user selected me'mor.y l oc at i o on'The s n r ta, of'a car:J. 1. to F:P'OKE is. IiNTTEGER: AI:DRES? NL.MBEE. 4. C A L.L. F''KE ( iP.A I) RES N. tJ ir B:.:1. 1 E:t -t X o:; F::.., N -r' O E F:: re S c, me s o m p 1 e c a:1 s t. o I 0 K E. a r e: CA POL. I... F' -' ( "1.77777 ) Th:Ls c ).l wr.:i. te..s:. the octal. nlumber 1777777 -:.: ecimmal i.s store:d ais 177777 in two',s corp.ement oc l for)' to'th e rmiemo ry.. loc'a ion whose d:xcI es =s is 0 CFAI'-'..., 8'24,..113 T h i s c a 1. w r. i tL he le o c ta,). n u m tb e 1.3 t t h e m eI o rTy ]. o c a t i o n w h os e ad dr es s i s -3 8 24 ( *-382 4 fd el:i isa: s:L j.s sC;toi r e d,: s 1 70 z4 20r') i wi't w' s o r lp 1 e m e n t o c t a 1 fo rTm a n c i s te a ci rless of t e C'SR c:f thle c:]. oc: K ). Tl s c:a ].. c: a s e s the c lckc K to b ( i.. n o p e r a t:i n i. n iM o:i (:1 t. 1'a M 1 y w i t h i. n. T r u o n: v e r verf1 o w

AP'PENDI X AI Br-ief Desc-ription of Lib. r::xry Routines A brief descTription of' all. the routines containred in this librtary is -iven be l: o w PDi.gittal to xAn'alog ran d Arnalo to Il i.cit;al ConverTter Routin.res T I A C Wr ites,a di ita. num i ber to Ca use s. e (:: tr cd c: h annel of the AAV1 1-A Di..ita l to Anlalo;c Conve rter * The DAC converts the Inu lmber i nto Ia p o p c r j. t n':1. a:1a n:a. o v o ]. t la e u it C PR e'acls ra d i i ti a ]. n S 1 ta:: er F om'a u s Te 3, ec::tecd c:h- a nne oF t. ie ALI: 11 —A n:1alo to Dii.ittal ConverTter+ The di-.ital n.umbber is p roportiontal to the'an al]. os vto. ta'5:e applied to t h e c h:anne]. * F a rr:al. e 1.: np u t / u t u. t Rou t i n es W Yri.tes ta 16 b i.t b inar, y nu,imber out to a user1 sel.ec:ted ch:',:anne 3. the DRY i. 1. 1 i.J H l. h Den it~s i. ry Pa r al. e. I: te rff' ac: e F- "::' 1 l' i i::Re acds a 1.6 bit bir. a ry nu'mber irn fro-m'a u'1 ser l. e c: ted c: h nne]. o th e R:1.-J H.i h De', i't. y' ra~'a. 1 e' In t. F a c ( e.

BrTief {De:Fesc:i. * ption of L.ibrary Foutines PAGE A-2 F' r - r a in m tat b 1 e r:i. e. liTie Cl.oc. K Rou tines STRCLK ~'StiarT'ts the KIWV.l.-"C FPro-Crarfmmtabl].e Real.-Tirme ClocK ctpe',tati.ng 1at 1 MiHzy in Mode 1, with interrupts on overflow occurring every 1 mil-. isecon c S T C I... i Stops Ith ep operation of th e KWVI.. 1-C P::'ro- -;r.n'amrabb.e PRea.-T i me Cl.ock + KE F'T:I: M Keeps t ra,::c.e (:)of t he p,assa=e of time ir, houT'rs, minutes? seconr clsy,and mi i1 i.:. s e c o n d s T E TT I. i:M Ain e l; sy wa y to re..:set the v'l.ue oa ft i l e i u in hourrs m nu ter d s eco s,n cd mri:i 1 en. 1.! c: on c < PeeK,: aind FPoe R out.:i. nes PE' E K W- r i te n u m b e o a, u s e e r ec t ec m -:, o r'' Y. o c: a t j. o in +

APPF'EN DIX B H-a rd w are I nt st ]. 1 It ion: otes The f'ollowin p'araographs listthe e,ddresses of the hardwa.re rejisters used in the RELTIM i ibra'ry. The caddresses h:ave a,:].]. been 3. eft at the DEC flactory con i'. ir'tion s I-f lnry of the resister addre sses have been ch 1an ed, the corrT'espondi.ng software in thee l.ibTr rTy mri.t,:x.sc, be c:hlnredc forT the routines t.o ope rate prope r1y Th le fol 3. o win ab b rev i.aTit i o ns ar'e used beJ low B P R -- u-f.-e F re s er't R. e:L s t e T C.LI C O - Cloc:t COverf.low Vec:tor CSR.- Control. St~atus ResgisterT D.AC - Di:ita3. to Anialoo C o:nverterT 1.lc:. odin': Regsister DBIR Dxt, a r Bu -Ffer Register 1 x r ci w C: xe u s e:1 w. it t it 1 e l I A C / A C r o u t:i n e s AAV:11 —A 1 1 Di't. a'to At in al.og Co'nve rte F i ac: t ry Con fs i'gu rl at i o r o R eg. i s t e r' A cld'd rese.ses!':e g:ister'! Regi. s ter! M in e lon i c! Oc tal.!! S: /b lo1! A d d r e s s i D C 0!:1.;' 0 Al 4 0! A C.1. 1. 70 4 4 2! DAC 2 170444 4.! ILC 3! 170446!

-a r cldw'ire In st, t. laltion Notes PAF'GGE B-2 ADV11-A A nalo:t to D:i.5ittal Converter Fr,'ac: to. y Corf.i', ura tio n ofi, -s ter Aid d resses! Fe-giste! R Pegister! M Mneronic! Octal!! y m b o 1.! c l d sr se!! CSR! 1i.70400!: BR! 170402! Ha;:Tr d w:e u sed w:i. t h1 t h e P'r 1. r. ]. e 1 I/O ro ut i n es;:I R V 1...-J * H i h Dens it y F' r."lel In t erac F'c:: c t ) ory C on ij 1u r a t i o n o' R e i. st ter A cld r e se s! Resgister! Re.i.ister!! Mnem oni c! Oct:al! CS. ymb c)! A dcl ress! C SR. A 7641.60 I DBR A! 764162 * I~s I.< Ft X................ 0....! C SR B! 7641 s i DEPB FR: B! 764166 1 C SRi C! 7641 70! DB CI! 7 64172! I CSR Do 764:1.74 1 r~ C'': I' 76 1 i.~ [!!:' l:l!'r7 4 ] 7 6

H r T dwa T're Inst al.. ltion Notes PAGE B-3 Ha'sJdwi, re usied with the ClocK routines KtWVl.-C ProF raniable fR.e eil-Time Clock.: FactoT'y Configuration of Ret ister Addresses! ReSister! Re.ister i! Mnermoni.c:! Octcal.! Symbol! Add res s!! CSR! 170420! i BPR! 1 70422! CLK OV! 440

A'FPENDIX C 1i.ha rd wi. r e In forr'at ion R eferen C. e The LDlitial E lqipment CorpToration- ptubliclati ons:Listed below cont ain,a more cle t a i. cl d i. c: u - sc:i o n csf the sp ec: i. f i c: at i. oln; r cl p r r o' r arl m i. n d e tla i 3. c F the h,a r dwa:)e L'ed: r th t i i.s r: L b y. A, 1.. -A" 4 —Ch anne].. 2-.Bit:i / Cronverter Mic r o c o p uter n te rf a c e s Ha n d b o K;i:I' I -A rtal ] 1'a o ao D i.: i t a. Conve ter T iM:i c roc (: o, ri p Ub e. r:Iln t e T'r fa ce. s Hian cd o o K, l F: V1 1. t"i. -:, re i J. t y F':t i. P. a: 3:. ]: r t rT f a c: e M i c' rT c I-) p u. tj - r:1n te rI f,a e s H a n cld b o o K I tF,, v. 1 - F:' a r 3,:]1 e. L.. I. in e I n t e', f ac: e s e r, / Gu j. cti e Kt W V:. -- FI' r1 r:, I: a:l lr: "::. oI e -- T.: e c:1 i.: i i. c c: r: ( P. t.. I. t' r f'a c: e..:.i H an di b oC o K

A F'FENDI X L L ib Trary eleve. op ment H is.to ry L IBRfARY NAME: R1E"LTIM, *LIB L I i,::khFRY C NTE: N TIS+ Gene I]. pn'rp c'e T'C.L i. n res. f(c:. t tuse in re. i. tim e mlachine cont rol ].: ipplicat.:i os Th e ro-ut ine:. c are used to: oper.:.ate,a cli. ital. t.o a n 1 o wc c o n v e rte r y a,:' an a 1: tj. o d i t,ta c o n v e r t. y a p aria'.. e. 1.. n e un ri. t i' I n t a d,: p ro; rammab 3.e re ea 1. t:i. me c 1 o:: K i F: o 1.1'ini ts o p ee n K ane' *re a 1. s i. n:!. c1 u.:. c+ SOUSfICEf CODIE L..'ANG.UA'GE 5. MMAC:!:RO — 11 FORTR, FN COM FU TEF R E'.1 i ta,l 1 Eq ui p meri't C c:: rpat in LS: - 1. 1/ 2 3 OF'ERA'T IN tG SYSTEM i RT-11 FB (S) V04O 0G HAR:DWfARE FRE:.lJ: iRE:MENt'S t i ita,1]. Ecui j. p rmern t Co:rp o mat i. on's AAV 11. "-A 4-Ch annel 1 i. 2 — i t i/ C nve r ter DV1 J1... ( An alo. tc i.:t Cnverte DRVa,. 11 -.J Hi h Dens i-ty i::'ar.'a:t.el.: It. 1 te r ac: e KUl 1... -C' F: Prog r, amr abl.e Re al. Timrle Cl. oc: L.B:. E R. F:y, F Y C RE:T',:: N Dt TE; May %:Y 1 9 L. I,', I::1 ti: E 1,. CI T::' t F r:'. f l.i i::' I:-. A T b r u'a r y t -h r f ( i u a c h, 1,. L I B F:R:, L;Y:E.. l EL. O M "' E' NT S:C ri: T M: an'. f:a c t u. r i. i n' S y e i Mi"i o c e ].:i. in' a': n d Cr: t r c'.... 1a 1.:: r a t o r y.t p ta F t.R - rmen t o f' Me c: h a n i c:a'. 1 E n: i n e e r i ni c UJ n i. v e r s i. t y c: -f:. (: i:i. t a n ni n A Tr b ( r Mi:i. c::.!'a 4 8L 4 L.:I: I.F R Y I::'R": G F rA' E F F red RF:,' asr1.1,.: en' c L. 1. * l 1.: i e' rb..au h,, LI.:F: ERY F i: O..,JE CT' SLI:'E R!: S C:):R S F' ofe. ss. o r rA (, i: l i' l.! 1 U:. (:: y LI.: B OF F: F' r.:, B: 0 L.. EM H CO NT r, C T A T' ct o' e. P s r3. i. p U ]. iar. (:s v I. Y..:I:F.,Y F UND It N SOU F:CE Trt'h t e lib ci s d.e op e'd p: iL,:s r i. y fo: r u.1 s, e w i. th h e V a, T.:i. a i::.e G i. n Ai d p t i. v e f1lControl p ro,ject: NOSF Grantj:, MEA Mi -8 1262

L.:. ib T ta y S c c e C o d e L..:i t.:. i n 5 T h p s e:: i i: t 1. n: j, r' S. i.. co i...i t! he.d, c: C' c c de: 1l t,: C: ( eC t'I:,e @ t h e.. ~. L ei -.i C:. i"i. - t e:' r " i. i.:. 1':'. 1.':i i 1.;,,,,: i J. n'.. A i.... 9ETTF r 1. Ji M. C",.,. F:,C 1....i i,''i e..,....r:,:C t.i tr a r j i i f.. i. I...........,

L:i.bi rary SC our.ce Cod:e Li s tin ss PAGE E-2 DIGI.:TAL rTO ANALOEG ANDTr ANAL.OG TO DI GITFAL CONVYEFRTER ROFUT:INES The -F ol 1 ow i. n ir), (i. c:., -.t i n the sr; c, r c c:. c e f co tl e''- r ou t i n e s It A C( A i:' C)

TI T I: E D. i, CI; G GLOBL..-:.: DAC ~b rCGeneTr al. i e.sc ri.ip'ti.con Thi s rea r]. timre routl:i.ne is used to initij.cte 1a + dd:ig i it,l'to ianalo. conversionr I:'t is.as.sumirred that' the ~1 AAV1.fV -,Y1A bboard is irrsttalled,at the stliandd,dadrTes.es@ t, t DAC.O 170440; DA C 1 170442,2 v ~ ~rI A C'. 1 7 0.4 44 +5 tt iAC2 170444 y~; el;D ACS3 1.70446.; C, 1a 3. ]. i. nr e.'a r: m p ]. e C'ALL. L AtC ( ChTN) tfi,I' A C VCL A ); F:' oD r ti C:1 3. C ioon:. F ls: S tN so F'oTT'-M,..XT-?5uernents:.,, C 1-1 {N Cl HAN' An:i.nti. er2 v:r.i.:i: e ont:ii. 1an i. n'.e the ifDACi C h a:xt n e 3. nl. urn mb er:ACVf AI... + The i. n t(.:.:e t-e r 2 vl:..il t t i:t. is to. b e c o:,nvi: r. t. ed: t e t. 3. e f e n c e s t Non e::, y I... e l.. L,:a u d e'rb:i iu h ~i r,..,...:: P: 5::(':) p.O.. OV (R5)( O:. 0 GE CH A N N E:O I i )Y G +tR:i: 1 ET Y LU E iM C R0 R i::' i2'. ii L.'" I' IL...Y THE. C H 1A N NE 1. NU I.! B"Y, E:, Y 2:ADD:"-:. 4 4P),O ET UP AY D FR E G F " CN:'" C.V RTER A~.....:,...t.:.: I-F' ItN -:'t i'ti'f B:ii::i. 7 0 4 4 0, R C,; c.t'} *-} Ps;-t t. ( {.- S; r' l,,} fzl L M C: V. l: 0 t) N Ci VE THE.. tI Ei VA..... t. i' O t E C. fO i E t O E..':. RTER rT'S I.C

TL..E: A tC S.i. At A, ( DC G e. n e r cx. I'el.c ir i p I o nE t h i s i s a f o r' t r' an c, a. I b:.: ]. tne s.1i o u t i. 1..;:' Y r e F'or (Yo Y m,. m1o A to (3 di i i t Co 1 v e Y s:i. o n s, A;~C:: a I. in 5 *. e::' ci m T' ].e C: A...L A DC ( C AN.. NC) A C. A ICV... ) {. Pi T S uk I Ar tn C) rrf I,: a r i urn en't sst C 1-1H A N N 0; T h e c h a n n e 1 n u rfii' ^i ( 0 — 7 ) f th d c c h ia n n n e yf?~~~~ ~~w th ee tr e 1: h c: o n v e r. i on i i.s to. oi c: r c:c ul.;~? -siei~~ ID C V A L. th i e i 5 7 * a. to d tn'i o 1e. t:5 ~'con C)I)e r ion C). y, I::, y... 1. J. 3 1... idte C':rlI: il ta::,. 7: h 4. *... A}:8i C:;i.0 S ( J:.: T'J C) "i'-:, F:.', ('.:, G *-5" T Ti -.i E N U i"l B E i:-. 1..' cA t::, G. H' r N h C l (:11:. 7 0''., 0 C i...? A F:. T I'. CO. T F L E:l ) I:"; T I.' i'VtB'"::', i:..;)' ~.,!,:1. 70'40. O E TH' C " N-i::' N i:Ii..1. 3. -ON i"f E E AH I (3 H B O:E.I: RE; S tF T iHE CSONTf:Rl... G I ST E R.:i: A.' 7 0'. 0 4 -: S T (A FR' T T " 1E: C 0 N V E,:i::: ON 3"t1:' ":..'' i::t1t:... 70400 TIEST T " SE. IF i:I i'i Vf.:t1:!';:: 0. 2 f-.) ( i;::.i t: ).{., F:Q1' y'' tj 1 " U: t::.E: -::.:r. S.l.. Tf 1::~'~"' " i::' C: @4170402,@(R...)+. VRETURN T.E R U...T,,!!:: ".C D

LibTlrary Source Code Listings PAGE E-3 F'PARALLEL INF:'UT/OUTF'LJT "R'OUTI NES The.Followi.ng pl'-.e s c o ntt:i.n the ourct: e c: ode Fo r the ro.::, t ines.. I::' FV R E: 1 DRV R.'

* DRPWVHRT.iMC *' h e f o 1 c,,t.i.:t i: F::t- 1.:I..cl cs c e. i.'c a s t z. e r; i: n t,, t 7:r 0 W a: K.' h t h e lit.i.:L. i. t.t:i. E i' l r; t.. C o r p o r tio. a n l V 1. -J H i I:h l e In: i t y:' a I r. a I. e.. Li.ne I n t e rf' ce f T'orn: a F'O R T R F: N;i r o'f'a:it;". t:i r..t. en b y F' T e i. i'i u e'. p r i. n: 19. 4'. i.i pa ns i r f ra c:. i'..' {- O' t -. ad-:: i n -:.1 n d C n.:: s..:..: L " a.': o'- y..t. e p i r.;.. t 1 e n i t': M, c:. I" i c... c: 1.. E: n i. n e::' i. n U t:i. ve r?:.. i.' s' t-y i c:. n!I, n.' " i.:i. P 1 1'i..ii IL:.. " ~:,,V R l.~ i.... I....., lC.. E TRBAS J::,,.....:.c.-,v it c..:Lc..: c::.(:,.: c. c-,:,.F 1't h e' a.: t ad dr:s.f! t a. t a.. "'n i. In.e f i 1 ad d f':. i: e! ^ p' |J i-ii ^; [ s ewE |. o t i 5 i i e t h e a - I I t h e c: n *t ro1 t t uD:.' A e''.F'. the ~ e~ r. e d I /.. p o...... r B: 6aead..i..'dde i n" i 1 c:- -.. -: a'a the d::'-".e.. i.... r.;. i... e. <. i C S i 11 u s tI ha pc:t.. t o cj rate ii th he r., i'..,' i t in er;u..i es 1"1.:t:'vi. t,, i^ t h. t i e u'1'ts. I' s d i cs('e s t.. ss t f... i, s'':i t i. t. Lt e, p- ort t o. } e r l. l e p r ro 1 y a an 1oiC c. t: t uut I: DR~~~V W F: j~T C)t M ~ @~2 (R5) RO S~o\/e~~r ~ the i-r c d. annel n1u: int', O M V C; S R B A~( S (.0 )!:.. i,:. t v: e c:. e. s t h e e - S i n l:. S i..-e t e. i er r ead b. t o te C i S i s Iw(, E:1...1,?; j, i, J ~..t.'I:..:i.'p].?y't.. t":'-.:,,::: h) s,:. r: 1 e.1i r:1. i rt.: e T r',t 1.' e 2 f:~,!._..', t..:i e. c:i.:: e:i.'.'L h1 - (::t ch: r:1. I-~. c"I c::jL. J. % e d p o s e f % -s;., 1::, c:,.". y ". t:. i'tI'I~ (:'r V~~~ ~'"C..... T:::L,) CJ o.:'". r; c p:: c,'" r'A "' ti f i t;....'::, t'.; 6 - - t:'-;',,.............:, r' ~' * cT;' t:. h:., i'e:l C'. c:' F,::. n.t.. o, E::1.;i.'.'.;..i.,.::.,' r':.:l,....:'. r J. e, ";/ b:.':,e.ir-'. s':

b,'bit 1.5L the N b:i.t of the p'oc:essor wi.l3. be se t i. f thie user r~e. ad:y b:it is set. BiI3: WFr TDA;T l:f the us er re'.tady b::it is slety b'anc:h to yw ri t e out t h e d s i. eci n u I b e r 0 JM ER R1 F::O: Since th e u se r re' dc! y bit o-F t h e C SR wa s not set y war. n the 1 use t and r etuT rn to the y c. ]. i. n p r'o s r':x r M. Wi:TI:CA'T: iMO1V 1CSRwrF:T yC:SR1F:B S( RO).Loa:d the clesi.Trecl CSRF, w:i. t h the rnumrr berT to a:L. 1 o w i t t o w r i. te o ut th e d a t la i VI @4 ( 4 )'9 )) y rD I cRIsi A cc R j. t.e t e d t he c1:i. at a 4 b t. e r r e1-.: i e r.::"' S P C y R e t u r n t o t h e c::: a:. i nr p o T, rTa r E::; RROR: J S."R F, ir F. Fi MSG W ra rn t h e us e rT'. h':t i. tc i.s e c h ad n o t e.! n. bled t he. e sei (r.d ra dy b i' oF the desir ed y CS, an cl t ti r E: r fo r er n o. oC u p:.'u ci' t ta c.: ai:.be 4P w ":i. t'n t o h a. t p o r. t t i'' -S P::-' R t rR t u':,': D n.1, r T: h e ] J i r.:. L - p -.' a mi 4 r, -:' St.i'f ~ i,' Tz...-I::.;, li, f 1:3 I t 5 pr w 3:, -... r T-' c, L. r: %: Co; i~i., -l i~t i~q'";' ".. c:r. 3'*e. t h:: aci e r.I. c: f I?.-. j n on ti r.'.!. -':cl it -:.'. e c.: d:i I.:. r: r,,: (.. I),':.:.::i l,.,. r) e i.. t. i p 3r o.'! m- y l R t y e.. tc. f T C. r F:-: E:. "':'::.: 6.',:., T 1 R:.':. 1 R,:: -,::i d d )... y'at ti.:;'e i. r.'.-c wi.'1. t: cE, t:lr l e r r a'.f:''b o:.'b C. j.:i. N: t e c1: i., r e r s', a t u. s;;" e:.:j i:':,:-:.:, e.f' o?. -. h,:.::, d e. s i T':.:, d ]/ 0 p o::, r'. t........?.. ('"."t. CJIi~e t Ji d d'-e:'':; f e ~; i s! r-f o r t\";e......... d e i r d i /. t.... i+ C.S.; F'.t:; y i F e r: r e ii. i t. V. t': o r. t...n. i:'.n t h1 e y:i n I.:'.. -t d e.:.,: % J"Y."f y: i. r'. + 7':''r r. p t s.F a.'.. o w e d, A F': V i::; E D i:' "1 (i i 2 ("'! R' 5 ) 3 r 0, y M (.v J,' h e d',.@.:, s! i i'r':. e I c i an n e-:.'. 1'n u m b e r. i n' o R: 0 6 R;.: 0 ~ H u. ].t y *.:i. i ]. y h:: h, r'J t e han.e n u. m ber' b y 2 r';j R. i::,p',;:,.! 1.*i i t-, l y t'e, h(.,,. h r:i. n n (.e l. n u b. r-'~ i::,e r. b y':2,:):,:* a n,.'."' d l:). t:) u-f.f' (.. r.,'.",, i.^ t'.:'e, y::. n d!p: u'',:t.i t.:i. n t h c.

ri e m iry 3. tc l't i on t h t:. i.s r, se rved. Fo r J.it RF:.:' T SR: C R F. e ti r n t t h e c:,. 3 J. n:.rS r o r ta l' T hfe f o.1 c w: i. n p:. rc: rc! se sr n t n E:: FRMSG, p r i. ts c:ut ca mi-:,s-,.e ti; t 1 e he Cr p w c. r nr in i I h,: L, tht. t.h -e s e r r e a dy b it o-F t h e~ d e s i r e: d p C:t ws nW o t.s e t T h e Ih,:ar' wl.:,. Tr o f. the.: l l:',..1. -J ecl r iL i. E. r th'.-t t 1he user ree T a dy bitj. be se, t i.n corder F c: r d: ta tL be.:, c:i. tp L. t *' N ot e t h:'xt t! h e u s;e r er.ady b;, t i s s e t b y, r o u. n d i n. it F' S E: C'T E F: F,',:;: -:1: t- F E..L r fS N G I L (: L... EF,M: S. (3 M LL...:. IT ArR 5(3 PRI NT:ME1: SNrint ax wcx frv:i.ni n to the u:'ser*r R..,. 5 t 1 R -e i'|.: Ft:ou.' ir e c::i... i n.: P'r o T'. l m. + ii lE,..:'. r. S C:: IZ /i Ri G THEiW,. S EDY I F: N i N'3: T GRO. iT. 3 E: Y i: I. t S N 0 G CF L.NO UT F' U T c: ENE RF AT 1: t s.t a t e n' e F' i d u.t p a,: n o dic d n.. S b e r f I:) y.' t e (:: c':i. s' r u, c: i. on mr u. t b e.: n o n;.n even. r' I. m r i: e r e i' ci ci r e END~1~

Libr.Tary Source Code Listings PAGE E-4 PROGRAMMABLE REAL.. TIME CL.. (OC.K C'.0r UTINE:S "The F ol lowin. p axes cont.ain s thil e sc:1l.T'' c: e code -FPo' the Trou.t:i. n es ST RC T 1... 1I ST PF CL... K Et'PT:I Mi SE'T T: i'M

4 ^ ^ ^ )|<)I<:: <. 1.:,,, < * rl( ~4t * )~. ~ 4: **: A:. AC.*' o:..1. 1 w,:ji. i C. ACRO....1. co.: de:i. i., i n eci to:..1. o ow a u.e r't o wo r.K w it.' h t he I'I.,.1 T A.y X):i.'-I:i. %,:~:L E q u:i. Fn e r;' t C: c::, C' i::o -." o.' i&, 3 n " e 1.:L. I-F.' r n b.:.:. - T -t. c.? C. ot t C:: t t4.. i.'. t.e n b o U'::.:. - c:::tI:.L n. o..i. th cr!';'r.tt iy F d, R. s L. ": I ~; U r':9~~~~~: [ v:..~~:1~ ~''r.''.:/o'N:.:L }":'i?::. Cnt c: ~, ~: in n f:'~'r. i::: ~.::,.t...,, i'i 5. r: i"::i.:i,:'* r':,'-' p:I. OC 4.-,:I.'"'::' i~ Spr ing 19847~. ~( 1~~i ~~C'~~:::iJ f3UURF M a n. 1f ac: c:t. ic): n' et toSr ytr P1s t wo. r r.:. i. M d i~ nt 5I a n d:I Ct o*t nt c 1t 1 44 (cia tiorl ):' f (~~ ~1~ ~.?i C. ~'~~ L.L... i 4 i d d' I::' c::.['i" Cy Univer ty o' M h....'T C. l'an' d':! "'". i A T- 1o T i ca~ hi i.. a 48. (" I I....':' (:'., J T I L E C II.. # IR.. C::) BE: E:,C: "'[' C; I... K-.:K!;: P;T(I M y S "f R C I...1 < y F" 0 R M S G. C I... K B I... ":(, 1::.1 C;,?,; P., y~ n N-.E:, S. -, tE:: t h N v y - S. J t. S R A::.i., i?~~~~~ IK B[. I I al' b pr s n in t he FORTRA'N al l in..g' I aI r t I I p!',.'rop;'; p', T a 11 o... 1;, i.'': d e a'.'r. 1d:':.f'':' ai n:: a: a:. e s''ui i": 0 o.:i. n I,F' S" E C...B i... K 5. R \,D GB...'.R. E L-... F'. I'' "' [' J I.' I I.. c!..';"':.z 1,...r.~ ~r~.:I... ~ I Ms:1. S "::1..i.a e d:.. d: ey - e::i'' is e i-...e...... e. ( e c: a 1' ) n,:'. p. r'~,::l ~,:.i.'.1. 1,. T~ h t e ~ f~ ttot 11 o w i n -. P 3 C T d -F' i e s " e at~? T' o'.!.; ie'n v:.R C:. r w "''. v:i. s. s e d,: s' a ] ) t? 1~!< l-l z y a n d J u:n!":...nt...-... ~,, e,,::, r~ (.'. u p e i::, e o:i.'.r e,,:, n,::E P:: ~" e k; e +.o " P"' S.C... 3'. P.., I..... E (,~~~~~~~~~~~~~~~~ c:1oc:K ov^:rfio tS r tI: hr e ssor pr

l.eve]. tc 7 (the hJi.i hest pTio'ity level.)) C -. 0 4 " A 1 1The add re s of t h c o n t r o'. t la t i,.; T e is t ( CSR ) oc f thel i -:1. i c 3. c: c K iJ 1. 70420 ( c t'al ) B:::1. 70422 T h ad d r e s o pf t h e b ufe p e s et e i s t e r ( (BF'FR, ) c:f t he KU'V:L:1. c c1 -ocK i. ]. 170422 (. c:t, al ) C. RNUM:::: 000:1. 13 The numbe r 0001:1. y; when in se rted in t o' the;CS:Ry wi 3.1 c'au se th'e c: 1.cK to oper: t te in mode y 1 ay t'a f'req. e ncty of 1 M —HI z with t h e:i.te r r u p t. o n c: o:: K o v e r. T o w e n b. e d..R.!:: NUM I: 176030 The' numbe,:.:-r:176030. which is the. two's complemen t of:1000 (dec im al ) ex.pre ssed.. s tar' octal Pnu. mbey w:i. ].: cause the cl t oc to ove-r:i. ow once yeverv 1000 clocK cycl.es.* K'iEYVEC:::: 000060 yThe add,.l ress o f the F i rs t w.or d o f the inter-'r u p Ft v e c t o r f ('o ir h e i. e y b o a'r c, * T he s e c o n id ti o wcr d. o f t h e: K e y: oc -I (:1 L in'd e re r u p t v e c c, () r c on ta i n s t h e p r o c: e s s o r. s t t. u w o r d (P ) U ti a t w i 3.3. be u s e d w h e n a K e y b oi a d i. ni nt e r ui::t s b e i s b i'. s e r v i c e d,. T Th e F'SW A p r i o T' i ty m u s. t b e. owe.'ref.. cl Fr o i t s y no r mia 1 1 ee r.:. 7 ( t h e h i.. h e. st r o i t y. T i o ri t,y p o s s i. -- bt. e ) to 3.eve e. 3:in' r-d e r t o p r even t the K ey- - y1:' o. r d -F r o i. in t e r.f" e r i n w. t t h: 1. e c o c K * I. f +,,. f t.:':..1 el f e 3. /7 ea. c 31. o:: K o v e rf ow o(. v e r [.1 run c.a n o c. c.u rI w h e n t h e u s e. t y p e s... d a t la, i n t o(, t hi e FK e y b C'::, a rd..F' or, t h e' I F' T F-'A N c: ]. 3. i. n Y," 0':~5 r':1 ifl:.:-."....'.:':'i:, o - 1:!...':,.: l C.. ut th e d i r e -s oF t. h e i n i. e. r. upt t o v erf low,v i.e routine KET I M ) in the f i r st word of n e'.: -:i. c e Y..I:, J 1.i.:,'' F T'W, U"..: e. int, e r r u pt own o.e rf.o w vec: tor. HMO V:C 5V P'S W oC V HE C +2 F"J. t t h e ove r f:o.I w p'r o c e so r s t'at u.s w C:' r d i n to ~ the sec: on d w o r d o f the i n te r ru Ip t nov e rf 1. o w ve cto.r O,' 0 0e I' E.:, 1.o. 40K: EYV.' 2 t:e K r-. b 0 T' d i n' t ror T.: ) 0C'. 0: t"t ls w wor (d t (o:1 40 ( cs ta'1.. )e K eybo,'a rd in te rie - r. u P p - j i. t p i o t y. e! B F F. i'. N 1 M F L, R: t' oA 1. d t b: t: b u.'fe's' reS.t. e:i.. t e r Mi'i. )' UM CS R,. L..oa d t h e c on t"ro. a t r o -:: s re i.' e T::i c: o n-, i': n d (J', c: t- ua. l: 1 1: T l.: i e c:::' t'.. o e'a. i n *, R,"' S F' C::R e't u -., n t c:. c::,: 3.. 3. 1. j.' o' r: MI,, "'e.::, -'.'.::: t::i. p:. s:e c: L:.. o1::, r s i:::. I": t'-: o t: K s:i.,' y e..t' -t. n v e r. 3. o:!,e:':v. ii.: i. i1. i.'E.::''.:I. i. i.'L.'..@':: i].:::',.:)., o:u Fun,:' i'.l o (:.:e, f:.'i.:.''-'i. to: i.: e e t2 a c..iK r'i F, th:.i:e tI. C.)'T:' F I'h.'at hs! p sd s c i ie c:.o ]c:;K was st If......t... i The c:u.r. ouo,, r he e I' u.:':,s.in,'tes...s,:;..::,:o:'i. 1., d:. n d:l:i t..:'.e:i s;: s.: r e a:,:. t r (:, e l, dl,. a,::; t.' i e a,:I, c. c K- o v e:r..F' L o....,.' c: hP e c: K s t h e f 3.,: o v e r'-. n ( F 0 R ) b:i. t o F t I", e C: S F fm0 re t..a.n: n e:'. e haf,, t, s o c: u r r e d s i n c: e in e: 1,.- s it e i.' e' v:: e d 4. e. 3. o: i 1.. a s.1 y:, E TI. cei I a'!rs the overflow fI. (] O',r1... i L.A )':,and! -F' C R. IQ.''it before. it returns 1...{.j i,.,. i.... l.' e', Ut., f'. e.'c o r',.: ro 3. S,:t o'b t r a i r p r' o. T' a r n F:' S E C E P TI y r U y FI y ] B::','... P, lE t y C0 N I.....l F:r, F F: i. 1... ": E ", r y F R S (y. I...': L. H 0 LU R y M.:1 N l'T'1 y S E (::: U i. ) %.:N c 1...': C. F: C R' t. R'..:::: Rn 1. 7',:::: "T' "h' 4*:, y'f' h e,:' i:i:i "es.s,:::F t hi e c: (:on tr f' 0 1o' l: +,. *' i. t-. 1, e s.r of ~.~~~~~~~I......;. et Y tI-,e..' v.,,.- -. w,,.' UP...C) FLP'"... a.

ythe clocK is 1704 20 ( oc tA. ) CH F"OR: 0100 Th J. ms i.'K " nu. lm b er i. s us ecl t o c: h ec: K w h e t her.t h e F 0' t::,:i. t;:i.s s. e t, CL.R! OF 01020)0 - Th i.s "m asK" n u mb er is used to c:le'a r t'he FOR,an d' the OVFLO FLAG b its. T VEPI Bt ] T: OIR;l:f tCe K F:' C S P t.7e' OFR b i.t i.s C: 3. eiTar b,ran c: o t ctinue BE Q N 1OFO -R t 1the r outine t O herwis e p: r i n t an e rTor mi es — %JR R t" C 0 F. M,:: s, a, e s a y i t. t h,,a f 1 a o a v e r T r u n o c c: u r r e d N 0 F' r I N C M I L S E C:; In: r e m e n t t h e m i ]. 1 3. i e c o n d c o u n t e y' + * CMIP M:T L.SECy o4K C 0 175 0 Comnpa re the present. ei. i.. s c ond cott to t BLO CL. EAF.R 100. (dc c: i. r. l) I'f: L. SEC i.s 1. owe r th an 1.000 bI r''an ch to CLEAR. CLR...L.SEC Si n c e M 3: L.. lS:.C i s 100(0 or f r e, ater f, c.le'ar it, EN ~ E C',N D ta n c! i n c r e m e ni t t i-i e second c o1. n te r C.. F E-: C C) N: 7 4.' 7 4: C, o m p 1:. e t h e p r e'-.s e n t s e c: o n c c: o u n t t o 60'I... 0B CEPR 1.... a. E.A F ( ci e c:i.,:i. m a:. S ECO'..d C N D i o i'.':Lowe r th i:n 60!:'fr.an c: h t. o C L EAR t:,',:C E, 0 N'.- S in c:: e s E C ON iO:i.s 60 o r.. r,:. e r c ear i i I NC: M INU.... an. i nc. T e rI e rn, ct h e m nut e c c ou n t C.:. M,: I N TE:'7 4'. Cco ml P Y' r e. c e p r e e n't m:i. n u t e c o u n t t to 6c 0 i..: - i I.- I C TI.... E... CLR i:f: ip I i'",::' Ci:i.nce M] iN ii'tf E is': 6 0 o ].' r..:.) re1:te, i 0 t e r ce' y I i C: H 0 U R o. i n i n c r e r e n t t- hi e h o u. rc c u n; L EAR:' 1: C:... F:' CS F:; DR F C 1. e, a r t h e C) V F I... C FL A G an F':i. t i.P t h ey a Tr e set I".1.,T]<R:e t u r n F r o m t, h i. s i nt e r u p t. s e r v i.c:e r c:. t i n e0.:. HT "[ 1: ow:i. n s. (:, p;, I' r' m, s e mi e n t S' F:' C.. L.. K "..;.'. o'f' t h e c1. c t: y s e n:i:n.,a " "s I'.l..,F...' c:: o d e:.," t o: t h e c.i.: n t o 1 st a r e i t.e r o t h e 1 c <..,:' I~~~~~~T. C3:RRA:.::.7C042C. 1"e add::,.Tes'!.-s,::,P' tH' h ec.: con tol't. us t re!::onstr'el. II.......14.............'i:: 00 ).... s /..... si s t e c t c o n t r o ~, r" u.p t::' i',.,!e c t i y.... f:' ".-.'"- t, he e y.. (.:' o:, a:1. r. d. T h e s e c o n d wo'd.. o"F % j" e': t..: y i:.:;,:::' i:, i.,.:1. n t.:. T' r u p,'t v e-:, c % o'r'- c o'':x t ri' s t. h ~;p r: o: e s s o' s'.:" u. w o T' d (P:: S 4 ) t h a t wi i ]. beu. s e d, when a. K e y:,1 i., r:::..i i'.:. S':i. bei.n sericei ( D,::.' d,; T h e c.t'' e n'. i' S W v,:.. L e ( 140, ) s h o u: 1. b, e " reset' to - th: ",e v'.:: -'..i ha d be1f ore t'i,,: t e a 1..r — y et y t: e::. T e i'''i.: n.e ( 40...' Th:i. s w i.. 1. r e se(.:.. e'-,', i:'::',,'a r'i. n te e r u i i;a p r. o r': S'. ty 1. eve 3. I. c. I'. o: 7 (h"..':.! h e s t p r i. o r i.'rt y ) tr:,m:i. ts cur —

y r ent level. 3'STPCL F'CV. r: O, 0 3V.. i L C L C RA D R. Sto p t h e c: I o C: K OV' 0 V *.0 0 0 354 0 y K E Y V EC+2 y.Reset t t h e K e y b o: r: i. n t e r.p p t P r oc:ess s. r s. t tus w o rT d b a c: K to it. s o -. C i 3:i.. n a 1. va ]. ue. e T S F'C R- et.1 n t t:'a' h e 1 c 1:i. n t p r o r",a m 1 1h. f o 1 o w i n p r o:', m ^ e e ni tS G. p'r i n t 3a rr e s s 3' t t I, u s e T t w: l). -1 n I h i m t h Q. Ft 1 a. o v r r -: tu n h a.s u r. Y' e d. r e f 1: a ve r: r, r.e'' r.:: o: C C:. s,' t.h.' c: ] c.cl cK cveT -f"3.C'ow1.s w' t.h overT fl'.ow P].'a:i.s.t:i. i..,set f"s-roi th i 3.'a.he st ove.T — fl. ow. that is the:L n te rIupt se rvice -rouAt n y whih cl ears the.ove (.-r ].:ow f'1 a.. h i n t i n e i n hed s.': r v i c: i n; t e p e v:i. oi u s v e r.f. o. + F JSE C'T F C F.:. 3..:, W G]:. g R EL C ON.(3 I...B L F I C.: R S G MC..... P 1 NT i; f OR;'iS0 P i t * 41 t}j5-~ -;p:1. irit 7a W t SI fil t the user.r i T' F C. t R. Fu'.; R n t L e c a' I' p r...'r a I. MES~n~t.ASCIZ /A CLOCK O'ERFL01 OVERR"UN I —-:. O RRE! fEVE S..1 T h., i s Y.. s t.'a e "::. d i: e c:'a d.; e the 3, 1 as t s.t. t 1 m e: n:.. f'a r tn i o d d n u b.:') r of Lb y t e.s ia (i eve ry i s t, r t''.. i,::11 n.. i t e L' i n o n ". an eve nv n tm L: e i-: cf' d:.c e s:... E::. N D

S'. u iB.UT'T. N E E TT ( H M S I. M *... vC G e * "y.t 4.: r..c i p. i:n: C, u i::, r out - t;. S r' e-, S.,: Ei T I'... M 2 i. pl p.oi.;n lasy 2F'i. fyor te p'r' o Cv 7im d1f c s an:.:, a.. y T (t', o s e;p' o:m m.:.r to as et:; C:: MON b::,. c: i. va. ria bl es2.: iOi.y M i I NUTE:y SECONL i Dy MIL..SEC SE.TTIM: i iimpl. y C.. a:::. 7'. ie! s..F o::-P. assi.: s.tn s t'i, 4; e tl;.. t, h la t eq ua,:.te t h e cd umIm y la' t u r e r t.'o the C;-.'!.:. va 1:. -en, M M C) N b 1. o::: V,:i T::a. bl. (. L:::: i. 1.:i. r.= E'X.. i:. r p 3 e: C C; I,:..::.'C 3.::':.: 4 ).... 2a.. wil.l. se EC t the va 2.:e o)F'.OUF to i. v:i uTE: to 2c EECONDe to 3 and C T iLSEC to 4. T he.'' e n s.: t: d b: i e i n te e r c: on sta n t'.' o r v': r i ab - e C R ".r:-.ent. C i NTE CE i *2. F' < e t:. va. e. n h'..Cti; i'. 1 NNT.E r. R >: 2.' r e s e n v 1. u e.:. e L n m i n u t e..', F: s3 N T 1 E,.3 E:G.ER,. {<:.. ~''.,". eN,.. se n t. va:1..t ie. of' i. me i. n s. — e on d s. C S: I NT E i S P.r va. l e o-.: t i. ti e ir m i l1:i. ie )n d. CI~~ ~"',':: m r (:. " b.. c: K C: M O i" C:, / CL.'.:E I... L / HC L.!. i: ji.N IUT i.: cSE: CO N I) i,:!: 1...-. E: C L. 5 H, L, T......... 0..' 5,I i 1....,1 E C CF:>10 Lii~~::: O:NFC LiO,'R l:2T:, 3 e: N "E Ev P se 2l oFP t: i.me >.i ho C.' MN L. 4 iTE l I' I:. F' r e S-Et -, v, 1. ue o-f t i. e:i. ri; ri:L n ute:.. C I..-E C IiTEG. F' e v. of t e i n i.:. e on d r:: E r (:..Y,'' a. RE,:. E r, c e c: None C' t/j -:;I. t'.: r' i::. 3.:r.: <: R::: r'::.. r' VC Te i, C). C) d C: J *a C; in i.I % 1 C. v o...r M i.-i h ir 2: T 4 1..' i:'" 1,_' C. U C.:.:.ela r t:i. C iI E. E:P..1-1......M.S,"* i,, C S (:)trrm(r' th:'. 1 (::,!., t.e*...'.:t

HO U RF -:: H'i 1 NU T E. 1I. SE: = MS. 8. t T, n t: t eC. i. C.: e *.' r'::,'t.. h e c:I.::i. n p rc. r Tr a m R ET UL FN E1N D

Library Source Code Listinss PAGE E-5 F'E-EK AND POKE ROUT INI.S The ol].lowins pa:).es cornt.ain the sou > c.1 e c:ode -FOT' t ihe routines. PEEK F'OKE:

4' *~stt: rz: 8'k5 t+5;.45 s.,;:PE KFDK` MAC *: S ( 3ne e r5a 3.r:...Lesc: r i pt.: i.n t 3 Subrout. i. nes FPEEK all d POKE'are T' FOR:TRf:AN c l::t.l:Lble 3.ae,'ae rubl3.y 3.,an gu'ate rou. tines; th at read *the. contents o'f'a pa Crticula.i3. Cr me-o ry loc adtiCion'ar di retu.rIn that Y v'alue p and wr i te a ce rt'a in vialue tCo A.ii.ven rreruo ry.c:a t iLo n, respectc iv e t y. Y The va lues'and'a ddresses entered:i. i'n the FORT:N cci 0v. 1.ra shoeld be.. -^ r'i v.n:i. n d' ec i rn'-a 3 c. o, r r 4' a C ~.. i:f'i on: 3. c: t: None?,e ie:-......: *...-,'-i.,- the ad ress that i s to K K.ED As 3 na s s e::..... br 1 lfi,:N 3. a n iD.}l ui ac:: er-.. te a d i r e s-.,y3 cs' r e t h Ci i A D D R E S y i:'ass e ci si. n 1. c at i orn 2(R: F- r o F iiTR A T F fNq bt': LU - e FTRAN I NTEERS 2 varia.e whose vr:yl.u e i. 5 3: as 1' i 1 a n p u a ^ eyt e a d di r e Cs so V A L. UE 5 a..:3. i n s synt a: x a <.. s C n o tAL. PEE i v' i Y I AE 5s:,,.1'.-.>';:i. T1"i cal.l 1 c:'as..:s t cont: C t: s:i t!CF' meoriC)ry.: loat'_ion C U e $ CAfhL L P::t!.::E.:!EK':1. 30..;{.: ) 7 T j. s.:i.3. c'.u. sne- t l; e: a n t e - t s oP: I'I o r y f' u.at i'a. 3. tm o. b <.* V s l...1l1 t,..: tlii-1. -.'..ly.ii31.: -~*

'7 i:,!.:'I J" C: t,.'.' -: *.. Y., t e.. i t. - in':n d C ontrol L'abor -.'t or y e..,a, t t Y e n t. o F M e c: h a n i. c::: 3. E n::i. in ee' ri n J U i t f M ive y of Mi an Ar n Tb oP Mi. I.. a I I 5 1 4 — 212 5 <.. y oTITL. E StUBROUTI]:NES PEEl':: AND P'OKE:. jI (, In Cto r Nister 0. R 4Move the content. of the. i edadd ress:1. n yto t con tenI? ts of Y L UEO MO,.:''.e t, e t h e v a,_ 1 e of - T:se 0 r 0. T:, t' t BO UT ~r I N I'E PE K P' E E;' KV,, I i"i ri t -. i::. r,.P -:' k ) T'. or e1, h I c:o C O I, t os oer'r' e. t i s. t h e t'r /. n., "t K.M.'2 ( R P''::..",. o v e t h c t t e s i. e d add. e s s ( 1c o r't e n to o- M~ ~ ~ ~ ~ ~ ~ + 2,.. OY)':?;22*, ^,0 e, S ) St r.t C o the L ta c.i - r;tA::-:ES) in. o?es ter 0.MV ( R,, (c,,.,4, y) M o v e t h e c: o n. e n't. oc!f' i; e' ie. dr j. e On te t I e Cl I T hCI contdd ress of yL.,, *.R..., ore "e" i; Fl, e 0 to i.s' er 0.iP. ronai. v'tahue,,::. rOi.. P,..,.I. ~..t.l...t~.l~ T C I. i;TS PCB D E S etu:n. C -", c a P r C0 Ta <I:< BTT.. EK Nuv T I i,: PS E P Oi t..R W y'.. I-' y (3B r R E L y.CONJrlt( l'i(S (3t. Rt.|'{'$ C.S^ S..'* (i|.