|
|
DataMuseum.dkPresents historical artifacts from the history of: RC3500 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC3500 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 9216 (0x2400)
Types: TextFileVerbose
Names: »lmitxt040«
└─⟦2c55ea56f⟧ Bits:30001844 SW-save af projekt 1000, Alarm-system
└─⟦093e2ad1c⟧
└─⟦this⟧ »lmitxt040«
;;
.m rc 3502 micro-program - input/output instructions
;;
;;
;; file: lmitxt040
;;
;
;;
;; procedure xmitwordt(dev,func,data);
;; procedure xmitword (dev,func,data);
;;
;; entry: w0= dev, w3= data, w4= func:
;; 00: read data,
;; 40: write data,
;; 80: read status,
;; c0: write control;
;; exit : w0= w3= w4= unch, q= chan= dev and 7;
;;
xmitwordt: ;proc xmitwordt;
,h ,cjs pty perror ; testparity;
xmitword: ;proc xmitword;
bf:=w0,h , ; select the i/o module
xmitword1: ;
q:=w0 ior 100,h , ; q:= dev ior iors0;
bf:=q,h ,cjp not st2 k ; repeat msel:= q until -,busy;
q:=w0 and 7,h , ; chan:= dev and chan-mask;
bd:=q ior w4,h w , ; xbus:= func ior chan;
bf:=w0,h , ; msel:= dev + iors0 + iors1;
bd:=w3,h w ,crtn ; xbus:= data; return;
.p ;
;;
;; procedure waitrec;
;;
;; entry: -
;; exit : stat(zro)= -,(timeout or eoi);
;;
waitrec: ;proc waitrec;
,h ,push ditimer1 ; rc:= ditimer1;
,h ,twb st5 waitr05 ; repeat
,h i ,cjp waitr07 ; if -,dibusy then goto testeoi
waitr05: ; else rc:= rc-1 until rc=0;
,h i ,push ditimer2 ; rc:= ditimer2;
,h i ,twb st5 waitr10 ; repeat if rc=0 then goto eoi
; else rc:= rc-1 until -,dibusy;
waitr07: ;testeoi:
w0-w0,h i s,crtn st3 ; stat(zro):= true; if -,eoi then return;
waitr10: ;eoi:
w0--w0,h i s,crtn ; stat(zro):= false; return;
;;
;; procedure seteoi;
;; contains h in all words
;;
;; entry: ra= reg;
;; exit : ra= unch, q= undf;
;;
seteoi: ;proc seteoi;
q:=--2,h , ; q:= fffd; (* = -,eoi *)
q:=q and zd1,h , ; ps:= ps and -,eoi;
zd1:=q,h ,crtn st3 ; if -,eoi then return;
seteoi1: ;
q:=q ior 2,h , ; ps:= ps ior eoi;
zd1:=q,h ,crtn ; return;
.p ;
;;
;; procedure readluptr (* 22,5x = 4,9us *)
;;
;; entry: -
;; exit : w1= q= undf, w2= m.b, readmem56 started;
;;
readluptr: ;proc readluptr;
,,cjs readluc ; readluc;
w5:=bd--,h w s,cjs readluct; d:= waitmem; readluct;
w6:=bd,h w s,cjs readnextt ; b:= waitmem; readnextt(b,d);
w1:=iocdae0,h , ;
w2:=bd,h w s,cjs rterror ; m.b:= waitmem; testhparity;
,,cjp not b1 readnext ; if -,nill(m.b) begin readnext(b,d+2); return; end;
q:=w1,,cjp xept ; exception(nill-ptr);
;;
.instruction iocci ; clear-interrupt;
;;
;; param:: none;
;; stack:: -> ;
;;
w3:=zd1,, ;
w3 and 4,s, ;
,,cjs zro clear ; if not sib.to then clear;
,,cjp fetch0 ; goto fetch;
;;
.instruction ionci ; clear interrupt after next instruction;
;;
;; param:: none;
;; stack:: -> ;
;;
w3:=zd1,, ;
w3 and 4,s, ;
,,cjs zro clear ; if not sib.to then clear;
c:w0-w0,,cjp execnext ; cry:=1; goto non-interrupt-fetch;
.p ;
;;
.instruction iocda ; get devno;
;;
;; param:: none;
;; stack:: msgprt: addr -> devno: word;
;;
,,cjs readluptr ; m.b:= readluptr;
w1:=msgtype--,h , ;
w1:=w1+bd,h w s,cjs read12t; m.d:= waitmem+msgkind; read12t(m.b,m.d);
w3:=7f,h , ; devmask:= 07f;
w3:=w3 and bd,h w s,cjs rterror; devno:= waitmem and devmask; testpty;
,,cjp b0 wrfetch ; if waitmem(0)=1 then goto wrfetch(devno)
q:=iocdae1,, ; else exception(msg-type-error);
,,cjp xept ;
;;
.instruction cgreg ;
;;
;; param:: none;
;; stack:: -> regno: word;
;;
w3:=reg,,cjp wrfetch ; goto wrfetch(regno);
;;
.instruction cslev ;
;;
;; param:: none;
;; stack:: level: word -> ;
;;
,,cjs readlucq ; readlucq;
w0:=q,,cjs setlint ; level:=q setlocalint(level);
,,cjp fetch0 ; goto fetch
.p ;
;;
.instruction iowc ;
;;
;; param:: none;
;; stack:: dev, control: word -> ;
;;
,,cjs readluc ; readluc;
w4:=0c0,h , ; func:= writecontrol;
w0:=bd,h w s,cjs readluct ; dev:= waitmem; readluct;
w3:=bd,h w s,cjs xmitwordt ; xmitwordt(dev,func,waitmem);
,,cjp fetch ; goto fetch;
;;
.instruction iors ;
;;
;; param:: none;
;; stack:: dev, control: word -> status: word;
;;
,,cjs readluc ; readluc;
w4:=80,h , ; func:= read status;
w0:=bd,h w s,cjs readluct ; dev:= waitmem; readluct;
w3:=bd,h w s,cjs xmitwordt ; xmitwordt(dev,func,waitmem);
,h ,cjs waitrec ; waitrec;
w3:=bd,h w ,cjp wrfetch ; stat:= xbus; goto wrfetch(stat);
;;
.instruction iogo ; general output
;;
;; param:: none;
;; stack:: dev, func, data: word -> ;
;;
,,cjs readluc ; readluc;
w0:=bd,h w s,cjs readluct ; dev:= waitmem; readluct;
w4:=bd,h w s,cjs readluct ; func:= waitmem; readluct;
,h ,cjp ioww10 ; goto common-write;
.p ;
;;
.instruction iorw ;
;;
;; param:: none;
;; stack:: dev: word -> w: word;
;;
,,cjs readluc ; readluc;
w4:=0,h , ; func:= read data;
w3:=0,h , ; control:= 0;
w0:=bd,h w s,cjs xmitwordt ; xmitwordt(waitmem,func,control);
iorw10: ;common-read:
,h ,cjs waitrec ; waitrec;
w3:=bd,h w ,cjs seteoi ; w:= xbus; seteoi;
,,cjp wrfetch ; goto wrfetch(w);
;;
.instruction ioww ;
;;
;; param:: none;
;; stack:: dev, w: word -> ;
;;
,,cjs readluc ; readluc;
w4:=40,h , ; func:= write data;
w0:=bd,h w s,cjs readluct ; dev:= waitmem; readluct;
ioww10: ;common-write:
w3:=bd,h w s,cjs xmitwordt ; xmitwordt(dev,func,waitmem);
,h ,cjs seteoi ; seteoi;
,,cjp fetch ; goto fetch;
;;
.instruction iogi ; general input;
;;
;; param:: none;
;; stack:: dev, func, dataout: word -> datain: word;
;;
,,cjs readluc ; readluc;
w0:=bd,h w s,cjs readluct ; dev:= waitmem; readluct;
w4:=bd,h w s,cjs readluct ; func:= waitmem; readluct;
w3:=bd,h w s,cjs xmitwordt ; xmitwordt(dev,func,waitmem);
,h ,cjp iorw10 ; goto common-read;
.p ;
;;
.instruction ioibx ;
;;
;; param:: none;
;; stack:: msg: addr; last, first: word ->
;; sad: addr; count, top: word;
;;
,,cjs readluptr ; msg.b:= readluptr;
w1:=msgtype--,h , ;
w1:=w1+bd,h w s,cjs readluct; msg.d:= waitmem+msgtype-1; readluct;
w7:=ioibxe0,h , ;
w3:=bd++,h w s,cjs readluct; top:= waitmem+1 (*last+1*); readluct;
w0:=bd,h w s,cjs read12t ; first:= waitmem; read12t(msg.b,msg.d);
w5:=w1+2,h , ; msg.d:= msg.d+2;
ir:=20,w6:=w2,h , ; ir.shift:=logical
w4:=bd,h w s,cjs terror ; type:= waitmem; testparity;
q:=w7,,cjp b0 xept ; if type = chtype then exception(datamsg error);
.p ;
,,cjs readnext ; readnext(msg.b,msg.d);
w1:=ioibxe1,h , ; err:= size error;
w4:=>w3++,h , ; wtop:= (top+1) // 2;
w4--bd,h w s,cjs terror ; stat(acy):= (size < wtop); testparity;
q:=w1,,cjs acy xept ; if size<wtop then exception(err);
w1:=slu,,cjs readnext ; readnext(msg.b,msg.d);
c:w3--w0,h , ; cry:= (top > first);
w2:=ioibxe2,h , ; err:= first not less then top;
w7:=bd,h w s,cjs terror ; sad.b:= waitmem; testparity;
q:=w2,,cjs not cry xept ; if top<=first then exception(err);
w2:=slb,,cjs readnext ; readnext(msg.b,msg.d);
w4:=w3,h , ; b:= slb; d:= slu;
w4:=w4-w0,h , ; count:= top - first;
slu:=slu+8,h , ; slu:= slu + 8;
w0:=w0+bd,h w s,cjs writenextt; sad.d:= waitmem+first; writenextt(b,d,top);
w3:=w4,,cjs writenext ; writenext(b,d,count);
w3:=w7,,cjs writenext ; writenext(b,d,sad.b);
w3:=w0,,cjs writenext ; writenext(b,d,sad.d);
,,cjp fetch ; goto fetch;
.p ;
;;
;; end of lmitxt040
;;
.p
«eof»