mirror of
https://github.com/pkimpel/retro-b5500.git
synced 2026-02-13 03:34:29 +00:00
Commit DCMCP transcription as of 2013-01-07; further development of B5500ColdLoader.html.
This commit is contained in:
@@ -18939,3 +18939,96 @@ DECLARECCVARIABLES; 20701500
|
||||
REAL FXTOG = RETURNVAL+1, % BEGIN LOCALS OF CCSET 20702000
|
||||
LOK = FXTOG+1, 20702100
|
||||
N = LOK+1, 20703000
|
||||
SENSETOG = N+1; 20704000
|
||||
BOOLEAN FT=N; DEFINE FH(FH1)=M[T+FH1]#; % RESET FILE A/B %815-20704100
|
||||
SUBROUTINE CLEARTHEFILE; % CLEAR AN IN-USE FILE %815-20704200
|
||||
BEGIN %815-20704210
|
||||
FH[4].[01:06]~0; % EXCLUSIVE %815-20704220
|
||||
FH[4].[16:20]~0; % OPEN COUNT 2 %815-20704230
|
||||
FH[9].[01:28]~0; % TOGS & OPEN COUNT 1 %815-20704240
|
||||
DISKWAIT(T.[CF],30,T.[FF]); % FIX IT %815-20704250
|
||||
FILEHOLD(CMM[2],CMM[3],0,T,0); % MAKE UP WAITING PROCESSES %815-20704260
|
||||
LBMESS(CMM[2],CMM[3],11,26,0,SPOUTUNIT,1); %815-20704270
|
||||
END CLEARTHEFILE; %815-20704280
|
||||
REAL SUBROUTINE SCAN; 20705000
|
||||
SCAN~SCN(UNITNO,CARDLOC,SOURCE,ACCUM,KOUNT,LASTSCAN,DIRECT); 20706000
|
||||
P(RCW,MYMSCW,STF); 20707000
|
||||
RCW:=RCW & P(XCH)[CTC]; 20708000
|
||||
P(0,0,0,0); % ZERO LOCALS OF CCSET 20709000
|
||||
CCSET~0; %510-20711100
|
||||
IF NOT (FXTOG:=(CN:=SCAN)=FIXED) THEN 20712000
|
||||
IF NOT (SENSETOG:=(CN=SENSE)) THEN 20713000
|
||||
IF CN!ACCESS0 THEN %815-20714000
|
||||
IF NOT (FT~FXTOG~(CN=FILEV)) THEN GO TO CCERR; %815-20714500
|
||||
MORE: 20715000
|
||||
IF (CN:=SCAN)=EQUAL THEN CMM[0]:=-1 ELSE 20716000
|
||||
IF CN GEQ IDENT THEN CMM[0]:=ACCUM[0] ELSE GO CCERR; 20717000
|
||||
IF SCAN NEQ SLASH THEN GO TO CCERR; 20718000
|
||||
IF (CN:=SCAN)=EQUAL THEN CMM[1]:=-1 ELSE 20719000
|
||||
IF CN GEQ IDENT THEN CMM[1]:=ACCUM[0] ELSE 20720000
|
||||
GO TO CCERR; 20721000
|
||||
CN:=T:=0; 20722000
|
||||
SEEK: 20723000
|
||||
IF (CMM[0] OR CMM[1]) LSS 0 THEN 20724000
|
||||
SEEKNAM(CMM[0],CMM[1],CN,CMM[2],CMM[3],N,P(0)) ELSE 20725000
|
||||
BEGIN CN:=1; CMM[2]:=CMM[0]; CMM[3]:=CMM[1] END; 20726000
|
||||
IF CN NEQ 0 THEN 20727000
|
||||
BEGIN 20728000
|
||||
IF NOT FXTOG THEN IF SYSTEMFILE(CMM[2],CMM[3]) THEN 20729000
|
||||
BEGIN T~2; GO TO L1; END; %521-20730000
|
||||
T:=DIRECTORYSEARCH(CMM[2],CMM[3],19); 20731000
|
||||
END ELSE IF N=0 THEN BEGIN CMM[2]:=CMM[0]; CMM[3]:=CMM[1]; GO L1; 20732000
|
||||
END 20733000
|
||||
ELSE GO L2; 20734000
|
||||
SKIP: 20735000
|
||||
IF T GEQ 64 THEN 20736000
|
||||
BEGIN 20737000
|
||||
IF M[T+4].[43:2]=3 THEN 20738000
|
||||
BEGIN FORGETSPACE(T); T~1; GO SKIP; END; %521-20739000
|
||||
IF (USERID EQV MCP)= NOT 0 OR 20740000
|
||||
(USERID EQV ABS(M[T+2]))= NOT 0 OR 20741000
|
||||
(NOT SENSETOG AND (M[T+2]=0)) THEN 20742000
|
||||
BEGIN 20743000
|
||||
LOK:=0; 20744000
|
||||
IF FXTOG 20745000
|
||||
THEN M[T+4].[42:1]:=TOG 20746000
|
||||
ELSE IF SENSETOG 20747000
|
||||
THEN IF LOK:=((M[T+4].[43:2]=1) AND NOT TOG) 20748000
|
||||
THEN M[T+4].[43:2]:=0 20749000
|
||||
ELSE IF M[T+4].[43:2]=1 20750000
|
||||
THEN ELSE M[T+4].[43:2]:=TOG|2 20751000
|
||||
ELSE BEGIN 20752000
|
||||
M[T+4].[11:1]:=TOG; 20753000
|
||||
IF TOG THEN % %503-20753800
|
||||
BEGIN % %503-20753900
|
||||
STREAM(DATE,J:=5); 20754000
|
||||
BEGIN SI:=LOC DATE; DS:=8OCT; END; 20755000
|
||||
M[T+3].[12:18]:=JUNK; 20756000
|
||||
END; % %503-20756100
|
||||
END; 20757000
|
||||
DISKWAIT(T.[CF],-30,T.[FF]); 20758000
|
||||
$ SET OMIT = SHAREDISK 20759000
|
||||
UNLOCKDIRECTORY; 20760000
|
||||
$ POP OMIT 20761000
|
||||
$ SET OMIT = PACKETS 20762000
|
||||
IF LOK THEN P(DIRECTORYSEARCH(-CMM[2],CMM[3],6),DEL) 20765000
|
||||
ELSE LBMESS(CMM[2],CMM[3],IF TOG THEN 12 ELSE 11, 20766000
|
||||
13+(SENSETOG|47)-(FXTOG|3),0,SPOUTUNIT,RSTOG) 20767000
|
||||
END ELSE IF FT THEN CLEARTHEFILE ELSE BEGIN %815-20769000
|
||||
$ SET OMIT = SHAREDISK %521-20769100
|
||||
UNLOCKDIRECTORY; %521-20769200
|
||||
$ POP OMIT %521-20769300
|
||||
LBMESS(CMM[2],CMM[3],-(11+TOG),41,0,SPOUTUNIT,1); %521-20769400
|
||||
END; %521-20769500
|
||||
FORGETSPACE(T); %521-20769600
|
||||
END 20770000
|
||||
ELSE BEGIN %521-20771000
|
||||
$ SET OMIT = SHAREDISK %521-20771010
|
||||
UNLOCKDIRECTORY; %521-20771020
|
||||
$ POP OMIT %521-20771030
|
||||
L1: LBMESS(CMM[2],CMM[3],-(11+TOG),15+((T=1)|30)+((T=2)|10),20771100
|
||||
0, SPOUTUNIT, 1 ); % 20772000
|
||||
END; %521-20772050
|
||||
IF CN NEQ 0 AND (CMM[0] OR CMM[1]) LSS 0 THEN GO SEEK; 20779000
|
||||
L2: IF (CN:=SCAN)=COMMA THEN GO MORE; 20780000
|
||||
IF CN=PERIO THEN CCSET:=1; 20781000
|
||||
|
||||
@@ -173,6 +173,7 @@ window.onload = function() {
|
||||
var e = document.createTextNode(text + "\n");
|
||||
|
||||
panel.appendChild(e);
|
||||
$$("PageBottom").scrollIntoView();
|
||||
}
|
||||
|
||||
/**************************************/
|
||||
@@ -288,7 +289,16 @@ window.onload = function() {
|
||||
|
||||
/**************************************/
|
||||
function makeAvailable(addr, size) {
|
||||
/* Removes "size" segments starting at "addr" from the "availDisk" map. */
|
||||
/* Returns "size" segments starting at "addr" to the "availDisk" map.
|
||||
No attempt at space consolidate is made, presently, since it is likely
|
||||
we are replacing the same file with the same size rows */
|
||||
|
||||
availDisk.push({addr: addr, size: size});
|
||||
}
|
||||
|
||||
/**************************************/
|
||||
function removeAvailable(addr, size) {
|
||||
/* Removes "size" segments starting at "addr" from the "availDisk" map */
|
||||
var avAddr;
|
||||
var avEnd;
|
||||
var endAddr = addr+size-1;
|
||||
@@ -325,7 +335,7 @@ window.onload = function() {
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
alert("makeAvailable: No map entry covers address " + addr + " for " + size + " segments");
|
||||
alert("removeAvailable: No map entry covers address " + addr + " for " + size + " segments");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,9 +356,9 @@ window.onload = function() {
|
||||
if (avSize == size) { // we will take this one
|
||||
bestx = mx;
|
||||
break;
|
||||
} else if (bestSize == 0 || bestSize > avSize) {
|
||||
bestSize = avSize;
|
||||
} else if (bestx < 0 || bestSize > avSize) {
|
||||
bestx = mx;
|
||||
bestSize = avSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -357,7 +367,7 @@ window.onload = function() {
|
||||
} else {
|
||||
addr = availDisk[bestx].addr;
|
||||
availDisk[bestx].addr += size;
|
||||
availDisk[bestx].size -= addr;
|
||||
availDisk[bestx].size -= size;
|
||||
return addr;
|
||||
}
|
||||
}
|
||||
@@ -674,9 +684,8 @@ window.onload = function() {
|
||||
}
|
||||
|
||||
/**************************************/
|
||||
function loadFileRow(ctl, eu, addr) {
|
||||
/* Extracts the next row from the tape blob and writes it to the "eu" disk
|
||||
unit. Updates the header row address word with the address of the row */
|
||||
function loadFileRow(ctl, eu, addr, segsPerRow) {
|
||||
/* Extracts the next row from the tape blob and writes it to the "eu" disk unit */
|
||||
var block;
|
||||
var blockSegs;
|
||||
var done = false;
|
||||
@@ -690,9 +699,10 @@ window.onload = function() {
|
||||
} else {
|
||||
wordCount = block.length;
|
||||
blockSegs = Math.floor((wordCount+29)/30);
|
||||
if (segs+blockSegs > header.segmentsPerRow) {
|
||||
if (segs+blockSegs > segsPerRow) {
|
||||
done = true;
|
||||
alert("loadFileRow: row too long: " + segs);
|
||||
blockSegs = header.segmentsPerRow - segs;
|
||||
blockSegs = segsPerRow - segs;
|
||||
wordCount = blockSegs*30;
|
||||
}
|
||||
if (wordCount > 0) {
|
||||
@@ -700,7 +710,7 @@ window.onload = function() {
|
||||
addr += blockSegs;
|
||||
segs += blockSegs;
|
||||
}
|
||||
if (segs >= header.segmentsPerRow) {
|
||||
if (segs >= segsPerRow) {
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
@@ -708,10 +718,10 @@ window.onload = function() {
|
||||
}
|
||||
|
||||
/**************************************/
|
||||
function loadFile(ctl, fileNr, eu, header) {
|
||||
function loadFile(ctl, fileNr, eu, diskHeader) {
|
||||
/* Extracts the next file in sequence from the tape blob, converts the data
|
||||
from BIC to ANSI, and writes it a row at a time to the disk "eu".
|
||||
Establishes the "header" disk file header from the tape and updates the
|
||||
Establishes the "diskHeader" disk file header from the tape and updates the
|
||||
disk header address row words as the rows are allocated and written to the disk.
|
||||
Returns true if no more files should be converted */
|
||||
var addr;
|
||||
@@ -725,17 +735,17 @@ window.onload = function() {
|
||||
var x;
|
||||
|
||||
spout(" ");
|
||||
spout("Extracting #" + fileNr + ": " + tapeDir[fileNr]);
|
||||
spout("Loading #" + fileNr + ": " + tapeDir[fileNr]);
|
||||
lab = readTapeLabel(ctl);
|
||||
if (ctl.eof) {
|
||||
spout("Extract: EOF encountered when tape label expected, block=" + ctl.blockCount);
|
||||
spout("loadFile: EOF encountered when tape label expected, block=" + ctl.blockCount);
|
||||
} else if (!lab.isLabel) {
|
||||
spout(lab.text);
|
||||
spout("Extract: Above block encountered when a tape label was expected, block=" + ctl.blockCount);
|
||||
spout("loadFile: Above block encountered when a tape label was expected, block=" + ctl.blockCount);
|
||||
} else {
|
||||
block = readWordBlock(ctl);
|
||||
if (!ctl.eof) {
|
||||
spout("Extract: EOF expected after starting label, block=" + ctl.blockCount);
|
||||
spout("loadFile: EOF expected after starting label, block=" + ctl.blockCount);
|
||||
}
|
||||
tapeHeader = readDiskHeader(ctl);
|
||||
|
||||
@@ -769,29 +779,33 @@ window.onload = function() {
|
||||
|
||||
// Copy the header words from the tape to the disk header
|
||||
for (x=0; x<30; x++) {
|
||||
header[x] = tapeHeader.words[x] || 0;
|
||||
diskHeader[x] = tapeHeader.words[x] || 0;
|
||||
}
|
||||
|
||||
// Load the rows and update the header address words
|
||||
for (x=0; x<header.maxRows; x++) {
|
||||
if (header[10+x] > 0) {
|
||||
addr = findDiskSpace(header.segmentsPerRow);
|
||||
// Load the rows and update the disk header address words
|
||||
for (x=0; x<tapeHeader.maxRows; x++) {
|
||||
if (diskHeader[10+x] > 0) {
|
||||
addr = findDiskSpace(tapeHeader.segmentsPerRow);
|
||||
if (addr < 0) {
|
||||
done = true;
|
||||
alert("Cannot get space for row #" + x);
|
||||
header[10+x] = 0;
|
||||
diskHeader[10+x] = 0;
|
||||
} else {
|
||||
header[10+x] = addr;
|
||||
loadFileRow(ctl, eu, addr);
|
||||
diskHeader[10+x] = addr;
|
||||
loadFileRow(ctl, eu, addr, tapeHeader.segmentsPerRow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
block = readWordBlock(ctl);
|
||||
if (!ctl.eof) {
|
||||
spout("loadFile: EOF expected after last data row, block=" + ctl.blockCount);
|
||||
}
|
||||
|
||||
lab2 = readTapeLabel(ctl);
|
||||
if (!lab2.isLabel) {
|
||||
spout("Extract: Tape label expected after file data, block=" + ctl.blockCount);
|
||||
spout("loadFile: Tape label expected after file data, block=" + ctl.blockCount);
|
||||
} else if (lab2.mfid != lab.mfid || lab2.fid != lab.fid) {
|
||||
spout("Extract: File ending label mismatch, block=" + ctl.blockCount);
|
||||
spout("loadFile: File ending label mismatch, block=" + ctl.blockCount);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -808,14 +822,14 @@ window.onload = function() {
|
||||
spout("Skipping #" + fileNr + ": " + tapeDir[fileNr]);
|
||||
lab = readTapeLabel(ctl);
|
||||
if (ctl.eof) {
|
||||
spout("Skip: EOF encountered when tape label expected, block=" + ctl.blockCount);
|
||||
spout("skipFile: EOF encountered when tape label expected, block=" + ctl.blockCount);
|
||||
} else if (!lab.isLabel) {
|
||||
spout(lab.text);
|
||||
spout("Skip: Above block encountered when a tape label was expected, block=" + ctl.blockCount);
|
||||
spout("skipFile: Above block encountered when a tape label was expected, block=" + ctl.blockCount);
|
||||
} else {
|
||||
block = readWordBlock(ctl);
|
||||
if (!ctl.eof) {
|
||||
spout("Skip: EOF expected after starting label, block=" + ctl.blockCount);
|
||||
spout("skipFile: EOF expected after starting label, block=" + ctl.blockCount);
|
||||
}
|
||||
|
||||
do {
|
||||
@@ -824,9 +838,9 @@ window.onload = function() {
|
||||
|
||||
lab2 = readTapeLabel(ctl);
|
||||
if (!lab2.isLabel) {
|
||||
spout("Skip: Tape label expected after file data, block=" + ctl.blockCount);
|
||||
spout("skipFile: Tape label expected after file data, block=" + ctl.blockCount);
|
||||
} else if (lab2.mfid != lab.mfid || lab2.fid != lab.fid) {
|
||||
spout("Skip: File ending label mismatch, block=" + ctl.blockCount);
|
||||
spout("skipFile: File ending label mismatch, block=" + ctl.blockCount);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -915,7 +929,7 @@ window.onload = function() {
|
||||
/* Controls the loading of the current file from tape and updates
|
||||
the disk directory with the new file information */
|
||||
var extendDirectory = false;
|
||||
var header;
|
||||
var diskHeader;
|
||||
var hx = slot*30;
|
||||
var nx = slot*2 + 450;
|
||||
var rowMax;
|
||||
@@ -924,24 +938,24 @@ window.onload = function() {
|
||||
|
||||
if (addr < 0) {
|
||||
addr = -addr;
|
||||
header = new Array(30);
|
||||
diskHeader = new Array(30);
|
||||
} else {
|
||||
header = block.slice(hx, hx+30);
|
||||
diskHeader = block.slice(hx, hx+30);
|
||||
// Deallocate the existing rows
|
||||
rowSize = header[8];
|
||||
rowMax = fieldIsolate(header[9], 43, 5);
|
||||
rowSize = diskHeader[8];
|
||||
rowMax = fieldIsolate(diskHeader[9], 43, 5);
|
||||
for (x=0; x<rowMax; x++) {
|
||||
if (header[10+x] > 0) {
|
||||
makeAvailable(header[10+x], rowSize);
|
||||
if (diskHeader[10+x] > 0) {
|
||||
makeAvailable(diskHeader[10+x], rowSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadFile(tapeCtl, fileNr, eu, header);
|
||||
loadFile(tapeCtl, fileNr, eu, diskHeader);
|
||||
|
||||
// Move the new header into the directory block
|
||||
for (x=0; x<30; x++) {
|
||||
block[hx+x] = header[x] || 0;
|
||||
block[hx+x] = diskHeader[x] || 0;
|
||||
}
|
||||
|
||||
// Check if using the last slot in the directory
|
||||
@@ -973,8 +987,8 @@ window.onload = function() {
|
||||
|
||||
mfid = "0" + padToLength(nameParts[0] || " ", 7);
|
||||
fid = "0" + padToLength(nameParts[1] || " ", 7);
|
||||
stringToANSI(mfid, 8, buf, 0);
|
||||
stringToANSI(fid, 8, buf, 8);
|
||||
stringToANSI(mfid, buf, 0);
|
||||
stringToANSI(fid, buf, 8);
|
||||
ANSItoWords(buf, 0, 16, names, 0);
|
||||
mfid = names[0];
|
||||
fid = names[1];
|
||||
@@ -1010,7 +1024,7 @@ window.onload = function() {
|
||||
}
|
||||
}
|
||||
if (topFileNr <= 0) {
|
||||
alert("LoadFromTape: no files selected");
|
||||
alert("loadFromTape: no files selected");
|
||||
} else {
|
||||
loadNextFile(tapeCtl, topFileNr, 1);
|
||||
}
|
||||
@@ -1048,7 +1062,7 @@ window.onload = function() {
|
||||
rowMax = fieldIsolate(block[bx+9], 43, 5);
|
||||
for (rx=0; rx<rowMax; rx++) {
|
||||
if (block[bx+10+rx] > 0) {
|
||||
makeAvailable(block[bx+10+rx], rowSize);
|
||||
removeAvailable(block[bx+10+rx], rowSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1587,5 +1601,8 @@ TBODY#TapeDirBody {
|
||||
<pre id=TextPanel>
|
||||
</pre>
|
||||
|
||||
<div id=PageBottom>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user