Top 10k strings from T2d_disas.rtf
in <root> / doc / technical / RoelofKoning / T2d_disas.zip /
Back to the directory listing
3 ;-------------------------------------------------------\par 2 ;-------------------------------\par 2 ;--------------------------------\par 2 ;---------------------------------------------\par 1 {\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fmodern\fprq1\fcharset0 Courier New;}} 1 {\colortbl ;\red255\green0\blue0;\red0\green0\blue0;\red255\green255\blue0;} 1 \viewkind4\uc1\pard\nowidctlpar\lang2057\b\f0\fs20 Code part of \ldblquote t2d\rdblquote tape to disk copier for HC2000\par 1 \tab\tab\tab\tab\tab\tab ;ret via 16726,test break\line 16485 7C LD A,H \tab ;on return this 'parity match' is zero\par 1 \line\b 17111\b0 DDE5 PUSH IX \tab\tab ;prep to save HL\line 17113 E3 EX (SP),HL \tab\tab ;HL = channel addr\line 17114 19 ADD HL,DE \line 17115 EB EX DE,HL \tab\tab ;DE points to sector buffer\line 17116 E1 POP HL \tab\tab ;retrieve\line\b 17117\b0 DDCB3146 BIT 0,(IX+49)\tab\tab ;buffer position pointer <256?\line 17121 2812 JR Z,\b 17141\b0 \tab\tab ;jp if sector buffer not yet full\par 1 \line 17409 160811 \tab ;AT 8,17\line 17412 4F46C6 \tab ;"OFF"\line\par 1 \cf2\b0 ;small menu\cf0\par 1 \cf1\b ;###############################################################\cf0\par 1 \cf1 preliminary version of the incomplete disassembly by Roelof Koning 2005\par 1 \cf1 ;###############################################################\cf0\par 1 \cf1 17141\cf0\b0 79 LD A,C \tab\tab ;test number of bytes to go\line 17142 B0 OR B \line 17143 280C JR Z,\b 17157\b0 \tab\tab\b ;finished!\b0\line 17145 EDA0 LDI \tab\tab ;move byte in sector buff at DE\line 17147 DD3430 INC (IX+48) \tab\tab ;adjust counter\line 17150 20DD JR NZ,\b 17117\b0 \tab\tab ;if < 256 then write next byte\line 17152 DD3431 INC (IX+49) \tab\tab ;signal '256'\line 17155 18D8 JR \b 17117\b0 \tab\tab ;signal 'write this sector'\par 1 \cf0 version 11-11-2005\par 1 \b0\line\b ;return here after a successfull save---------\b0\par 1 \b0 ;current pointer is stored at 17267\line\b 17942\b0 00 NOP \line\par 1 \b0 ;--------------------------------------------------------\par 1 \b ;wait for key\b0\par 1 \b ;toggle the sound ON/OFF bit\b0\par 1 \b ;toggle the DEC/HEX bit\b0\par 1 \b ;sub: FIND START and LENGTH of file in free mem area\b0\par 1 \b ;start with preparing the screen\b0\par 1 \b ;print summary of files in free mem \b0 (only called from 17491)\par 1 \b ;print a space\b0\par 1 \b ;print a char\b0\par 1 \b ;prepare clean screen\b0\par 1 \b ;now save a sector\b0\line 17123 DDCB3186 RES 0,(IX+49)\tab\tab ;reset buff pointer\line 17127 E5 PUSH HL \line 17128 C5 PUSH BC \line\highlight3 17129 CF36 RST #08 DEFB 54\highlight0 \tab ;write \b sector\b0 to file\par 1 \b ;here starts a table holding the lengths of the files that \par 1 \b ;do 'new'\b0\par 1 \b ;cont. here for sinclair type files, header is needed\b0\par 1 \b ;cont here if no file header was used\b0\par 1 \b ;clear lower screen\b0\par 1 \b ;Print a number\b0\par 1 \b ;ERROR EXIT\par 1 \b ;BEEP\b0\par 1 \b ;-- 'AUTO' from menu -----------------------------------\b0\par 1 \b 17932\b0 CD7F45 CALL 17791 ;save registers\line 17935 CD440E CALL 3652 ;ROM: clear 'B' bottom lines of screen\line 17938 CD8645 CALL 17798 ;retrieve registers\line 17941 C9 RET \par 1 \b 17885\b0 CDEF45 \b CALL 17903\b0 ;adjust non-ASCII\line 17888 CD7F45 CALL \b 17791\b0 ;save registers\line 17891 3E02 LD A,2 \line 17893 CD0116 CALL 5633 ;open screen\line 17896 F1 POP AF \line 17897 F5 PUSH AF \line\highlight3 17898 D7 RST #10\highlight0 ;print a char\line 17899 CD8645 CALL \b 17798\b0 ;retrieve registers\line 17902 C9 RET \par 1 \b 17883\b0 3E20 LD A,32 ;space\par 1 \b 17828\b0 CD7F45 CALL 17791 \tab\tab ;save registers\line 17831 117000 LD DE,112 \line 17834 62 LD H,D \line 17835 2E80 LD L,128 \line 17837 0605 LD B,5 \line\b 17839\b0 E5 PUSH HL \line 17840 D5 PUSH DE \line 17841 C5 PUSH BC \line 17842 CDB503 CALL\b 949\b0\tab\tab\tab ;ROM beeper routine\line 17845 C1 POP BC \line 17846 E1 POP HL \line 17847 D1 POP DE \line 17848 10F5 DJNZ \b 17839\b0 \line 17850 3E01 LD A,1 \line 17852 D3FE OUT (254),A \tab ;border\line 17854 CD8645 CALL 17798 \tab ;retrieve registers\line 17857 C9 RET \line\par 1 \b 17798\b0 E1 POP HL \tab\tab ;ret addr!\line 17799 F1 POP AF \line 17800 DDE1 POP IX \line 17802 D1 POP DE \line 17803 C1 POP BC \line 17804 E3 EX (SP),HL \tab\tab ;now back on stack\line 17805 C9 RET \line\par 1 \b 17791\b0 E3 EX (SP),HL \tab\tab ;push HL\line 17792 C5 PUSH BC \line 17793 D5 PUSH DE \line 17794 DDE5 PUSH IX \line 17796 F5 PUSH AF \line 17797 E9 JP (HL) \tab\tab ;in fact this is RET!\line ;retrieve registers\par 1 \b 17769\b0 14 INC D ;equivalent to original sinclair, \line 17770 08 EX AF,AF' ; only ret addr differs\line 17771 15 DEC D \line 17772 F3 DI \line 17773 3E0F LD A,15 \tab ;border\line 17775 D3FE OUT (254),A \line 17777 215641 LD HL,\b 16726\b0 \tab ;return address, test break\line 17780 E5 PUSH HL \line 17781 C36205 JP \b 1378\b0 \tab ;ROM load bytes\line\par 1 \b 17762\b0 CD2245 CALL \b 17698\b0 ;print number\line\b 17765\b0 C1 POP BC \line 17766 D1 POP DE \line 17767 E1 POP HL \line 17768 C9 RET \line\par 1 \b 17698\b0 111244 LD DE,17426 \tab\tab ;table of what??\line 17701 013005 LD BC,1328 \tab\tab ;B=5, C="0"\line\b 17704\b0 C5 PUSH BC \tab\tab ;loop here\line 17705 EB EX DE,HL \line 17706 4E LD C,(HL) \line 17707 23 INC HL \line 17708 46 LD B,(HL) \tab\tab ;fetch from table\line 17709 23 INC HL \line 17710 EB EX DE,HL \line 17711 3E2F LD A,47 \tab\tab ;1 before "0"\line 17713 B7 OR A \line\b 17714\b0 3C INC A \line 17715 ED42 SBC HL,BC \line 17717 30FB JR NC,\b 17714\b0 \line 17719 09 ADD HL,BC \tab\tab ;compensate last subtraction\line 17720 C1 POP BC \tab\tab ;#0530\line 17721 B9 CP C \tab\tab ;48\line 17722 2009 JR NZ,\b 17733\b0 \line 17724 3E20 LD A,32 \tab\tab ;leading spaces??\line 17726 0C INC C \line 17727 05 DEC B \line 17728 2002 JR NZ,\b 17732\b0 \line 17730 3E30 1 \b 17672\b0 7C LD A,H \line 17673 CD0D45 CALL \b 17677\b0 \line 17676 7D LD A,L \line\b 17677\b0 F5 PUSH AF \line 17678 0F RRCA \line 17679 0F RRCA \line 17680 0F RRCA \line 17681 0F RRCA \line 17682 CD1645 CALL \b 17686\b0 \line 17685 F1 POP AF \line\b 17686\b0 E60F AND 15 \line 17688 C690 ADD A,144 \line 17690 27 DAA \line 17691 CE40 ADC A,64 \line 17693 27 DAA \line 17694 CDDD45 CALL 17885 ;print a char\line 17697 C9 RET \line\par 1 \b 17501\b0 060A LD B,10 \tab\tab ;room for 10 file names (line nr)\line 17503 21FE5F LD HL,24574 \tab\tab ;start of free room\line 17506 DD211646 LD IX,17942 \tab\tab ;start of length table\line 17510 AF XOR A \tab\tab ;start off counting with 0\par 1 \b 17466\b0 217C43 LD HL,17276 ;t2d-flags\line 17469 3E01 LD A,1 \line 17471 AE XOR (HL) \line 17472 77 LD (HL),A \line 17473 E601 AND 1 \line 17475 21EF43 LD HL,17391 \tab\tab ;"DEC"\line 17478 2803 JR Z,17483 \line 17480 21F543 LD HL,17397 \tab\tab ;"HEX"\line 17483 CDF945 CALL 17913 \tab\tab ;print message from table\line 17486 3A7943 LD A,(17273)\tab\tab ;file counter\line 17489 B7 OR A \line 17490 C8 RET Z \tab\tab ;ret if no file present\line 17491 CD5D44 CALL \b 17501\b0 \tab\tab ;reprint summary of files\line 17494 CDBB44 CALL 17595 \tab\tab ;reset some pointers\line 17497 CDE644 CALL 17638\tab\tab ;black out one line\line 17500 C9 RET \line\par 1 \b 17201\b0 E5 PUSH HL \line 17202 C5 PUSH BC \line\highlight3 17203 CF31 RST #08 DEFB 49\highlight0 \tab ;create IF1 variables\par 1 \b 17176\b0 2A7343 LD HL,(17267) \tab ;curr. table addr holding file lengths\par 1 \b 17081\b0 E5 PUSH HL ;addr?\line 17082 C5 PUSH BC ;len?\line 17083 216A43 LD HL,17258 \tab\tab ;last char of name\line\b 17086\b0 34 INC (HL) \tab\tab ;adjust this char for counting\line 17087 7E LD A,(HL) \line 17088 FE3A CP 58 \tab\tab ;"9" +1\line 17090 3805 JR C,\b 17097\b0 \line 17092 3630 LD (HL),48 \tab\tab ;"0"\line 17094 2B DEC HL \tab\tab ;use previous decade position\line 17095 18F5 JR \b 17086\b0 \par 1 \b 16960\b0 217C43 LD HL,17276 \tab\tab ;t2d-flags\line 16963 CBD6 SET 2,(HL) \line 16965 210744 LD HL,17415 \tab\tab ;"AUTO"\line 16968 CDF945 CALL \b 17913\b0 \tab\tab ;print message from table\line\b ;-- 'COPY' from menu -----------------------------------\par 1 \b 16953\b0 217B43 LD HL,17275 \tab\tab ;save-counter\line 16956 34 INC (HL) \line 16957 C3B941 JP \b 16825 \b0 \tab\tab ;back to menu, or auto-loop\line\par 1 \b 16853\b0 219343 LD HL,17299 \tab\tab ;"Reset"\line 16856 CDF945 CALL \b 17913\b0 \tab\tab ;print message from table\line 16859 219B43 LD HL,17307 \tab\tab ;"/Auto/Copy/Skip"\line 16862 CDF945 CALL \b 17913\b0 \tab\tab ;print message from table\line\b 16865\b0 CD8E45 CALL \b 17806\b0 \tab\tab ;wait for key\line 16868 FE63 CP 99 \tab\tab ;"c" copy>\line 16870 CA4B42 JP Z,\b 16971\b0 \tab\tab ;save a file on disk\line 16873 FE72 CP 114 \tab\tab ;"r"\line 16875 CA1040 JP Z,\b 16400\b0 \tab\tab ;do a full reset\line 16878 FE45 CP 69 \tab\tab ;"E"\line 16880 CA1C44 JP Z,\b 17436\b0 \tab\tab ;do 'new'\line 16883 FE73 CP 115 \tab\tab ;"s" skip?\line 16885 2810 JR Z,\b 16903\b0 \line 16887 FE24 CP 36 \tab\tab ;"$"\line 16889 CC3A44 CALL Z,\b 17466\b0 \tab\tab ;toggle hex/dec\line 16892 FE07 CP 7 \tab\tab ;\line 16894 CC2544 CALL Z,\b 17445\b0 \tab\tab ;toggle the sound on/off bit\l 1 \b 16820\b0 CDDB45 CALL \b 17883\b0 \tab\tab ;print a space, remove "AUTO"\line 16823 10FB DJNZ \b 16820\b0 \par 1 \b 16804\b0 CDBB44 CALL \b 17595\b0 \tab\tab ;reset some pointers\line 16807 217C43 LD HL,17276 \tab ;t2d-flags\par 1 \b 16779\b0 CD8E45 CALL \b 17806\b0 \tab\tab ;wait for key\line 16782 FE72 CP 114 \tab ;"r"\par 1 \b 16744\b0 010015 LD BC,5376 \tab\tab ;BC holds screen position\line 16747 CDC245 CALL \b 17858\b0 \tab ;prepare clean screen\par 1 \b 16741\b0 F1 POP AF \par 1 \b 16715\b0 CD2F41 CALL \b 16687\b0 \tab ;prepare print position\par 1 \b 16703\b0 CDC245 CALL \b 17858\b0\tab\tab ;prepare clean screen\line 16706 3E2A LD A,42\tab\tab ;"*"\par 1 \b 16646\b0 ED4B7143 LD BC,(17265) \tab ;screen position\par 1 \b 16619\b0 3A7A43 LD A,(17274)\tab\tab ;test flag-what??\line 16622 B7 OR A \tab ;test 0, \par 1 \b 16570\b0 F630 OR 48 \tab\tab ;adjust first byte of read/write files\line\b 16572\b0 CDDD45 CALL \b 17885\b0 \tab\tab ;print a char\par 1 \b 16472\b0 DD2A6F43 LD IX,(17263) \tab ;pointer to free memory\par 1 ;turn non-ASCII into "."\line\b 17903\b0 FE20 CP 32 \line 17905 3803 JR C,\b 17910\b0 \line 17907 FE7F CP 127 \line 17909 D8 RET C \line\b 17910\b0 3E2E LD A,46 ;"."\line 17912 C9 RET \line\par 1 ;the variables used by this program\par 1 ;the original stack pointer is \cf1\b poked at 17240\cf0\b0 !\line 17242 CDA445 CALL \b 17828\b0 \tab\tab ;beep\line 17245 3E0D LD A,13 \tab\tab ;attribute\line 17247 18A8 JR \b 17161\b0 \tab\tab ;finish with colouring a line \line\par 1 ;sub \b reset some pointers\b0 --------\line\b 17595\b0 AF XOR A \line 17596 327B43 LD (17275),A\tab\tab ;reset save-counter to 0\line 17599 2F CPL \line 17600 327A43 LD (17274),A\tab\tab ;reset flag-what?? to 255\line 17603 112059 LD DE,22816 \tab\tab ;attributes of screenpos 9,0\line 17606 ED537543 LD (17269),DE \tab ;current attrib pos\par 1 ;sub \b print hex number \b0\par 1 ;sub \b one line down\b0 --------------------\line 17657 217243 LD HL,17266 \tab\tab ;printpos -line nr\line 17660 34 INC (HL) \tab\tab ;next line\line 17661 2A6B43 LD HL,(17259) \tab ;stored attrib addr\par 1 ;sub \b black out one line\b0 --------------------\line\b 17638\b0 2A7543 LD HL,(17269) \tab ;current attrib pos\par 1 ;sub \b PREPARE PRINT POSITION\par 1 ;sub \b OPEN A FILE ON DISK\b0\par 1 ;sub \b LOAD HEADER OR BYTES\par 1 ;save registers\par 1 ;print number with/without leading zeroes\par 1 ;print message from table\par 1 ;print menu\par 1 ;now finish closing the file\par 1 ;not used --------------------------------------------\par 1 ;large menu / save-auto-to-disk\par 1 ;here follow a set of messages\par 1 ;coming from 16525-------\par 1 ;are loaded from tape in one run\par 1 ;\b now start\b0 \b main loop, loading from tape \b0 ----------------------------------------------------------------------\par 1 ;\b TEST BREAK\b0\par 1 ;-------\par 1 ;--------\par 1 ;--------\line\b 16634\b0 D5 PUSH DE \tab ;len of file in free mem\par 1 ;---------\line\cf1\b 17556\cf0\b0 DD5E00 LD E,(IX+0) \tab\tab ;fetch length from table if byte<>0\line 17559 DD23 INC IX \line 17561 DD5600 LD D,(IX+0) \line 17564 DD23 INC IX \line 17566 19 ADD HL,DE \tab\tab ;calculate end addr of this file\line 17567 EB EX DE,HL \tab\tab ;HL = length, save end addr in DE \line 17568 2B DEC HL \line 17569 2B DEC HL \line 17570 227743 LD (17271),HL \tab ;save this length in temp store\par 1 ;---------\line\b 17511\b0 F5 PUSH AF \tab\tab ;loop here\line 17512 7E LD A,(HL) \tab\tab ;first byte of file\line 17513 B7 OR A \line 17514 2028 JR NZ,\b 17556\b0 \tab\tab ;jp for printing only one number\line 17516 E5 PUSH HL \line 17517 110C00 LD DE,12 \line 17520 19 ADD HL,DE \tab\tab ;skip name etc\line 17521 0E0D LD C,13 \tab\tab ;column: BC holds screen position\line 17523 CDC245 CALL \b 17858\b0 \tab\tab ;prepare clean screen\line 17526 CD4C45 CALL \b 17740\b0 \tab\tab ;print a number \line 17529 23 INC HL \tab\tab ;point to next number\line 17530 23 INC HL \line 17531 CDDB45 CALL \b 17883\b0 \tab\tab ;print a space\line 17534 CD4C45 CALL \b 17740\b0 \tab\tab ;print a number\line 17537 E1 POP HL \tab\tab ;retrieve address of first byte\line 17538 DD5E00 LD E,(IX+0) \tab\tab ;fetch length from length table\line 17541 DD23 INC IX \line 17543 1 ;----------\line\b 17097\b0 216143 LD HL,17249 \tab\tab ;address of name$\line 17100 010A00 LD BC,10 \tab\tab ;name length\line 17103 CD3143 CALL \b 17201\b0 \tab\tab\cf1\b ;OPEN A FILE ON DISK\cf0\b0\line 17106 C1 POP BC ;len?\line 17107 E1 POP HL ;addr?\line 17108 113200 LD DE,50 \tab\tab ;offset to data area in channel\par 1 ;--------------------------------------\par 1 ;----------------------------------------\par 1 ;--------------------------------------------\par 1 ;--------------------------------------------------\line\b 16726\b0 F5 PUSH AF \par 1 ;---------------------------------------------------\par 1 ;-------------------------------------------------------\line 17259 0000\tab\tab ;store attribute address\par 1 ;--------------------------------------------------------\par 1 ;---------------------------------------------------------\par 1 ;----------------------------------------------------------\b0\line\highlight3\b 17237\b0 CF38 RST #08 DEFB 56\highlight0 \tab ;remove 'D' channel\par 1 ;-----------------------------------------------------------\par 1 ;------------------------------------------------------------\b0\line\b 16687\b0 CD7F45 CALL \b 17791\b0\tab\tab ;save registers\par 1 ;--------------------------------------------------------------\par 1 ;---------------------------------------------------------------\par 1 ;----------------------------------------------------------------\line\highlight3\b 17157\b0 CF34 RST #08 DEFB 52\highlight0 \tab ;close file on disk\par 1 ;------------------------------- next tape file???\line 16825 3A7943 LD A,(17273)\tab\tab ;file counter\line 16828 217B43 LD HL,17275 \tab\tab ;save-counter\line 16831 BE CP (HL) \line 16832 28E2 JR Z,\b 16804\b0 \line 16834 CDE644 CALL \b 17638\b0 \tab\tab ;black out one line\line 16837 217C43 LD HL,17276 \tab\tab ;t2d-flags\line 16840 CB56 BIT 2,(HL) \tab\tab ;auto on/off\line 16842 2809 JR Z,\b 16853\b0 \line 16844 FB EI \line 16845 0620 LD B,32 \tab\tab ;wait about 3/5 of a second\line\b 16847\b0 76 HALT \line 16848 10FD DJNZ \b 16847\b0 \line 16850 C34B42 JP \b 16971\b0 \tab\tab ;start copying a file to disk\line\par 1 ;--- 'SKIP' from menu --------------------------------------\line\b 16903\b0 2A7543 LD HL,(17269) ;current attrib pos\par 1 ;-- menu -----\par 1 ; SAVE A FILE TO DISK routines\par 1 ; Note that the old error address should have been saved, \par 1 : and later restored\par 1 17913 E5 PUSH HL \line 17914 C5 PUSH BC \line 17915 F5 PUSH AF \line\b 17916\b0 7E LD A,(HL) \tab ;fetch char\line 17917 CBBF RES 7,A \tab ;drop any bit 7\line 17919 CDE045 CALL \b 17888\b0 \tab ;print a char\line 17922 7E LD A,(HL) \line 17923 CB7F BIT 7,A \line 17925 23 INC HL \line 17926 28F4 JR Z,\b 17916\b0 \tab ;if bit 7 set, then end of table\line 17928 F1 POP AF \line 17929 C1 POP BC \line 17930 E1 POP HL \line 17931 C9 RET \line\par 1 17858 CD7F45 CALL \b 17791\b0 ;save registers\line 17861 3E02 LD A,2 \line 17863 C5 PUSH BC \line 17864 CD0116 CALL \b 5633\b0 ;open screen\line 17867 C1 POP BC \line 17868 3E18 LD A,24 ;lines\line 17870 90 SUB B \line 17871 47 LD B,A \line 17872 3E21 LD A,33 ;columns +1\line 17874 91 SUB C \line 17875 4F LD C,A \line 17876 CDD90D CALL 3545 ;ROM clear BC lines\line 17879 CD8645 CALL \b 17798\b0 ;retrieve registers\line 17882 C9 RET \line\par 1 17806 FDCB01AE RES 5,(IY+1) \line\b 17810\b0 FDCB016E BIT 5,(IY+1) \line 17814 28FA JR Z,\b 17810\b0 \tab\tab ;wait until key pressed\line 17816 3A7C43 LD A,(17276)\tab\tab ;t2d-flags\line 17819 E602 AND 2 \tab\tab ;bit1=sound on/off flag\line 17821 C4A445 CALL NZ,\b 17828\b0 \tab\tab ;beep\line 17824 3A085C LD A,(23560)\tab\tab ;get key value\line 17827 C9 RET \line\par 1 17784 215641 LD HL,\b 16726\b0 \tab ;return addr\line 17787 E5 PUSH HL \line 17788 C3C604 JP 1222 \tab ;ROM save bytes\line\par 1 17740 E5 PUSH HL \line 17741 D5 PUSH DE \line 17742 C5 PUSH BC \line 17743 7E LD A,(HL) \tab\tab ;fetch the number\line 17744 23 INC HL \line 17745 66 LD H,(HL) \line 17746 6F LD L,A \tab\tab ;HL=(HL)\line 17747 3A7C43 LD A,(17276)\tab\tab ;t2d-flags\line 17750 CB47 BIT 0,A \tab\tab ;hex/dec flag\line 17752 2808 JR Z,\b 17762\b0 \tab\tab ;go, print the number\line 17754 CDDB45 CALL \b 17883\b0 \tab\tab ;print a space\line 17757 CD0845 CALL \b 17672\b0 \tab\tab ;print hex number\line 17760 1803 JR \b 17765\b0 \tab\tab ;skip next instruction\line ;---------\par 1 17671 C9 RET \line\par 1 17664 012000 LD BC,32 \line 17667 09 ADD HL,BC \tab\tab ;one line down\line 17668 226B43 LD (17259),HL \tab ;store attrib addr\par 1 17648 0B DEC BC \line 17649 54 LD D,H \line 17650 5D LD E,L \line 17651 13 INC DE \line 17652 368F LD (HL),143 \tab\tab ;ad hoc graphic 'black space'\line 17654 EDB0 LDIR \line 17656 C9 RET \par 1 17641 012000 LD BC,32 \tab\tab ;one line down\line 17644 09 ADD HL,BC \line 17645 227543 LD (17269),HL \tab ;current attrib pos\par 1 17637 C9 RET \par 1 17631 211646 LD HL,17942 \tab\tab ;start of length table\line 17634 227343 LD (17267),HL \tab ;address in table holding file lengths\par 1 17614 ED52 SBC HL,DE \line 17616 44 LD B,H \line 17617 4D LD C,L \line 17618 0B DEC BC \line 17619 E1 POP HL \line 17620 13 INC DE \line 17621 360F LD (HL),15 \tab\tab ;blank part of screen\line 17623 EDB0 LDIR \line 17625 21FE5F LD HL,24574 \tab\tab ;start of free mem\line 17628 226F43 LD (17263),HL \tab ;pointer to free memory\par 1 17610 D5 PUSH DE \line 17611 2A6B43 LD HL,(17259) \tab ;stored attrib addr\par 1 17573 217743 LD HL,17271 \tab\tab ;point here for printing the number\line 17576 0E19 LD C,25 \tab\tab ;BC holds screen position\line 17578 CDC245 CALL \b 17858\b0 \tab\tab ;prepare clean screen\line 17581 CD4C45 CALL \b 17740\b0 \tab\tab ;print a number\line\cf1\b 17584\cf0\b0 F1 POP AF \tab\tab ;retrieve counter\line 17585 3C INC A \tab\tab ;count\line 17586 217943 LD HL,17273 \tab ;file counter of loaded files\line 17589 BE CP (HL) \tab\tab\line 17590 D0 RET NC \tab\tab ;exit if all done\line 17591 04 INC B \tab\tab ;next screen line to print on\line 17592 EB EX DE,HL \tab\tab ;retrieve end addr from DE\line 17593 18AC JR \b 17511\b0 \tab\tab ;loop\par 1 17445 217C43 LD HL,17276 \tab\tab ;t2d-flags\line 17448 3E02 LD A,2 \line 17450 AE XOR (HL) \tab\tab ;toggle the bit\line 17451 77 LD (HL),A \line 17452 E602 AND 2 \line 17454 210144 LD HL,17409 \tab\tab ;"OFF"\line 17457 2803 JR Z,17462 \line 17459 21FB43 LD HL,17403 \tab\tab ;"ON "\line 17462 CDF945 CALL \b 17913\b0 \tab\tab ;print message from table\line 17465 C9 RET \line\par 1 17436 F3 DI\tab\line 17437 11A05D LD DE,23968 \tab\tab ;soft ramtop\line 17440 3EFF LD A,255 \line 17442 C3BE11 JP 4542 \tab\tab ;ROM the NEW command\line\par 1 17426 1027E8 \b ;table\b0\tab see 17698: print number\line 17429 0364 \line 17431 000A\line 17433 000100 \line\par 1 17422 504E5343 ;"PNSC" \line ;Abbrevation for file type: \b P\b0 rogram, \b N\b0 um-array, \b S\b0 tring-array, \b C\b0 ode\par 1 17415 16081A\tab ;AT 8,26\line 17418 415554CF \tab ;"AUTO"\par 1 17397 160806\tab ;AT 8,6 \line 17400 4845D8\tab ;"HEX"\line\line 17403 160811\tab ;AT 8,17\line 17406 4F4EA0 \tab ;"ON "\par 1 17391 160806\tab ;AT 8,6\line 17394 4445C3\tab ;"DEC"\par 1 17371 160800 \tab ;AT 8,0\line 17374 52616469 \tab ;"Radix: Sound:"\line 17378 783A2020 \line 17382 20202053 \line 17386 6F756E64 \line 17390 BA \par 1 17336 160900 \tab ;AT 9,0\line 17339 54204E61\tab ;"T Name Length Addr. Bytes -"\line 17343 6D652020 \line 17347 20202020 \line 17351 4C656E67 \line 17355 74682041 \line 17359 6464722E \line 17363 20427974 \line 17367 657320C5 \par 1 17322 161500 \tab ;AT 21,0\line 17325 456E6420 \tab ;"End of RAM "\line 17329 6F662052 \line 17333 414DA0 \par 1 17307 2F417574\tab ;"/Auto/Copy/Skip"\line 17311 6F2F436F\line 17315 70792F53\line 17319 6B69F0 \line\par 1 17299 16150C\tab ;AT 21,12\line 17302 52657365\tab ;"Reset" \line 17306 F4\par 1 17277 161500\tab ;AT 21,0 \line 17280 456E7465\tab ;"Enter BREAK to STOP"\line 17284 72204252 \line 17288 45414B20 \line 17292 746F2053 \line 17296 544FD0 \tab ;"P"+128\par 1 17276 00\tab\tab ;t2d Flags for hex/dec etcetera\line\par 1 17275 00\tab\tab ;counts number of saved files\par 1 17273 00\tab\tab ;counter for number of files loaded in free mem\line 17274 00\tab\tab ;flag-what??\par 1 17269 0000\tab\tab ;current attribute address\line 17271 0000\tab\tab ;temp store used for printing a number\par 1 17265 0000\tab\tab ;current screen position\line 17267 0000\tab\tab ;pointer in table of file lengths loaded from tape\par 1 17261 0000\tab\tab ;length of file\line 17263 0000\tab\tab ;pointer to free memory\par 1 17249 46494C45\tab DEFM "FILE000000"\line 17253 30303030 \line 17257 3030\par 1 17239 310000 LD SP,0 \tab\tab ;retrieve original stack pointer\par 1 17232 DD3409 INC (IX+9) \tab\tab ;change last char of name\line 17235 18EE JR \b 17219\b0 \tab\tab ;try again!\par 1 17228 DD2ADC5C LD IX,(23772) \tab ; and think of another name\par 1 17221 DDCB0B46 BIT 0,(IX+11)\tab\tab ;test read/write flag\line 17225 C0 RET NZ \tab\tab ;ret. if it's a new ('write') file\line\highlight3 17226 CF38 RST #08 DEFB 56\highlight0 \tab ;else remove 'D' channel\par 1 17214 3E01 LD A,1 \tab\tab ;drive number\line 17216 32D65C LD (23766),A\line\highlight3\b 17219\b0 CF33 RST #08 DEFB 51\highlight0 \tab ;open file on disk\par 1 17210 ED43DA5C LD (23770),BC \tab ;length of name\par 1 17205 C1 POP BC \line 17206 E1 POP HL \line 17207 22DC5C LD (23772),HL \tab ;address pointing to name$\par 1 17196 E1 POP HL \line 17197 7E LD A,(HL) \line 17198 23 INC HL \line 17199 B7 OR A \tab\tab ;and test the first byte\line 17200 C9 RET \line\par 1 17189 E5 PUSH HL \tab\tab\line 17190 09 ADD HL,BC \tab\tab ;end of current tape file\line 17191 0B DEC BC \line 17192 0B DEC BC \line 17193 226F43 LD (17263),HL \tab ;pointer to free memory\par 1 17186 2A6F43 LD HL,(17263) \tab ;pointer to free memory\par 1 17179 4E LD C,(HL) \tab\tab ;fetch length of current tape file\line 17180 23 INC HL \line 17181 46 LD B,(HL) \line 17182 23 INC HL \line 17183 227343 LD (17267),HL \tab ;address in table holding file lengths\par 1 17164 5D LD E,L \line 17165 54 LD D,H \line 17166 13 INC DE \line 17167 011F00 LD BC,31 \tab\tab ;one line\line 17170 77 LD (HL),A \line 17171 EDB0 LDIR \line 17173 C33942 JP \b 16953\b0 \tab\tab ;and do it all again\line\par 1 17159 3E39 LD A,57 \tab\tab ;attribute\line\b 17161\b0 2A7543 LD HL,(17269) \tab ;;current attrib pos\par 1 17131 C1 POP BC \line 17132 DDE5 PUSH IX \tab\tab ;now reset the sector buff pointer\line 17134 E1 POP HL \line 17135 113200 LD DE,50 \line 17138 19 ADD HL,DE \tab\tab ;point to start of data area of channel\line 17139 EB EX DE,HL \line 17140 E1 POP HL \line\b ;cont here writing a byte to sectorbuffer\par 1 17068 7E LD A,(HL) \tab\tab ;first byte \line 17069 B7 OR A \line 17070 CA5543 JP Z,\b 17237\b0 \tab\tab ;error exit or READY???\line 17073 CD1843 CALL \b 17176\b0 \tab\tab ;find start and length of file in mem\line 17076 113B00 LD DE,59 \tab\tab ;point to data area + header\line 17079 181E JR \b 17111\b0 \tab\tab ;continue\line\par 1 17061\b0 DD363009 LD (IX+48),9\tab\tab ;preset sector buffer pointer\line 17065 2A6F43 LD HL,(17263) \tab ;pointer to free memory area\par 1 17002 7E LD A,(HL) \tab\tab ;fetch 'file type'\line 17003 23 INC HL \tab\tab ;point to header info\line 17004 F5 PUSH AF \line 17005 E5 PUSH HL \line 17006 010A00 LD BC,10 \tab\tab ;name\line 17009 09 ADD HL,BC \line 17010 E3 EX (SP),HL \line 17011 CD3143 CALL \b 17201\b0 \tab\tab\cf1\b ;OPEN A FILE ON DISK\cf0\b0\line 17014 E1 POP HL \line 17015 DDE5 PUSH IX \line 17017 0606 LD B,6 \tab\tab ;copy header info, 3 addresses\line\b 17019\b0 7E LD A,(HL) \line 17020 23 INC HL \line 17021 DD23 INC IX \tab\tab ;skip position for file type!!\line 17023 DD7732 LD (IX+50),A\tab\tab ;normal IX +51!\line 17026 10F7 DJNZ \b 17019\b0 \line 17028 DDE1 POP IX \line 17030 F1 POP AF \tab\tab ;file type\line 17031 DD7732 LD (IX+50),A\tab\tab ;store in sect buff (header) \line 17034 B7 OR A \tab\tab ;test for BASIC\line 17035 1 16983 CD1843 CALL \b 17176\b0 \tab\tab ;find start and length of file in mem\line 16986 205D JR NZ,\b 17081\b0 \tab\tab ;flag comes from test of first byte\line 16988 E5 PUSH HL \line 16989 211100 LD HL,17 \tab\tab ;header length incl. name\line 16992 ED42 SBC HL,BC \line 16994 E1 POP HL \line 16995 2054 JR NZ,\b 17081\b0 \tab\tab ;jp if no header\line 16997 7E LD A,(HL) \line 16998 E6FC AND 252 \tab\tab ;test for sinclair types 0-3\line 17000 204F JR NZ,\b 17081\b0 \tab\tab ;jp if no header\line\par 1 16975 215543 LD HL,17237 \tab\tab ;prepare error exit\line 16978 E5 PUSH HL \line 16979 ED733D5C LD (23613),SP \par 1 16971\b0 ED735843 LD (17240),SP \tab ;poke SP in the exit routine!\par 1 16942 F1 POP AF \line 16943 3F CCF \tab\tab ;now test flag\line 16944 3807 JR C,\b 16953\b0 \line 16946 7E LD A,(HL) \tab\tab ;\line 16947 B7 OR A \line 16948 2803 JR Z,\b 16953\b0 \tab\tab ;adjust save counter\line 16950 EB EX DE,HL \line 16951 18E4 JR \b 16925\b0 \tab\tab\par 1 16938 ED537343 LD (17267),DE \tab ;address in table holding file lengths\par 1 16929 4E LD C,(HL) \tab\tab ;fetch length of current file\line 16930 23 INC HL \line 16931 46 LD B,(HL) \line 16932 23 INC HL \line 16933 EB EX DE,HL \line 16934 09 ADD HL,BC \line 16935 226F43 LD (17263),HL \tab ;pointer to free memory\par 1 16919 7E LD A,(HL) \line 16920 B7 OR A \line 16921 2001 JR NZ,\b 16924\b0 \tab\tab ;\line 16923 37 SCF \line\b 16924\b0 EB EX DE,HL \line\b 16925\b0 F5 PUSH AF \tab\tab ;save flag\line 16926 2A7343 LD HL,(17267) \tab ;address in table holding file lengths\par 1 16906 54 LD D,H \line 16907 5D LD E,L \line 16908 13 INC DE \line 16909 011F00 LD BC,31 \line 16912 360F LD (HL),15 \tab\tab ;screen attribs\line 16914 EDB0 LDIR \tab\tab ;fill a block, delete whatever\line 16916 2A6F43 LD HL,(17263) \tab ;pointer to free memory\par 1 16815 CDC245 CALL \b 17858\b0 \tab\tab ;prepare clean screen\line 16818 0604 LD B,4 \par 1 16810 CB96 RES 2,(HL) \tab\tab ;AUTO off\line 16812 011A08 LD BC,2074 \tab ;BC holds screen position\par 1 16799 CC2544 CALL Z,\b 17445\b0 \tab\tab ;toggle sound on/off bit\line 16802 18E7 JR \b 16779\b0 \par 1 16794 CC3A44 CALL Z,\b 17466\b0 \tab\tab ;toggle dec/hex\line 16797 FE07 CP 7 \par 1 16789 CA1C44 JP Z,\b 17436\b0 \tab\tab ;do 'new'\line 16792 FE24 CP 36 \tab ;"$"\par 1 16784 CA1040 JP Z,\b 16400\b0 \tab\tab ;do a full reset\line 16787 FE45 CP 69 \tab ;"E"\par 1 16773 219343 LD HL,17299 \tab\tab ;"Reset"\line 16776 CDF945 CALL \b 17913\b0 \tab ;print message from table\par 1 16770 B7 OR A \tab\tab ;test for zero\line 16771 201F JR NZ,\b 16804\b0 \tab ;do large \cf1\b (save) menu\par 1 16767 3A7943 LD A,(17273) \tab ;file counter\par 1 16764 226B43 LD (17259),HL \tab ;store attrib addr\par 1 16760 012000 LD BC,32 \line 16763 09 ADD HL,BC \tab ;one line down\par 1 16755 10FB DJNZ \b 16752\b0 \line\b 16757\b0 2A6B43 LD HL,(17259) \tab ;stored attrib addr\par 1 16750 0620 LD B,32 \line\b 16752\b0 CDDB45 CALL \b 17883\b0 \tab ;print a space\par 1 16742 F1 POP AF \line 16743 F1 POP AF \par 1 16740 C9 RET \line\par 1 16737 3002 JR NC,\b 16741\b0 \tab\tab ;jp if pressed\line 16739 F1 POP AF \par 1 16735 1F RRA \tab\tab ;Space pressed?\line 16736 FB EI \par 1 16731 3E7F LD A,127 \line 16733 DBFE IN A,(254)\tab\tab ;key row Space<>B\par 1 16727 3E01 LD A,1 \line 16729 D3FE OUT (254),A\tab\tab ;border\par 1 16724 181F JR \b 16757\b0 \par 1 16718 21AA43 LD HL,\b 17322\b0 \tab\tab ;"End of RAM "\line 16721 CDF945 CALL \b 17913\b0\tab\tab ;print message from table\par 1 16714 C9 RET \line\par 1 16708 CDDD45 CALL 17885 \tab\tab ;print a char\line 16711 CD8645 CALL \b 17798\b0\tab\tab ;retrieve registers\par 1 16700 2801 JR Z,\b 16703\b0 \line 16702 04 INC B \tab\tab\tab ;BC holds screen position\par 1 16696 3A7A43 LD A,(17274)\tab\tab ;test flag-what??\line 16699 B7 OR A \par 1 16694 0E1F LD C,31 \par 1 16690 ED4B7143 LD BC,(17265) \tab ;screen position\par 1 16684 C35840 JP \b 16472\b0 \tab\tab ;start again\par 1 16680 FE0B CP 11 \tab\tab ;max 10\line 16682 283C JR Z,\b 16744\b0 \tab ;print menu\par 1 16674 327A43 LD (17274),A\tab\tab ;set flag-what??\line 16677 3A7943 LD A,(17273) \tab ;file counter\par 1 16669 CDDB45 CALL \b 17883\b0 \tab\tab ;print a space\line 16672 3EFF LD A,255 \par 1 16663 217543 LD HL,17269 \tab\tab ;current attrib pos\line 16666 CD4C45 CALL \b 17740\b0 \tab ;print a number\par 1 16658 1B DEC DE \line 16659 ED537543 LD (17269),DE \tab ;current attrib pos\par 1 16654 CDC245 CALL \b 17858\b0\tab\tab ;prepare clean screen pos\line 16657 1B DEC DE \par 1 16652 81 ADD A,C \line 16653 4F LD C,A \tab\tab ;BC holds screen position\par 1 16650 3E19 LD A,25 \par 1 16642 D1 POP DE \line 16643 C42F41 CALL NZ,\b 16687\b0 \tab ;prepare print position\par 1 16640 ED52 SBC HL,DE \par 1 16637 2A6D43 LD HL,(17261) \tab ;length of file\par 1 16635 1B DEC DE \line 16636 1B DEC DE \tab ;real file len\par 1 16632 180C JR \b 16646\b0 \par 1 16628 217943 LD HL,17273 \tab\tab ;file counter\line 16631 34 INC (HL) \par 1 16623 2809 JR Z,\b 16634\b0 \line 16625 CDF944 CALL \b 17657\b0 \tab ;one line down\par 1 16614 3863 JR C,\b 16715\b0 \tab\tab ;Msge "End of RAM "\line 16616 C35840 JP \b 16472\b0 \tab ;start again!\par 1 16612 13 INC DE \line 16613 19 ADD HL,DE \par 1 16611 13 INC DE \par 1 16608 2A6F43 LD HL,(17263) \tab ;pointer to free memory\par 1 16605 CD4C45 CALL \b 17740\b0 \tab ;print a number\par 1 16601 ED536D43 LD (17261),DE \tab ;length of file\par 1 16599 56 LD D,(HL) \line 16600 23 INC HL \par 1 16597 5E LD E,(HL) \line 16598 23 INC HL \par 1 16591 CD4C45 CALL \b 17740\b0 \tab\tab ;print a number\line 16594 CDDB45 CALL \b 17883\b0 \tab ;print a space\par 1 16586 10F9 DJNZ \b 16581\b0 \tab\tab ;loop 10 x\line 16588 CDDB45 CALL \b 17883\b0 \tab ;print a space\par 1 16582 CDDD45 CALL \b 17885\b0 \tab\tab ;print a char\line 16585 23 INC HL \par 1 16579 060A LD B,10 \tab\tab ;name length\line\b 16581\b0 7E LD A,(HL) \par 1 16575 CDDB45 CALL \b 17883\b0\tab\tab ;print a space\line 16578 23 INC HL \par 1 16567 E1 POP HL \line 16568 1802 JR \b 16572\b0 \par 1 16565 19 ADD HL,DE \line 16566 7E LD A,(HL) \tab ;find identifying char in table\par 1 16562 1600 LD D,0\tab\tab\tab ;(program, num. array, $array, code)\line 16564 5F LD E,A \par 1 16558 E5 PUSH HL \line 16559 210E44 LD HL,\b 17422\b0 \tab ;table "PNSC"\par 1 16554 FE04 CP 4 \tab\tab ;\line 16556 300C JR NC,\b 16570\b0 \tab ;skip if not sinclair type\par 1 16552 23 INC HL \line 16553 7E LD A,(HL) \tab ;file identifier ??????\par 1 16548 CDC245 CALL \b 17858\b0 \tab\tab ;prepare clean screen\line 16551 EB EX DE,HL \par 1 16541 CDF944 CALL \b 17657\b0 \tab\tab ;one line down\line 16544 ED4B7143 LD BC,(17265)\tab ;BC holds screen position\par 1 16537 CA6841 JP Z,\b 16744\b0 \tab\tab ;do reset ??\line 16540 34 INC (HL) \tab ;adjust file counter\par 1 16534 3E0B LD A,11 \line 16536 BE CP (HL) \tab ;max 10 files allowed\par 1 16528 327A43 LD (17274),A\tab\tab ;flag the zero in flag-what??\line 16531 217943 LD HL,17273 \tab ;file counter\par 1 16525 205C JR NZ,\b 16619\b0 \tab\tab ;\cf1\b exit\cf0\b0 from this mainloop\line 16527 EB EX DE,HL \tab ;DE points to free mem now\par 1 16523 E1 POP HL \tab\tab ;pointer in free mem now\line 16524 B7 OR A \tab ;test if pointer in free mem shows 0\par 1 16521 D5 PUSH DE \line 16522 D9 EXX \par 1 16515 DA4B41 JP C,\b 16715 \b0 \tab\tab ;Msge "End of RAM "\line 16518 226F43 LD (17263),HL \tab ;pointer to free memory\par 1 16513 1A LD A,(DE) \tab\tab ;fetch\line 16514 19 ADD HL,DE \par 1 16511 E1 POP HL \tab\tab ;length now\line 16512 D1 POP DE \tab ;pointer in free mem \par 1 16509 D5 PUSH DE \tab\tab ;save lenght\line 16510 D9 EXX \par 1 16505 23 INC HL \tab\tab ;adjust pointer in the lengths table\line 16506 227343 LD (17267),HL \tab ;store this pointer \par 1 16503 23 INC HL \line 16504 72 LD (HL),D \par 1 16502 73 LD (HL),E \tab ;store a length\par 1 16499 2A7343 LD HL,(17267) \tab ;address in table holding file lengths\par 1 16495 CC2F41 CALL Z,\b 16687\b0\tab\tab ;prepare print position\line 16498 EB EX DE,HL \par 1 16490 21FFFF LD HL,65535 \line 16493 ED52 SBC HL,DE \par 1 16486 B7 OR A \line 16487 C42F41 CALL NZ,\b 16687\b0\tab\tab ;prepare print position\par 1 16482 CD6945 CALL \b 17769\b0 \tab\tab ;load header from tape, \par 1 16478 11FFFF LD DE,65535 \line 16481 37 SCF \tab ;signal loading, not verifying\par 1 16476 DDE5 PUSH IX \tab\par 1 16466 21B843 LD HL,17336 \tab\tab ;"T Name Length Addr. Bytes -"\line 16469 CDF945 CALL \b 17913\b0 \tab\tab ;print message from table\par 1 16460 217D43 LD HL,17277 \tab\tab ;"Enter BREAK to STOP"\line 16463 CDF945 CALL \b 17913\b0 \tab\tab ;print message from table\par 1 16456 3D DEC A \line 16457 327A43 LD (17274),A \tab ;start flag-what?? off with 255\par 1 16452 AF XOR A \line 16453 327943 LD (17273),A \tab ;file counter starts with 0\par 1 16446 211646 LD HL,17942 \tab\tab ;start of table holding file lengths\line 16449 227343 LD (17267),HL \tab ;store pointer in file lengths table\par 1 16440 210009 LD HL,2304 \line 16443 227143 LD (17265),HL \tab ;screen position\par 1 16434 21FE5F LD HL,24574 \tab\tab ;start of free memory\line 16437 226F43 LD (17263),HL \tab ;pointer to free memory\par 1 16429 060F LD B,15 \line 16431 CD0C46 CALL \b 17932\b0 \tab ;clear 15 lower screen lines\par 1 16425 360F LD (HL),15 \line 16427 EDB0 LDIR \par 1 16421 13 INC DE \line 16422 01DF01 LD BC,479 \tab ;15 lines a 32 = 480\par 1 16419 54 LD D,H \line 16420 5D LD E,L \par 1 16413 212059 LD HL,22816 \tab\tab ;fill lower screen attribs with 15\line 16416 226B43 LD (17259),HL \tab ;store attrib addr\par 1 16409 3600 LD (HL),0 \line 16411 EDB0 LDIR \par 1 16405 13 INC DE \line 16406 0100A0 LD BC,40960 \par 1 16403 54 LD D,H \line 16404 5D LD E,L \par 1 16397 CD2544 CALL \b 17445\b0 \tab\tab ;toggle sound on/off\line\b 16400\b0 21FE5F LD HL,24574\tab\tab ;fill 24574,40960 with zeroes\par 1 16394 CD3A44 CALL \b 17466\b0 \tab ;toggle hex/dec\par 1 16391 CDF945 CALL \b 17913\b0 \tab\tab ;print message from table\par 1 16388 21DB43 LD HL,17371 \tab\tab ;"Radix: Sound:"\par 1 16384 FDCB309E RES 3,(IY+48) \par 1 ----------------------------------------------------------------------------\par 1 *** end\par 1 ###########################################################################\b0\par