! program to transmit basic blocks at full speed round the ring ! b.g. 03.sep.81 %control 1 %include "deimosperm" %begin %recordformat mef(%record(mef) %name link, %byteinteger len, type, %c %integer address, %integerarray a(0:100)) %recordformat pf(%byteinteger ser, reply, %integer a, (%integer b, c %or %c %record (mef) %name mes, %byteinteger len, s1)) %record (pf) p %integer i,j,k %constinteger ring ser = 13, buffer man = 17 %owninteger len = 10, dest = 0 %owninteger count, c2, c3, x, y, z %routine get buffer p_ser = buffer man; p_reply = id p_a = 0; p_c = 0 pon(p) %end i = map virt(buffer man, 6, 5) i = map virt(buffer man, 5, 4) p_ser = ring ser; p_reply = id p_a = 0 ; p_b = 0; p_c = 200; ! claim input ports pon(p); ! enable input to me prompt("Transmit?") readsymbol(i); skipsymbol %if i = 'Y' %start get buffer; get buffer; ! double buffer len = 20 prompt("Len?"); read(len) prompt("who to?"); read(dest) alarm(100*50) count = 0 %else printstring("Set for receiving side only ") %finish %cycle p_ser = 0; poff(p) %if p_reply = buffer man %start p_ser = ring ser; p_reply = id p_mes_address = dest; p_mes_len = len p_a = 1!x'80'!x'40' pon(p) count = count+1 %finish %if p_reply = ring ser %start %if p_a = 2 %start p_ser = buffer man; p_reply = id; p_a = 1; pon(p) %continue %finish %if p_a = 0 %start; ! ouptut gone get buffer %finish %finish %if int # 0 %start write(count, 1); newline %stop %if int = 'a' int = 0 %finish %if p_reply = 0 %start; ! timer run out printstring("No of blocks in 100 secs was") write(count, 1); printstring(" of length") write(len*2, 2); printstring(" bytes, bytes/sec =") write((count//10)*(len//5), 4); newline count = 0 alarm(100*50) len = len+10 %finish %repeat %endofprogram