URL
https://opencores.org/ocsvn/pdp1/pdp1/trunk
Subversion Repositories pdp1
[/] [pdp1/] [trunk/] [sw/] [loader-code.txt] - Rev 3
Compare with Previous | Blame | View Log
loader as read in papertapeImages/20060517/musicPlayingProgram.binorigin 77517751 73_0002 rpb read paper binary7752 32_7760 dio 7760 deposit IO in 77607753 10_7760 xct 7760 execute recently read instruction7754 32_7776 dio 77767755 73_0002 rpb7756 32_7777 dio 77777757 73_0002 rpb7760 60_1411 jmp 1411 jump to 1411 (overwritten by 7752!) -- holds DIO/write pointer7761 21_7760 lac [7760] load ac from wherever 7760 points \7762 40_7776 add 7776 add value from 7776 to AC } *7776 += *77607763 24_7776 dac 7776 save AC there /7764 44_7760 idx 7760 AC <- ++*77607765 52_7777 sas 7777 skip if AC=*77777766 60_7757 jmp 7757 jump back to 7757 if *7760!=*77777767 20_7776 lac 7776 AC <- *77767770 40_7777 add 7777 AC += *77777771 73_0002 rpb7772 32_7776 dio 77767773 52_7776 sas 7776 skip if AC=*77767774 76_0400 hlt halt if checksums didn't match?7775 60_7751 jmp 7751 restart loader (executing the next tape instruction)jumps to entry point 7751 after loading that codefrom this we gather:first word will be DIO origin, where origin is the first address the program is loaded tothis instruction will be stored at write pointer (7760), 7776 (checksum in progress) and originsecond word is deposited in 7777; this is DIO to the end address (first address NOT written)third word etc is written at origin and added to checksum 7776 until write pointer=end addresswe've now reached 7767AC is loaded with end address plus checksum thus far, another word is read and deposited as checksumif calculated checksum in AC does not match this newly read checksum at end, haltotherwise, start loading all over againthis allows a block format, where each block is:DIO startDIO endend-start data wordschecksumFinally, as the first word always executes, a jump instruction can start the program.So, in papertapeImages/20060517/musicPlayingProgram.bin the program blocks are:0003-0100 checksum 7165740100-0200 checksum 623702 (assuming from here on 000000s are block boundaries)0200-03000300-04000400-05000500-0546jump to 0404, the entry point of the program
