/ Writes the Switch Register value in all memory locations and checks (CURRENT < ENDOFMEM). Outputs to teletype if error detected. / Reset CURRENT, ENDOFMEM, LOOPINDEX, LOOPCOUNT, SETCOUNT, before each run if program is manually stopped. / TODO: Delay the program during line feed and carriage return to prevent printer misalignments. / Program written in memory location 5410. / Starting Memory Location is 5410. / There is a gap between the program due to constraints in usable memory locations. Addr Code 5410 7300 MAIN, CLA CLL 5411 1310 TAD CURRENT 5412 7041 CMA IAC 5413 1311 TAD ENDOFMEM 5414 7450 SNA 5415 7402 HLT / Stop program once CURRENT reaches ENDOFMEM 5416 7300 CLA CLL 5417 7404 OSR / Get bit pattern from Switch Register 5420 3710 DCA I CURRENT / Write into address denoted by CURRENT 5421 7404 OSR / Get the same bit pattern again 5422 7041 CMA IAC / Convert to negative form in 2's complement 5423 1710 TAD I CURRENT / Add with value in CURRENT 5424 7440 SZA / Change this to 7450 SNA for print when ok 5425 5231 JMP TELE / Value in AC will be zero if memory is ok 5426 2310 CONT, ISZ CURRENT / Move to the next address 5427 7000 NOP 5430 5210 JMP MAIN 5431 7300 TELE, CLA CLL / This section prints the address in octal format 5432 6046 TLS 5433 1310 LPCNT2, TAD CURRENT 5434 7012 LOOP, RTR 5435 7010 RAR 5436 2316 ISZ LOOPCOUNT 5437 5234 JMP LOOP 5440 0312 AND CONST1 5441 4271 JMS PRINT 5442 2315 ISZ LOOPINDEX 5443 5266 JMP LPCNT1 5444 1310 TAD CURRENT 5445 0312 AND CONST1 5446 4271 JMS PRINT 5447 1321 TAD SPACE 5450 4271 JMS PRINT 5451 2323 ISZ SETCOUNT 5452 5261 JMP TCONT 5453 1320 ENDL, TAD CAR_RET 5454 4271 JMS PRINT 5455 1317 TAD LINEFEED 5456 4271 JMS PRINT 5457 1322 TAD SETCONST 5460 3323 DCA SETCOUNT 5461 1314 TCONT, TAD LOOPCONST 5462 3315 DCA LOOPINDEX 5463 1314 TAD LOOPCONST 5464 3316 DCA LOOPCOUNT 5465 5226 JMP CONT 5466 1315 LPCNT1, TAD LOOPINDEX 5467 3316 DCA LOOPCOUNT 5470 5233 JMP LPCNT2 5471 0000 PRINT, 0000 / Return Address 5472 1313 TAD CONST2 5473 6041 TSF 5474 5273 JMP .-1 5475 6046 TLS 5476 7300 CLA CLL 5477 5671 JMP I PRINT 5510 CURRENT, 0000 5511 ENDOFMEM, 5410 5512 CONST1, 0007 5513 CONST2, 0260 5514 LOOPCONST, -3 (7775) / Loop 3 times 5515 LOOPINDEX, -3 (7775) 5516 LOOPCOUNT, -3 (7775) 5517 LINEFEED, 7732 / 0212 - 0260 5520 CARR_RET, 7735 / 0215 - 0260 5521 SPACE, 7760 / 0240 - 0260 5522 SETCONST, -12 (7764) / 12 sets of printed data before line feed. 5523 SETCOUNT, -12 (7764) / End of Program.