1 /IMAGE-TO-BINARY CONVERSION 2 3 /LOAD WITH OPTIONS /8/9=2000$ 4 5 *2000 6 002000 7300 IMAGE, CLA CLL 7 002001 6212 CIF 10 8 002002 4777 JMS I (7700 9 002003 0010 10 /USR IN 10 002004 6212 CIF 10 11 002005 4776 JMS I (200 12 002006 0005 5 /COMMAND DECODER 13 002007 2326 2326 /.SV 14 002010 1375 TAD (INDEV+1 /ALLOW 2-PAGE HANDLER. 15 002011 3221 DCA INHNDL 16 002012 6211 CDF 10 17 002013 1774 TAD I (7617 /INPUT DEVICE. 18 002014 0373 AND (17 19 002015 6201 CDF 20 002016 6212 CIF 10 21 002017 4776 JMS I (200 22 002020 0001 1 /FETCH HANDLER 23 002021 2401 INHNDL, INDEV+1 24 002022 7402 HLT 25 26 002023 6211 CDF 10 27 002024 1772 TAD I (7604 28 002025 7450 SNA /SKIP IF EXTENSION SUPPLIED. 29 002026 1371 TAD (0216 /.BN 30 002027 3772 DCA I (7604 31 002030 1770 TAD I (7620 /INPUT BLOCK. 32 002031 6201 CDF 33 002032 3236 DCA INBLOK 34 002033 4621 JMS I INHNDL 35 002034 0200 200 36 002035 3400 HEADER 37 002036 0000 INBLOK, 0 38 002037 7402 HLT 39 002040 7001 IAC 40 002041 1236 TAD INBLOK 41 002042 3303 DCA INBLK1 42 002043 1767 TAD I (HEADER 43 002044 3344 DCA SEGCNTR /COUNTS SEGMENTS 44 002045 1366 TAD (HEADER+3 45 002046 3345 DCA SEGPNTR /SETUP POINTER TO 1ST PAIR OF WORDS. 46 JMS LEADER off page ^ 002047 4765 47 002050 1376 TAD (200 /SEND DUMMY ORIGIN (200) 1ST 48 002051 7120 STL /SO 'PIP' CAN READ BINARY FILES 49 JMS SEND /PRODUCED BY 'IMAGE'. off page ^ 002052 4764 50 51 002053 2345 SEGLOOP,ISZ SEGPNT 52 002054 1745 TAD I SEGPNT /ADDRESS 53 002055 3236 DCA INBLOK /SAVE TEMPORARILY. 54 002056 2345 ISZ SEGPNT 55 002057 1745 TAD I SEGPNT /FIELDS AND PAGES. 56 002060 0363 AND (70 /NOW JUST FIELDS. 57 002061 1362 TAD (300 58 002062 6212 CIF 10 59 002063 4761 JMS I (OPUTC /FIELD CHANGE IS NOT CHECKSUMMED. 60 002064 1236 TAD INBLOK /ADDRESS AGAIN. 61 002065 7120 STL /LINK(1)=SET-ORIGIN. 62 JMS SEND off page ^ 002066 4764 63 002067 1745 TAD I SEGPNT 64 002070 0360 AND (3700 /PAGES. 65 002071 7104 RAL CLL 66 002072 7041 CIA 67 002073 3342 DCA WC 68 002074 1361 NXTBLK, TAD (-400 69 002075 3343 DCA BLWC 70 002076 1357 TAD (INBUFF 71 002077 3341 DCA CA 72 002100 4621 JMS I INHNDL 73 002101 0200 200 74 002102 4000 INBUFF 75 002103 0000 INBLK1, 0 76 002104 7402 HLT 77 002105 2303 ISZ INBLK1 78 002106 1741 NXTWRD, TAD I CA 79 002107 2341 ISZ CA 80 002110 7100 CLL 81 JMS SEND /LINK MUST BE CLEAR HERE off page ^ 002111 4764 82 002112 2342 ISZ WC /SKIP WHEN LOCATIONS ALL SENT 83 002113 7410 SKP 84 002114 5320 JMP SEGDONE 85 002115 2343 ISZ BLWC /SKIP WHEN BLOCK EXHAUSTED. 86 002116 5306 JMP NXTWRD 87 002117 5274 JMP NXTBLK 88 002120 2344 SEGDONE,ISZ SEGCNT /SKIP WHEN SEGMENTS COMPLETE 89 002121 5253 JMP SEGLOOP 90 TAD CHKSUM off page ^ 002122 1756 91 JMS SEND off page ^ 002123 4764 92 JMS LEADER off page ^ 002124 4765 93 002125 1355 TAD (232 94 002126 6212 CIF 10 95 002127 4761 JMS I (OPUTC /^Z CLOSES FILE. 96 002130 6212 CIF 10 97 002131 4776 JMS I (200 98 002132 0011 11 /USR OUT 99 002133 6211 CDF 10 100 002134 1754 TAD I (7642 101 002135 6201 CDF 102 002136 7700 SMA CLA /SKIP IF ALTMODE TERMINATOR. 103 002137 5200 JMP IMAGE 104 002140 5746 JMP I K7600 /BACK TO KEYMON. 105 106 107 108 /VARIABLES 109 110 002141 0000 CA, 0 /CURRENT-ADDRESS POINTER 111 002142 0000 WC, 0 /WORD-COUNTER 112 002143 0000 BLWC, 0 /BLOCK WORD-COUNTER. 113 114 115 116 002144 0000 SEGCNT, 0 /COUNTS SEGMENTS OF SAVED FILE. 117 002145 0000 SEGPNT, 0 /POINTS TO SEGMENT TABLE IN DIRECTORY. 118 119 002146 7600 K7600, -200 /ALSO 7600. 120 002154 7642 PAGE 002155 0232 002156 2236 002157 4000 002160 3700 002161 7400 002162 0300 002163 0070 002164 2220 002165 2200 002166 3403 002167 3400 002170 7620 002171 0216 002172 7604 002173 0017 002174 7617 002175 2401 002176 0200 002177 7700 121 EJECT 122 /LEADER SUBROUTINE PUTS OUT 200 CODES. 123 124 002200 0000 LEADER, 0 125 002201 6211 CDF 10 126 002202 7201 CLA IAC 127 002203 0777 AND I (7643 /IS /L OPTION SET? 128 002204 7640 SZA CLA /NO - SKIP NEXT LINE. 129 002205 1376 TAD (7600 /YES - PUT OUT 200 CODES. 130 002206 1375 TAD (-20 131 002207 6201 CDF 132 002210 3234 DCA LCNTR 133 002211 1374 TAD (200 134 002212 6212 CIF 10 135 002213 4773 JMS I (OPUTC 136 002214 2234 ISZ LCNTR 137 002215 5211 JMP .-4 138 002216 3236 DCA CHKSUM 139 002217 5600 JMP I LEADER 140 /SEND ROUTINE TRANSMITTS A 12-BIT WORD IN 'BINARY' FORMAT, 141 /IF LINK(1), THEN BIT 5 IS SENT ON 1ST FRAME. 142 143 002220 0000 SEND, 0 144 002221 3234 DCA STMP 145 002222 1234 TAD STMP 146 002223 7012 RTR;RTR;RTR 002224 7012 002225 7012 147 002226 0372 AND (177 148 002227 4237 JMS STUFF 149 002230 1234 TAD STMP 150 002231 0371 AND (77 151 002232 4237 JMS STUFF 152 002233 5620 JMP I SEND 153 154 LCNTR, 155 002234 0000 STMP, 0 156 002235 0000 STMP1, 0 157 002236 0000 CHKSUM, 0 /CHECKSUM, MODULO 4096. 158 159 002237 0000 STUFF, 0 160 002240 3235 DCA STMP1 161 002241 1235 TAD STMP1 162 002242 6212 CIF 10 163 002243 4773 JMS I (OPUTC 164 002244 1235 TAD STMP1 165 002245 1236 TAD CHKSUM 166 002246 3236 DCA CHKSUM 167 002247 5637 JMP I STUFF 168 002371 0077 PAGE 002372 0177 002373 7400 002374 0200 002375 7760 002376 7600 002377 7643 169 /ASCII I/O FOR PS-8 170 171 /DEFINITIONS REQUIRED FOR CHARACTER I/O ROUTINES. 172 173 INBUFF=.+1400 174 OUTBUFF=6600 /IN FIELD 1. 175 INDEV=. 176 OUTDEV=.+400 177 HEADER=.+1000 178 ERROR1=HLT 179 IOAREA=7200 180 O2PAGE=1 181 182 FIELD 1 183 *IOAREA 184 /USED BY OUTPUT ROUTINES. 185 /COME HERE IN CASE OUTPUT CANNOT BE OPENED ON FIRST TRY. 186 017200 1610 OFAIL, TAD I I7600 187 017201 0377 AND (7760 188 017202 7650 SNA CLA /SKIP IF NOT INDEFINITE REQUEST. 189 017203 7402 ERROR1 /OUTPUT FILE PROBABLY TOO LARGE. 190 017204 1610 TAD I I7600 191 017205 0376 AND (17 192 017206 3610 DCA I I7600 193 017207 5775 JMP I (OUENTR /TRY INDEFINITE. 194 017210 7600 I7600, 7600 195 017375 7534 PAGE 017376 0017 017377 7760 196 /DELIVERS A CHARACTER TO THE OUTPUT FILE. OUTPUT FILE NAME 197 /MUST HAVE BEEN DEFINED PREVIOUSLY!! 198 /^Z WILL CLOSE OUTPUT FILE. 199 /CALLED BY: 200 / TAD CHAR 201 / IOF /SEE NOTE AT IGETC ABOVE. 202 / CDF 203 / CIF 10 204 / JMS I (OPUTC 205 / RETURN (ACC=0) 206 207 208 017400 0000 OPUTC, 0 209 017401 3366 DCA LAST 210 017402 6214 RDF 211 017403 1307 TAD CDFCIF 212 017404 3311 DCA ODONE 213 017405 6213 CDF CIF 10 214 017406 1366 TAD LAST 215 017407 3761 OL02, DCA I OPNTR 216 017410 1372 TAD OUTINH 217 017411 7650 SNA CLA /SKIP IF OUTPUT ENTERED. 218 017412 5313 JMP OOPEN 219 017413 2361 OL01, ISZ OPNTR 220 017414 1761 TAD I OPNTR 221 017415 7500 SMA /SKIP WHEN 3 CHARACTERS SAVED. 222 017416 5255 JMP OEXIT 223 017417 3361 DCA OPNTR /RESTORE POINTER. 224 017420 1364 TAD OCHAR3 225 017421 7106 CLL RTL;RTL 017422 7006 226 017423 0237 AND O7400 227 017424 1362 TAD OCHAR1 228 017425 3770 DCA I OCA 229 017426 2370 ISZ OCA 230 017427 1364 TAD OCHAR3 231 017430 7112 CLL RTR;RTR;RAR /LEFT-SHIFT 8. 017431 7012 017432 7010 232 017433 0237 AND O7400 233 017434 1363 TAD OCHAR2 234 017435 3770 DCA I OCA 235 017436 2370 ISZ OCA 236 017437 7400 O7400, 7400 /IN CASE OCA PASSES THRU 0. 237 017440 2367 ISZ OWC /SKIP IF BUFFER FULL. 238 017441 5255 JMP OEXIT 239 240 017442 2304 ISZ OBLWC /SKIP IF OUTPUT FILE TOO LARGE! 241 017443 7410 SKP 242 017444 7402 ERROR1 243 017445 6202 CIF 244 017446 4727 JMS I OUHAND 245 017447 4210 4210 246 017450 6600 OUTP, OUTBUFF 247 017451 0000 OUTBLK, 0 /MUST BE FILLED BY 'OOPEN'. 248 017452 7402 ERROR1 249 017453 2251 ISZ OUTBLK 250 017454 4351 JMS ORESET 251 O7600, 252 017455 7600 OEXIT, 7600 253 017456 1366 TAD LAST 254 017457 1377 TAD (-232 255 017460 7640 SZA CLA /SKIP IF ^Z RECIEVED. 256 017461 5311 JMP ODONE 257 258 /CLOSE THE OUTPUT FILE. 259 260 017462 1200 CLOSE, TAD OPUTC 261 017463 3371 DCA RETURN 262 017464 1251 TAD OUTBLK 263 017465 7041 CIA 264 017466 3337 DCA OUBLK /SAVE -BLOCK. 265 017467 4200 JMS OPUTC /PACK WITH 0'S. 266 017470 1251 TAD OUTBLK 267 017471 1337 TAD OUBLK 268 017472 7650 SNA CLA /SKIP WHEN LAST ONE WRITTEN. 269 017473 5267 JMP .-4 270 017474 1340 TAD OULENGTH 271 017475 7041 CIA /NOW HAVE +LENGTH. 272 017476 1304 TAD OBLWC /GET -LENGTH+N 273 017477 3304 DCA OBLWC 274 017500 1655 TAD I O7600 275 017501 4776 JMS I (200 276 017502 0004 4 /CLOSE 277 017503 7601 OU7601, 7601 278 017504 0000 OBLWC, 0 /COUNTS BLOCKS AVAILABLE. 279 017505 7402 ERROR1 280 017506 3372 DCA OUTINH /MARK OUTPUT FILE CLOSED. 281 017507 6203 CDFCIF, CDF CIF 282 017510 5771 JMP I RETURN /TO CALL+1. 283 017511 6203 ODONE, CIF CDF 284 017512 5600 JMP I OPUTC 285 286 IFNDEF O2PAGE 287 017513 1303 OOPEN, TAD OU7601 288 017514 3337 DCA OUBLK 289 017515 1375 TAD (11 290 017516 7001 OL03, IAC 291 017517 3326 DCA OUHAND-1 292 017520 1374 TAD (OUTDEV+O2PAGE 293 017521 3327 DCA OUHAND 294 017522 1655 TAD I O7600 295 017523 7450 SNA /SKIP IF OUTPUT POSSIBLE. 296 017524 7402 ERROR1 297 017525 4776 JMS I (200 298 017526 0012 12 /CHECK HANDLER, OR FETCH IT. 299 017527 3001 OUHAND, OUTDEV+O2PAGE 300 017530 7402 ERROR1 /HUH? 301 017531 1327 TAD .-2 302 017532 7650 SNA CLA /SKIP IF NOW IN CORE. 303 017533 5316 JMP OL03 /TRY TO LOAD IT. 304 017534 1655 OUENTR, TAD I O7600 305 017535 4776 JMS I (200 306 017536 0003 3 /ENTER OUTPUT FILE. 307 017537 7601 OUBLK, 7601 308 017540 0000 OULENG, 0 309 017541 5773 JMP I (OFAIL /CAN'T ENTER IT. 310 017542 1337 TAD OUBLK 311 017543 3251 DCA OUTBLK 312 017544 1340 TAD OULENGTH 313 017545 3304 DCA OBLWC 314 017546 4351 JMS ORESET 315 017547 2372 ISZ OUTINH 316 017550 5213 JMP OL01 317 318 /RESET POINTERS. 319 320 017551 0000 ORESET, 0 321 017552 1365 TAD OCHAR 322 017553 3361 DCA OPNTR 323 017554 1255 TAD O7600 324 017555 3367 DCA OWC 325 017556 1250 TAD OUTP 326 017557 3370 DCA OCA 327 017560 5751 JMP I ORESET 328 329 017561 7562 OPNTR, .+1 330 017562 0000 OCHAR1, 0 /SIMILAR TO ICHAR1 ETC. 331 017563 0000 OCHAR2, 0 332 017564 0000 OCHAR3, 0 333 017565 7562 OCHAR, OCHAR1 /SEE ICHAR3+1 FOR WARNING! 334 335 017566 0000 LAST, 0 /CONTAINS LAST CHAR RECIEVED. 336 017567 7600 OWC, -200 /" 337 017570 6600 OCA, OUTBUFF /" 338 017571 0000 RETURN, 0 /RETURN ADDRESS FOR RECURSIVE OPUTC. 339 017572 0000 OUTINH, 0 /0 WHEN NO OUTPUT FILE IN PROGRESS. 340 BLWC 2143 CA 2141 CDFCIF 7507 CHKSUM 2236 CLOSE 7462 unreferenced ERROR1 7402 HEADER 3400 I7600 7210 IMAGE 2000 INBLK1 2103 INBLOK 2036 INBUFF 4000 INDEV 2400 INHNDL 2021 IOAREA 7200 K7600 2146 LAST 7566 LCNTR 2234 LEADER 2200 NXTBLK 2074 NXTWRD 2106 O2PAGE 0001 O7400 7437 O7600 7455 OBLWC 7504 OCA 7570 OCHAR 7565 OCHAR1 7562 OCHAR2 7563 OCHAR3 7564 ODONE 7511 OEXIT 7455 OFAIL 7200 OL01 7413 OL02 7407 unreferenced OL03 7516 OOPEN 7513 OPNTR 7561 OPUTC 7400 ORESET 7551 OU7601 7503 OUBLK 7537 OUENTR 7534 OUHAND 7527 OULENG 7540 OUTBLK 7451 OUTBUF 6600 OUTDEV 3000 OUTINH 7572 OUTP 7450 OWC 7567 RETURN 7571 SEGCNT 2144 SEGDON 2120 SEGLOO 2053 SEGPNT 2145 SEND 2220 STMP 2234 STMP1 2235 STUFF 2237 WC 2142