# spack - send a packet to the other KERMIT # subroutine spack(xtype,num,len,xdata) include ratdef include kerdef include kercom character xtype,xdata(1) integer num,len,ch # integer i,ier,count,tochar character chksum,buffer(100) # #issue necessary padding ch=rmtoutfd i=1 while(i<=pad){ call kputch(padchar,ch) i=i+1 } count=1 buffer(count)=SOH count=count+1 chksum=tochar(len+3) buffer(count)=tochar(len+3) count=count+1 chksum=chksum+tochar(num) buffer(count)=tochar(num) count=count+1 chksum=chksum+xtype buffer(count)=xtype count=count+1 # for(i=1;i<=len;i=i+1){ buffer(count)=xdata(i) count=count+1 chksum=chksum+xdata(i) } chksum=(chksum+(chksum&192)/64)&63 buffer(count)=tochar(chksum) count=count+1 buffer(count)=eol buffer(count+1)=EOS count=1 ch=rmtoutfd while(buffer(count)^=EOS){ call kputch(buffer(count),ch) count=count+1 } return end