Top 10k strings from SpectrumShadowROMDisassembly.rtf in <root> / doc / technical / specifications /

Back to the directory listing

  46 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 
  31 \par \tab ;
  13 \par \tab \tab RST\tab CALBAS
  11 \par \tab \tab RET
  10 \par \tab \tab POP\tab HL
  10 \par \tab \tab CALL\tab ST_END\tab ;Confirm end of statement.
   9 \par \tab \tab \tab \tab during syntax checking.
   8 \par \tab \tab JP\tab END1\tab ;Finished.
   8 \par \tab \tab DEFW\tab FND_INT1
   7 \par \tab \tab PUSH\tab HL
   7 \par \tab \tab POP\tab BC
   6 \par \tab \tab POP\tab AF
   6 \par \tab \tab DEFW\tab NEXT_CHAR
   5 \par \tab \tab INC\tab HL
   5 \par \tab \tab DEFW\tab NEXT_2NUM
   5 \par \tab \tab CALL\tab SEL_DRIVE
   5 \par \tab \tab AND\tab A
   5 \par 'Wrong file type'
   5 \par 'File not found'
   5 \par 'Drive 'write' protected'
   4 \par \tab \tab \tab \tab examined.
   4 \par \tab \tab RRA
   4 \par \tab \tab PUSH\tab DE
   4 \par \tab \tab LD\tab B,A
   4 \par \tab \tab LD\tab (CLRCR),A
   4 \par \tab \tab JP\tab NZ,ERR_6
   4 \par \tab \tab DEFW\tab FIND_INT2
   4 \par \tab \tab CALL\tab PRDIG
   4 \par \tab \tab CALL\tab PRCHAR
   3 \par \tab \tab \tab \tab table.
   3 \par \tab \tab \tab \tab routine.
   3 \par \tab \tab \tab \tab channel.
   3 \par \tab \tab \tab \tab buffer.
   3 \par \tab \tab PUSH\tab BC
   3 \par \tab \tab PUSH\tab AF
   3 \par \tab \tab POP\tab DE
   3 \par \tab \tab OR\tab A
   3 \par \tab \tab LD\tab (IX+CHREC),A
   3 \par \tab \tab JR\tab NZ,CATLOOP
   3 \par \tab \tab JP\tab PRCHAR
   3 \par \tab \tab CP\tab B
   3 \par \tab \tab CALL\tab NZ,BCHAN_OUT\tab ;Send it unless zero.
   3 \par \page 
   3 \par 2\tab +0008\tab Main ROM 'input' routine.
   3 \par (For edition 1 Shadow ROM)
   3 \par 'Writing to a 'read' file'
   3 \par 'Verification has failed'
   2 \par }\pard \s15\ql \li0\ri0\widctlpar\tx567\tx1985\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 0\tab +0008\tab Main ROM 'output' routine.
   2 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab RANDOMIZE USR 63744
   2 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1134\tx1701\tx2268\tx2835\tx3402\tx3969\tx4536\tx5103\tx5670\tx6237\tx6804\tx7371\tx8505\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 63744:\tab 207\tab 49\tab 33\tab 9\tab 249\tab 34\tab 
   2 \par }\pard \s15\ql \li0\ri0\widctlpar\tqr\tx567\tx709\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 1\tab CLEAR 63743
   2 \par for edition 2 Shadow ROM
   2 \par \tab \tab \tab \tab unchanged'
   2 \par \tab \tab \tab \tab tape have been made.
   2 \par \tab \tab \tab \tab switch off drive motors.
   2 \par \tab \tab \tab \tab station number.
   2 \par \tab \tab \tab \tab sector.
   2 \par \tab \tab \tab \tab required.
   2 \par \tab \tab \tab \tab record.
   2 \par \tab \tab \tab \tab reaches zero.
   2 \par \tab \tab \tab \tab number.
   2 \par \tab \tab \tab \tab location.
   2 \par \tab \tab \tab \tab from the buffer.
   2 \par \tab \tab \tab \tab file.
   2 \par \tab \tab \tab \tab checksum.
   2 \par \tab \tab XOR\tab A
   2 \par \tab \tab RST\tab ROMERR
   2 \par \tab \tab RST\tab CALBAS\tab ;Fetch 'x'.
   2 \par \tab \tab RST\tab CALBAS\tab ;Advance CH_ADD.
   2 \par \tab \tab RET\tab NZ
   2 \par \tab \tab PUSH\tab BC\tab ;Save it.
   2 \par \tab \tab OUT\tab (0EFH),A
   2 \par \tab \tab LD\tab L,C
   2 \par \tab \tab LD\tab IX,(CURCHL)\tab ;Fetch channel start address.
   2 \par \tab \tab LD\tab B,0
   2 \par \tab \tab LD\tab A,(WIDTH)
   2 \par \tab \tab LD\tab A,(IX+CHDRIV)\tab ;Turn on drive motor.
   2 \par \tab \tab LD\tab A,(IX+4)\tab ;Fetch channel specifier.
   2 \par \tab \tab LD\tab A,(HL)
   2 \par \tab \tab LD\tab (SECTOR),HL
   2 \par \tab \tab LD\tab (HL),D
   2 \par \tab \tab LD\tab (23789),HL
   2 \par \tab \tab JR\tab Z,RANGE
   2 \par \tab \tab JP\tab NZ,NREPORT\emdash 3
   2 \par \tab \tab JP\tab NC,NREPORT-2
   2 \par \tab \tab EXX
   2 \par \tab \tab END
   2 \par \tab \tab DEFW\tab NEXT_CHAR\tab ;Advance CH_ADD.
   2 \par \tab \tab DEFW\tab NEXT CHAR
   2 \par \tab \tab DEFW\tab FND_INTl
   2 \par \tab \tab DEFW\tab EXPT_1NUM
   2 \par \tab \tab DEFW\tab CHAN_OPEN
   2 \par \tab \tab DEFB\tab 32H
   2 \par \tab \tab CALL\tab PRCR\tab ;Print a carriage return.
   2 \par \tab \tab CALL\tab DISP_HEX
   2 \par \tab \tab CALL\tab DISP_CH
   2 \par \tab \tab ADD\tab HL,DE
   2 \par \tab LABEL\tab POP\tab HL
   2 \par \tab 70\tab PRINT '"CHECKSUM=";C
   2 \par \tab 64800:\tab 11\tab 213\tab 33\tab 5\tab 0\tab 25\tab 17\tab 53\tab 253\tab 115\tab 35\tab 114\tab 874
   2 \par \tab 64764:\tab 5\tab 215\tab 148\tab 30\tab 254\tab 1\tab 40\tab 12\tab 62\tab 3\tab 253\tab 203\tab 1226
   2 \par \tab 64752:\tab 254\tab 195\tab 193\tab 5\tab 215\tab 32\tab 0\tab 215\tab 130\tab 28\tab 205\tab 183\tab 1655
   2 \par \tab 64728:\tab 195\tab 193\tab 5\tab 215\tab 121\tab 28\tab 205\tab 183\tab 5\tab 215\tab 148\tab 30\tab 1543
   2 \par \tab 64704:\tab 1\tab 215\tab 121\tab 28\tab 205\tab 183\tab 5\tab 215\tab 148\tab 30\tab 167\tab 202\tab 1520
   2 \par \tab 64620:\tab 221\tab 102\tab 70\tab 221\tab 117\tab 11\tab 221\tab 116\tab 12\tab 221\tab 203\tab 24\tab 1539
   2 \par \tab 64536:\tab 254\tab 16\tab 210\tab 99\tab 6\tab 215\tab 1\tab 22\tab 221\tab 42\tab 81\tab 92\tab 1259
   2 \par \tab 64524:\tab 215\tab 32\tab 0\tab 215\tab 130\tab 28\tab 205\tab 183\tab 5\tab 215\tab 148\tab 30\tab 1406
   2 \par \tab 64476:\tab 92\tab 221\tab 126\tab 4\tab 254\tab 77\tab 194\tab 45\tab 6\tab 221\tab 203\tab 24\tab 1467
   2 \par \tab 64464:\tab 30\tab 254\tab 16\tab 210\tab 99\tab 6\tab 215\tab 1\tab 22\tab 221\tab 42\tab 81\tab 1197
   2 \par \tab 64452:\tab 215\tab 121\tab 28\tab 205\tab 183\tab 5\tab 215\tab 148\tab 30\tab 245\tab 215\tab 148\tab 1758
   2 \par \tab 64392:\tab 0\tab 205\tab 143\tab 251\tab 17\tab 1\tab 0\tab 62\tab 255\tab 60\tab 183\tab 237\tab 1414
   2 \par \tab 64368:\tab 94\tab 35\tab 86\tab 235\tab 17\tab 16\tab 39\tab 205\tab 143\tab 251\tab 17\tab 232\tab 1370
   2 \par \tab 64320:\tab 251\tab 126\tab 183\tab 202\tab 99\tab 251\tab 254\tab 3\tab 202\tab 157\tab 251\tab 61\tab 2040
   2 \par \tab 64284:\tab 0\tab 0\tab 0\tab 0\tab 0\tab 33\tab 140\tab 92\tab 54\tab 255\tab 33\tab 13\tab 620
   2 \par \tab 64272:\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0
   2 \par \tab 64236:\tab 123\tab 203\tab 63\tab 215\tab 40\tab 45\tab 215\tab 227\tab 45\tab 205\tab 0\tab 251\tab 1632
   2 \par \tab 64200:\tab 128\tab 250\tab 221\tab 126\tab 41\tab 221\tab 119\tab 13\tab 195\tab 128\tab 250\tab 221\tab 1913
   2 \par \tab 64188:\tab 22\tab 205\tab 33\tab 251\tab 205\tab 0\tab 251\tab 221\tab 126\tab 13\tab 183\tab 194\tab 1704
   2 \par \tab 64176:\tab 10\tab 251\tab 183\tab 32\tab 203\tab 221\tab 126\tab 41\tab 221\tab 190\tab 13\tab 40\tab 1531
   2 \par \tab 64152:\tab 58\tab 9\tab 251\tab 33\tab 12\tab 251\tab 182\tab 230\tab 2\tab 194\tab 169\tab 250\tab 1641
   2 \par \tab 64104:\tab 0\tab 205\tab 30\tab 6\tab 205\tab 183\tab 5\tab 205\tab 109\tab 6\tab 62\tab 2\tab 1018
   2 \par \tab 64080:\tab 167\tab 237\tab 66\tab 48\tab 240\tab 61\tab 225\tab 32\tab 235\tab 33\tab 193\tab 5\tab 1542
   2 \par \tab 64068:\tab 229\tab 245\tab 197\tab 229\tab 213\tab 205\tab 181\tab 3\tab 209\tab 225\tab 193\tab 241\tab 2370
   2 \par \tab 64056:\tab 197\tab 215\tab 153\tab 30\tab 197\tab 205\tab 0\tab 7\tab 225\tab 209\tab 193\tab 241\tab 1872
   2 \par \tab 64044:\tab 6\tab 0\tab 197\tab 215\tab 148\tab 30\tab 167\tab 40\tab 44\tab 79\tab 6\tab 0\tab 932
   2 \par \tab 64032:\tab 5\tab 215\tab 148\tab 30\tab 245\tab 215\tab 148\tab 30\tab 167\tab 40\tab 54\tab 79\tab 1376
   2 \par \tab 64020:\tab 121\tab 28\tab 254\tab 44\tab 194\tab 240\tab 1\tab 215\tab 121\tab 28\tab 205\tab 183\tab 1634
   2 \par \tab 64008:\tab 195\tab 180\tab 18\tab 215\tab 32\tab 0\tab 254\tab 42\tab 194\tab 240\tab 1\tab 215\tab 1586
   2 \par \tab 63996:\tab 54\tab 0\tab 255\tab 215\tab 169\tab 15\tab 33\tab 56\tab 15\tab 229\tab 199\tab 225\tab 1465
   2 \par \tab 63984:\tab 61\tab 92\tab 229\tab 33\tab 127\tab 16\tab 229\tab 237\tab 115\tab 61\tab 92\tab 253\tab 1545
   2 \par \tab 63972:\tab 67\tab 73\tab 92\tab 237\tab 123\tab 61\tab 92\tab 33\tab 7\tab 250\tab 229\tab 42\tab 1306
   2 \par \tab 63960:\tab 12\tab 126\tab 202\tab 240\tab 1\tab 120\tab 230\tab 192\tab 194\tab 240\tab 1\tab 237\tab 1795
   2 \par \tab 63948:\tab 0\tab 215\tab 130\tab 28\tab 205\tab 183\tab 5\tab 215\tab 153\tab 30\tab 253\tab 203\tab 1620
   2 \par \tab 63912:\tab 225\tab 126\tab 230\tab 127\tab 254\tab 32\tab 56\tab 6\tab 254\tab 128\tab 48\tab 2\tab 1488
   2 \par \tab 63876:\tab 215\tab 130\tab 28\tab 205\tab 183\tab 5\tab 215\tab 153\tab 30\tab 96\tab 105\tab 124\tab 1489
   2 \par \tab 63864:\tab 102\tab 250\tab 246\tab 32\tab 254\tab 108\tab 194\tab 197\tab 249\tab 215\tab 32\tab 0\tab 1879
   2 \par \tab 63852:\tab 5\tab 237\tab 176\tab 195\tab 193\tab 5\tab 215\tab 32\tab 0\tab 254\tab 207\tab 202\tab 1721
   2 \par \tab 63828:\tab 32\tab 0\tab 215\tab 140\tab 28\tab 205\tab 183\tab 5\tab 215\tab 241\tab 43\tab 197\tab 1504
   2 \par \tab 63816:\tab 195\tab 193\tab 5\tab 215\tab 130\tab 28\tab 254\tab 44\tab 194\tab 240\tab 1\tab 215\tab 1714
   2 \par \tab 63804:\tab 153\tab 30\tab 197\tab 215\tab 153\tab 30\tab 197\tab 225\tab 193\tab 113\tab 35\tab 112\tab 1653
   2 \par \tab 63792:\tab 254\tab 42\tab 194\tab 75\tab 249\tab 215\tab 121\tab 28\tab 205\tab 183\tab 5\tab 215\tab 1786
   2 \par \tab 63780:\tab 252\tab 254\tab 224\tab 202\tab 175\tab 252\tab 195\tab 240\tab 1\tab 215\tab 32\tab 0\tab 2042
   2 \par \tab 63768:\tab 202\tab 11\tab 250\tab 254\tab 227\tab 202\tab 188\tab 251\tab 254\tab 229\tab 202\tab 12\tab 2282
   2 \par \tab 60\tab NEXT B
   2 \par \tab 30\tab LET C=0
   2 \par \tab 100\tab CLS: NEXT A
   2 \par What to do if you have an unknown ROM
   2 \par The syntax checking routines
   2 \par The restart routines
   2 \par The control routine
   2 \par The Network routines
   2 \par The Microdrive routines
   2 \par The Microdrive command routines
   2 \par Shadow ROM issue 2
   2 \par Labels sorted by address value
   2 \par Labels sorted alphabetically
   2 \par Index to routines
   2 \par How to tell which edition Interface 1 you have
   2 \par Channels
   2 \par Bibliography
   2 \par Basic loader program
   2 \par 9\tab +000B\tab Channel length.
   2 \par (For owners of Interface 1s equipped with the edition 2 Shadow ROM.)
   2 \par 'Nonsense in BASIC'
   2 \par 'Microdrive full'
   2 \par 'MERGE error'
   2 \par 'Drive write protected'
   2 183\tab 92\tab 201\tab 215\tab 24\tab 0\tab 1296
   1 {\upr{\operator George Chirtoaca}{\*\ud\uc0{\operator George Chirtoac{\uc1\u259 a}}}}{\creatim\yr2006\mo8\dy22\hr15\min25}{\revtim\yr2006\mo8\dy22\hr15\min43}{\version3}{\edmins56}{\nofpages143}{\nofwords56390}{\nofchars266727}{\*\company  }
   1 {\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
   1 {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \s15\ql \li0\ri0\widctlpar\tqr\tx6237\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \f2\fs20\lang1043\langfe1033\cgrid\langnp1043\langfenp1033 {
   1 {\nofcharsws314614}{\vern16393}{\*\password 00000000}}{\*\xmlnstbl }\paperw11906\paperh16838\margl1134\margr1134\margt1134\margb1134\gutter0 \deftab709\widowctrl\ftnbj\aenddoc\hyphhotz425\lytprtmet\hyphcaps0\formshade\horzdoc\dghspace120\dgvspace120
   1 {\f8\froman\fcharset0\fprq2{\*\panose 02040503060506020304}New York;}{\f9\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}System;}{\f10\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}
   1 {\f66\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f67\fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f300\froman\fcharset204\fprq2 Sylfaen Cyr;}{\f302\froman\fcharset161\fprq2 Sylfaen Greek;}{\f389\fswiss\fcharset238\fprq2 Tahoma CE;}
   1 {\f62\fmodern\fcharset161\fprq1 Courier New Greek;}{\f63\fmodern\fcharset162\fprq1 Courier New Tur;}{\f64\fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f65\fmodern\fcharset178\fprq1 Courier New (Arabic);}
   1 {\f5\fmodern\fcharset0\fprq1{\*\panose 02070409020205020404}Courier;}{\f6\froman\fcharset0\fprq2{\*\panose 02020603040505020304}Tms Rmn;}{\f7\fswiss\fcharset0\fprq2{\*\panose 020b0604020202030204}Helv;}
   1 {\f55\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f56\fswiss\fcharset186\fprq2 Arial Baltic;}{\f57\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f59\fmodern\fcharset238\fprq1 Courier New CE;}{\f60\fmodern\fcharset204\fprq1 Courier New Cyr;}
   1 {\f49\fswiss\fcharset238\fprq2 Arial CE;}{\f50\fswiss\fcharset204\fprq2 Arial Cyr;}{\f52\fswiss\fcharset161\fprq2 Arial Greek;}{\f53\fswiss\fcharset162\fprq2 Arial Tur;}{\f54\fswiss\fcharset177\fprq2 Arial (Hebrew);}
   1 {\f44\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f45\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f46\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f47\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
   1 {\f410\fswiss\fcharset204\fprq2 Arial Narrow Cyr;}{\f412\fswiss\fcharset161\fprq2 Arial Narrow Greek;}{\f413\fswiss\fcharset162\fprq2 Arial Narrow Tur;}{\f416\fswiss\fcharset186\fprq2 Arial Narrow Baltic;}}{\colortbl;\red0\green0\blue0;
   1 {\f402\fswiss\fcharset161\fprq2 Verdana Greek;}{\f403\fswiss\fcharset162\fprq2 Verdana Tur;}{\f406\fswiss\fcharset186\fprq2 Verdana Baltic;}{\f407\fswiss\fcharset163\fprq2 Verdana (Vietnamese);}{\f409\fswiss\fcharset238\fprq2 Arial Narrow CE;}
   1 {\f39\froman\fcharset238\fprq2 Times New Roman CE;}{\f40\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f42\froman\fcharset161\fprq2 Times New Roman Greek;}{\f43\froman\fcharset162\fprq2 Times New Roman Tur;}
   1 {\f396\fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f397\fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f398\fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f399\fswiss\fcharset238\fprq2 Verdana CE;}{\f400\fswiss\fcharset204\fprq2 Verdana Cyr;}
   1 {\f390\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f392\fswiss\fcharset161\fprq2 Tahoma Greek;}{\f393\fswiss\fcharset162\fprq2 Tahoma Tur;}{\f394\fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f395\fswiss\fcharset178\fprq2 Tahoma (Arabic);}
   1 {\f36\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana;}{\f37\fswiss\fcharset0\fprq2{\*\panose 020b0506020202030204}Arial Narrow;}{\f38\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Souvenir Lt BT;}
   1 {\f33\froman\fcharset1\fprq2{\*\panose 00000000000000000000}Estrangella Edessa;}{\f34\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Arial Unicode MS;}{\f35\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
   1 {\f30\froman\fcharset1\fprq2{\*\panose 00000400000000000000}Sendnya;}{\f31\froman\fcharset1\fprq2{\*\panose 00000400000000000000}Gautami;}{\f32\froman\fcharset1\fprq2{\*\panose 00000400000000000000}Tunga;}
   1 {\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f4\fswiss\fcharset0\fprq2{\*\panose 020b0504020202020204}Helvetica;}
   1 {\f27\froman\fcharset1\fprq2{\*\panose 00000400000000000000}Vrinda;}{\f28\froman\fcharset1\fprq2{\*\panose 00000400000000000000}Raavi;}{\f29\froman\fcharset1\fprq2{\*\panose 00000400000000000000}Shruti;}
   1 {\f24\froman\fcharset1\fprq2{\*\panose 00000400000000000000}Mangal;}{\f25\froman\fcharset1\fprq2{\*\panose 00000400000000000000}Latha;}{\f26\froman\fcharset0\fprq2{\*\panose 010a0502050306030303}Sylfaen;}
   1 {\f21\froman\fcharset0\fprq2{\*\panose 02040603050705020303}Century;}{\f22\froman\fcharset222\fprq2{\*\panose 02020603050405020304}Angsana New;}{\f23\froman\fcharset222\fprq2{\*\panose 020b0304020202020204}Cordia New;}
   1 {\f19\froman\fcharset128\fprq1{\*\panose 02020609040305080305}Mincho{\*\falt \'96\'be\'92\'a9};}{\f20\froman\fcharset129\fprq1{\*\panose 020b0600000101010101}Gulim{\*\falt \'b1\'bc\'b8\'b2};}
   1 {\f17\fmodern\fcharset134\fprq1{\*\panose 02010600030101010101}SimHei{\*\falt \'ba\'da\'cc\'e5};}{\f18\fmodern\fcharset136\fprq1{\*\panose 02010609000101010101}MingLiU{\*\falt \'b2\'d3\'a9\'fa\'c5\'e9};}
   1 {\f15\fmodern\fcharset128\fprq1{\*\panose 020b0609070205080204}MS Gothic{\*\falt \'82\'6c\'82\'72 \'83\'53\'83\'56\'83\'62\'83\'4e};}{\f16\fmodern\fcharset129\fprq1{\*\panose 020b0600000101010101}Dotum{\*\falt \'b5\'b8\'bf\'f2};}
   1 {\f13\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'cb\'ce\'cc\'e5};}{\f14\fnil\fcharset136\fprq2{\*\panose 02010601000101010101}PMingLiU{\*\falt \'b7\'73\'b2\'d3\'a9\'fa\'c5\'e9};}
   1 {\f11\froman\fcharset128\fprq1{\*\panose 02020609040205080304}MS Mincho{\*\falt \'82\'6c\'82\'72 \'96\'be\'92\'a9};}{\f12\fnil\fcharset129\fprq1{\*\panose 02030600000101010101}Batang{\*\falt \'b9\'d9\'c5\'c1};}
   1 {\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*
   1 your program.
   1 y, that routine will only clear the stream data in STRMS area and is not able to manipulate and reclaim the interface's channels as required. So the shadow ROM is paged-in by an instruction fetch at the address +1708 (i.e., the middle of the CLOSE-2 routi
   1 w ROM 2 labels which follow. When you have entered this program and assembled it, save it onto Microdrive or tape. To use the new BASIC commands, load the machine code file you have made into your Spectrum at 63744 (F900 Hex), and give the direct command 
   1 ver the network. After having sent every bit, a test is made to see if the network has the expected state from the current bit value; if any error is found, then the whole procedure is repeated.
   1 u will have to ORG your program to an earlier location, in order for it to fit into memory. Remember that when you initialise the new commands from BASIC, you should no longer use
   1 tting bit 7 of the channel specifier. The variables are to be set as for the OP-PERM-N subroutine below. The start of the channel area is returned in the IX index register.
   1 to use these routines in your programs. In addition, many examples are given of how to expand the Spectrum's BASIC by using the Interface 1 to define new commands.
   1 to point to your own syntax checking routine, it will be your routine that is called.
   1 to SER-FL.
   1 tines, and will perform the same functions. This doesn't mean that you'll have to write all these routines - all the code you need is contained in the Shadow ROM disassembly given earlier in this book. Simply find the routine you need in the Shadow ROM di
   1 the main ROM and the Shadow ROM. Note however, that your command must not start with any of the eleven keywords which are recognised 
   1 the STRMS area.
   1 the ROM has corrected a number of errors contained in the previous edition, as well as adding some new routines. Because new code has been added to 
   1 t the 'old' one and the 'new' data, and then erase the 'old' file. This is not easy, and is a very slow process.
   1 t how you can implement the new commands.
   1 stem variable CH_ADD will point to the first character of the command that produces the error.
   1 sassembly, and copy it into your program. Consider the following example:
   1 s found inactive and no data has been read. The bits are read every 40 T cycles.
   1 rum. Do not enter the table of EQU statements that follows on page 33. These labels all refer to the edition 1 Shadow ROM, and are not relevant to edition 2. Instead, for each label given on page 33, enter the value given in the alphabetical list of Shado
   1 rstly, there must be a syntax routine which will identify the new command, any parameters that go with it, and the end of the statement it is in. Secondly, there must be a routine which will do the actual work of the command. Finally, of course, the syste
   1 ridge is in the", "Microdrive."
   1 read from the Microdrive unit, a record of the current file (saved with a SAVE command). An error occurs if no record is found after five passes of the cartridge tape. The entry point is F-REC2 when the Microdrive motor is already turned on.
   1 re more than 512 characters to be printed (otherwise unpredictable results may occur when the Spectrum tries to send the record to the Microdrive while the CAT command is operative). This can be done by making sure that there are fewer than 20 files on th
   1 re GET-M-HD or GET-M-BUF, depending upon whether the block to be received is a header or a data block.
   1 r the block is the 'end of file' one or not. NCNUMB is incremented before returning. The zero flag is returned set if the destination station number denotes that the 'broadcasting' is being used.
   1 programmers may still be interested in the details of the Spectrum's BASIC interpreter, and of the ingenious mechanism used to 
   1 priate map bit is set and CHREC is automatically incremented. An error is produced if no more space is available on the cartridge to write the record.
   1 port is given if there are some characters left in the line. A return is made to the calling routine only during runtime, otherwise the control returns to the 'main' ROM interpreter.
   1 outine that handles the "n" channel output is quite straightforward. It involves the storing of the byte held in the A register into the 255-byte buffer; whenever this is filled, the subroutine S-PACK-1 is called, so the data block is sent over the networ
   1 ould be modified appropriately. When at some 1ater time you wish to use the routines, you have simply to place the cartridge in Microdrive 1, and then to enter the following direct commands:
   1 ook code you are using. Their effect is to page the ROM in, call a routine in the Interface 1's 'shadow ROM', then page the main ROM back in and return control to the users program. This provides 'transparant' access to the Interface 1 \emdash 
   1 olves the 'reading' of a byte from the required stream or channel, and then the 'writing' of that byte onto the 2nd stream or channel. The operation is repeated until the 'end of file' condition occurs. Note that bit 4 of FLAGS3 is set to signal to the CA
   1 ok code' +25. The subroutine reads into the datablock of the current "m" channel, the next record of a named PRINT-type file. On entry IX must hold the "m" channel start address, and CHREC the number of the current record. CHREC will be automatically incr
   1 ograms, one of which is used by each new command. The equate statements used by these routines are included in a seperate table at the end of the listings. To add the new BASIC commands to your Spectrum, enter the assembler program on the following pages,
   1 o exist. These new commands are perceived as errors by the Spectrums ROM, so the error routine is called. This passes control to the Interface 1, where the Shadow ROM does its own syntax checking, recognizes the new commands, and performs the appropriate 
   1 o BASIC is given later in the book, and it may prove useful in understanding what is being done in this section.
   1 number is specified by CHREC. Other channel variables, such as CHNAME, are to be set as required.
   1 nt CLOSE-M is used when the start address of the channel is held in the HL register pair, while CLOSE-M2 (also used by 'hook code' +23) is used when that address is held in the IX index register.
   1 never transmitted; bytes 28..54 are the 'header block'; bytes 55..594 are the 'data block'.
   1 ne in the main ROM). The following routine is then used.
   1 n after the reclaiming.
   1 main ROM is paged back in.
   1 m variable VECTOR must have been redirected to point to the syntax routine, so that 'errors' detected by the Shadow ROM will be redirected to your routine.
   1 line sheets). The parameter 'y' is the form\emdash feed code that your printer accepts; the standard value is 12. You may store codes other than form\emdash feed, such as linefeed, etc., to obtain different results when the 'x' lines have been printed.
   1 lem: Sinclair Research have not used the same ROM in every Interface 1. There are two different editions of the ROM. Each, of course, does the same job of running the Microdrives, the RS\emdash 
   1 language subroutine which will perform the appropriate actions before returning control to the main ROM, otherwise it will call a routine to print an error message.
   1 k is examined until it is active. At this point, the SCOUT is identified. The subroutine returns the carry flag reset if 'time-out' has occurred and no SCOUT has been identified. Remember that there are no 'time-outs' when broadcasting.
   1 ith 'b' channel input, the bits have a fixed length, depending upon the selected baud rate. This subroutine is also called by the 'hook code' +1E.
   1 isters before you use any hook codes. Some of the more complex routines corrupt HL', the return address to BASIC, so you may wish to preserve this.
   1 isplayed on the screen; if it matc
   1 is in RAM, we can chang
   1 is entered, or at runtime, a jump is made to the error handling routine. This is done by a RST 8 instruction, followed by a byte which defines the error type. Note the similarities between this and the hook codes discussed earlier. As with the normal hook
   1 is advanced to the character that follows the token 'POKE', and if the character '*' is not present, a jump is made to the command for pokeing strings into memory (because the current command is not POKE *x,y).
   1 iod, and then the 8 bits (each 40 T cycles).
   1 ined. If you wish to direct the catalogue to a printer, you must use first a command such as:
   1 in ROM interpreter by jumping to END1.
   1 ill be adding will make the extended commands somewhat longer. Because of this, yo
   1 hus, is used to send over the network a block of bytes. Again, on entry HL must hold the address fro which the block is stored, and E must hold its length. Initially a leader (length 98 T cycles) is sent, followed by each byte, with an initial 'start' per
   1 his material is given in The Spectrum Microdrive Book by Dr. Ian Logan, also published by Melbourne House.
   1 hints for the creation of the their own routines, and the algorithms controlling the Microdrive, the RS\emdash 232 link, and the Local Area Network will be of interest to even the most expert programmer.
   1 hes the one printed on the listing, at the right hand side of the line, then you have made no mistakes in typing the numbers, and you may enter 'N' or 'n' to continue with the next line. If the checksums do not match, you must enter 'Y' or 'y', and then r
   1 he screen, etc. Many of these routines are at different locations in the first two editions of the ROM, and presumably they would be different again in any future ROMs.
   1 he motors, and the selection of the required drive. It is entered with drive number 1...8 (or 0 to switch all motors off) in the A register. The required drive motor is selected, its motor started, while others are disabled.
   1 he extended BASIC commands routines of your own which have the same names as the ROM rou
   1 hat map bit. The entry point is CHK-MAP-2 when the sector number has to be collected from RECNUM, or CHECK-MAP if from HDNUMB.
   1 hannel, and with the HL register holding a suitable displacement to be eventually inserted in the STRHS area to attach the channel to a stream. Note that the HL' register is corrupted if you call this routine from your own program.
   1 hand side of each line, then you have not made mistakes in typing the numbers, and you may enter "N" or "n" to continue with the next line. If the checksums do not match, you must enter 'y' or 'Y', and then retype the whole line.
   1 g of a byte from the data block. When it is empty, a further block is to be received from Microdrive (Provided that the 'current' data block is not the 'end of file' one) before reading the byte.
   1 followed by the header and the data block for the "n" channel pointed by the IX register. On entry, the A register may hold +01 or +00 depending upon whethe
   1 extend it. Please note that this information is primarily designed to give a general explanation of how we have implemented our extended BASIC commands. It is not intended to be a step by step guide to writing new BASIC commands. A fuller explanation of t
   1 etype the whole line.
   1 er having pressed BREAK to stop the listing) press the EDIT key.
   1 ename starting wIth CHR$ 0. Hook code +34 opens a RS232 "b" channel by calling the OP-RS-CH subroutine. The channel base address is returned into the DE register pair.
   1 emented. CHDRIV must hold the drive number and CHNAME must hold the file name.
   1 efore calling the routine. The record descriptor is stored into the current microdrive channel (whose start address must be held into the IX index register), and the carry flag is returned set if any error occurs, or if the 'record descriptor' holds a fil
   1 e; then starts to collect records and to LOAD or VERIFY the data coming in the 512-Byte buffer. When each record has been loaded or verified, the relevant map bit is set, so as to prevent the record to be used again. The map contents are restored to their
   1 e the value it holds to that of our own syntax checking routine, which will check the statement yet again, to see if it is one of the new commands that we have defined. If the statement is one of our new statements, our syntax checker will call a machine 
   1 e the program on tape, line 120 of the listing should be modified. When at later time you wish to use the routines, you have simply to place the cartridge into Microdrive I, and then to enter the following direct commands:
   1 e cartridge.
   1 drives. Equally impressive is its ability to expand the BASIC provided with the computer, adding new and powerful commands. Much of this power is due to the 8K monitor program which is housed in an 8K Read Only Memory in the Interface 1.
   1 d. The result is that when sending two tokens (i.e., THEN GOTO), two spaces are inserted between them, instead of one. The correct routine should include the following two instructions after the final 'RET C': 'JR NZ,BCHAN-OUT' and 'SET 0,(FLAGS)', and a 
   1 d channel, and HL holding the 'stream displacement' for that channel, The stream that refers to this displacement (i.e. the stream attached to the reclaimed channel) is closed. The other stream displacements are updated if they refer to channels moved dow
   1 d be displayed on the screen; if it matches with the one printed on the listing, at the right\emdash 
   1 ches the address +1708 i.e., the middle of the CLOSE command routine, which is not able to deal with Interface's channels.)
   1 be erased,
   1 ay of (47+26*(BAUD)) T cycles, that is the length of each bit.
   1 ave given contains a number of calls to routines in the Shadow ROM, which perform a number of useful tasks, such as selecting Microdrives, reading a sector of tape, displaying hexadecimal numbers on t
   1 assed to the called subroutine.
   1 arch have provided a way to access a number of the ROM routines in a way which can be guaranteed to work on all machines. To do this, we use what are called hook codes. These consist of a RST 8 instruction followed by a byte whose value depends on which h
   1 along is Microdrive 2, and so on.", "There is also a light on the front of each Microdrive."
   1 all to ST_END returns to the 'main' ROM during syntax checking. During runtime the execution continues, and the main ROM routine FIND_INT2 is used to fetch the values from the calculator stack. After the POKE * has been done, control is returned to the ma
   1 action for each new command, before passing control back to the main Spectrum ROM. Code is provided in the Shadow ROM for checking commands starting with the following keywords: CAT, FORMAT, MOVE, ERASE, OPEN, SAVE, LOAD, VERIFY, MERGE, CLS, and CLEAR.
   1 able, an auto CR feature is supported, and finally a re\emdash definable form\emdash feed code is sent after a certain amount of lines printed, so as to advance to the next page before the printing head reaches the end of the sheet.
   1 \ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv 
   1 \red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 \f38\fs24\lang1043\langfe1033\cgrid\langnp1043\langfenp1033 \snext0 Normal;}
   1 \red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;
   1 \ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{\s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 
   1 \pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5
   1 \pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang 
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 where x is the location at which your assembler program is ORGed.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 but instead use
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page INTRODUCTION
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page Extending Spectrum BASIC
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page Assembler Listings
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page APPENDIX 8
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page APPENDIX 5
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page APPENDIX 4
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page APPENDIX 3
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page APPENDIX 2
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page APPENDIX 11
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page APPENDIX 10
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page APPENDIX 1
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 The syntax of your new command can be anything which will be rejected by the syntax checkers in both 
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 The routine follows:
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 So, the control routine that must be added to handle a new statement must have two parts: Fi
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 2. NETWORK CHANNEL
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx2127\tx3119\tx4111\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 Notes\tab Address\tab Name\tab Contents
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx2127\tx3119\tx4111\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 N2\tab 23783 5CE7\tab HD-0B\tab Data blocklength.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx2127\tx3119\tx4111\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 Bytes 0..27 are used as 'channel descriptor' and are\tab 
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx2127\tx3119\tx4111\tx5529\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab \tab \tab 00 - program\tab 01 - numeric array
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1985\tx2694\tx4962\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \page THE SHADOW ROM DISASSEMBLY
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1985\tx2694\tx4962\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 1813\tab CMK-PRES\tab CALL\tab 18E9,TEST-BRK\tab Give an error if BREAK is pressed.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1985\tx2694\tx4962\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 1811\tab REPTEST\tab LD\tab B,+06\tab Set a counter.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1985\tx2694\tx4962\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 1122\tab M-INPUT\tab LD\tab IX,(CURCHL)\tab First make IX point to start of
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1985\tx2694\tx4962\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 0C3A\tab TCHAN-OUT\tab CP\tab +A5\tab Jump if the code is not a token
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1985\tx2694\tx4962\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 04BC\tab \tab CALL\tab 062F,EXPT-NAME\tab Evaluate "name" and set N-STR1.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1985\tx2694\tx4962\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1985\tx2694\tx3969\tx4678\tx5954\tx6663\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 06B9\tab EXPT-EXP1\tab 06CC\tab ENDHERE\tab 0700\tab UNPAGE\tab 0701\tab EXPT-PRMS
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1985\tx2694\tx3969\tx4678\tx5954\tx6663\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 068F\tab TEST-STAT\tab 06A1\tab NREPORT-8\tab 06A3\tab EXPT-EXPR\tab 06B0\tab TEST-BAUD
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1985\tx2694\tx3969\tx4678\tx5954\tx6663\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 0000\tab MAIN-ROM\tab 0008\tab ST-SHADOW\tab 0010\tab CALBAS\tab 0018\tab CHKSYNTAX
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx709\tx1418\tx1985\tx2835\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx567\tx1985\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 0\tab +0008\tab Main ROM 'Output' routine,
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx490\tx709\tx1985\tx2694\tx4962\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab \tab \tab \tab \tab expected, so jump.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx426\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 9.\tab The cartridge name is taken from HDNAME and printed.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx426\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 2.\tab The last record of the file is loaded into the channel area.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx426\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 11.\tab The Microdrive motor is turned off, and the channel is reclaimed.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx426\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 1.\tab A 'temporary "m" channel' and map is created in the CHANS area.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab a = 437500/frequency-30.l25
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab RANDOMISE USR x
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab RANDOMISE USR 63744
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab POKE 32000,207: POKE 32001,32: POKE 32002,201: RANDONISE USR 32000
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab POKE 30000, "FRED BLOGGS"
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab POKE 23675,32000~256*INT (32000/256)
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab POKE *23675,32000
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab OPEN #2;"m";d;"CAT"
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab FOR A=30000 TO 30010: PRINT CHR$ PEEK A;: NEXT A
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab CLOSE # 0: PRINT PEEK 23729
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab CLEAR 63743: LOAD *"M";1;"SHADP"CODE: RANDOMIZE USR 63744
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab CLEAR 63743: LOAD *"M";1;"SHADP" CODE: RANDOMIZE USR 63744
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab BEEP * 100,255,10,1
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 2DH - Opens a network channel.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 21H - Select drive. Can be used to turn any drive on, or all drives off.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 1BH - Accepts a character from the keyboard.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 02B7 00 50 72 6F 67 72 Progr
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab *L 31920
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx3402\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab MOVE "m";d;"CAT" TO #3\tab (with the ZX printer)
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab \tab ORG\tab 34000
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab \tab LD\tab HL,LABEL
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab DISP-HEX\tab PUSH\tab AF
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab DISP-CH\tab PUSH\tab HL
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab \tab PUSH\tab HL\tab ;below when finished.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab \tab ORG\tab 7D00H\tab ;32000 dec
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab \tab ORG\tab 0F900H
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab \tab LD\tab H,B\tab ;move it into HL
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab \tab INC\tab HL
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab PGM9\tab RST\tab CALBAS\tab ;Advance CH_ADD.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab PGM8\tab RST\tab CALBAS\tab ;Advance CH_ADD.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab PGM7\tab RST\tab CALBAS\tab ;Advance CH_ADD.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab PGM6\tab RST\tab CALBAS\tab ;Advance CH_ADD.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab PGM5\tab RST\tab CALBAS\tab ;Advance CH_ADD.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab PGM4\tab CP\tab "e"\tab ;Error if it is not the '*E' command.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab PGM3\tab RST\tab CALBAS\tab ;Advance CH_ADD.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab PGM2\tab RST\tab CALBAS\tab ;Evaluate the address.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab PGM1\tab RST\tab CALBAS
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab FPRINT\tab LD\tab E,(HL)\tab ;Fetch entry indirectly.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 STSYN\tab RST\tab CALBAS
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx284\tx1134\tx1701\tx2268\tx2835\tx3402\tx3969\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab            ....
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx2552\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 'PRINT'\tab If it is a PRINT\emdash type file.
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx1418\tx1985\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 MAIN_ROM\tab EQU\tab 00H
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx1276\tx1985\tx3261\tx3969\tx5245\tx5954\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 ACC-CODE\tab 0D8A\tab ALL-BITS\tab 102F\tab ALL-BYTES\tab 05A7\tab ALL-CHARS\tab 1407
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tx1276\tx1985\tx3261\tx3969\tx5245\tx5954\tx7230\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 ACC-CODE\tab 0CED\tab ALL-BITS\tab 0F72\tab ALL-BYT-2\tab 14CF\tab ALL-BYTES\tab 05A7
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tqr\tx567\tx709\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 5\tab PRINT "CREATING THE FILE"
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tqr\tx567\tx709\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 10\tab LET a=RND*1000+10
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tqr\tx567\tx709\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 10\tab DIM a$(24,63)\tab 
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tqr\tx567\tx709\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 10\tab DATA 261.63, 277.18, 293.66, 311.13, 329.63, 349.23, 369.99, 392, 415.3, 440, 466.16, 493.88
   1 \par }\pard \s15\ql \li0\ri0\widctlpar\tqr\tx567\tx709\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab 10\tab CLEAR 26000
   1 \par }\pard \s15\ql \fi284\li0\ri0\widctlpar\tx284\tx1701\tx2268\tx4536\wrapdefault\nooverflow\faroman\rin0\lin0\itap0 {\insrsid13766214 \tab LD\tab HL,ED_LOOP\tab ;Return to 'EDitor LOOP', and to ENDED
   1 \par }\pard \s15\ql \fi-420\li420\ri0\widctlpar\tx426\wrapdefault\nooverflow\faroman\rin0\lin420\itap0 {\insrsid13766214 5.\tab The 'record descriptor' and the 'header informations' are loaded into the RDESC area.
   1 \par }\pard \s15\ql \fi-420\li420\ri0\widctlpar\tx426\wrapdefault\nooverflow\faroman\rin0\lin420\itap0 {\insrsid13766214 10.\tab The number of 'free sectors' is used to print the number of Kbytes left in the cartridge.
   1 \par }\pard \s15\ql \fi-420\li420\ri0\widctlpar\tx426\wrapdefault\nooverflow\faroman\rin0\lin420\itap0 {\insrsid13766214 1.\tab A 'Microdrive map' is set\emdash up, for use when the channel is made a 'write' channel.
   1 \par variable D-STR1. It rounds the value to the nearest 'standard' value and sets the BAUD system variable with the appropriate timing constant. It is used by the 'FORMAT' command routine.
   1 \par values.
   1 \par to make the new commands available.
   1 \par to initialise the system variable VECTOR. You must do this whenever the initial VECTOR contents are defaulted back to ERR_6 (01F0). This happens when you use a NEW command to delete the BASIC program from the memory.
   1 \par the shadow ROM subroutines, there will be no need to change your program if Sinclair make further changes to the ROM. Otherwise you will need to update all the absolute references to the shadow ROM.
   1 \par the Shadow ROM in:
   1 \par the Shadow ROM at various points, many of the routines in the ROM are no longer located at the same address as before. As the extensions to BASIC given in this book make use of many routines from the Shadow ROM, you will have to do slightly 
   1 \par that the remaining buffer contents are to be erased (no data is sent, as
   1 \par test probably wont distinguish between the edition 2 and edition 3 Shadow ROMs, You can, however, upload the Shadow ROM into a higher area of RAM, disassemble it there, and compare the code to the listings given in this book. The following 
   1 \par string has null length.
   1 \par stack are collected and copied into the Microdrive map.
   1 \par sets N-STR1, L-STR1 and D-STR1 as required before exiting during syntax checking, or executing the command during runtime.
   1 \par response byte has been received. This subroutine is called from SEND-PACK below to send the header and then the data block over the network.
   1 \par report message printed is one of the 'shadow' report.
   1 \par register pair will hold the start of the channel.
   1 \par register it is used to communicate through the Local Area Network.
   1 \par program will load the Shadow ROM into RAM from 32768 to 48968:
   1 \par opposed to the case of a CLOSE# command).
   1 \par onto tape or Microdrive, and instantly have a more powerful BASIC. Machine code programmers will find the programs valuable examples of how to use the Interface 1 ROM routines, and should be interested by the way in which new commands are added to BASIC. 
   1 \par lDAF\tab \tab AND\tab +02
   1 \par lD90\tab \tab LD\tab A,+FF\tab CHREC is made holding 255.
   1 \par lD60\tab \tab RST\tab 10,CALBAS\tab Call main ROM 'TEMPS' subroutine.
   1 \par l9A3\tab \tab JP\tab (HL)\tab Jump to the 'hook code' routine.
   1 \par l96C\tab UNKN-8\tab PUSH\tab IX
   1 \par l7F0\tab \tab LD  \tab D,(IX+10)
   1 \par l77C\tab \tab JP\tab 10C4,DEL-M-BUF\tab Reclaim "m" channel.
   1 \par l72C\tab \tab LD\tab DE,+0014\tab 'new' channels,
   1 \par l6AA\tab \tab POP\tab HL\tab Restore channel start address.
   1 \par l63A\tab \tab ADD\tab HL,DE
   1 \par l4F7\tab \tab CALL\tab 12A9,CLOSE-M2\tab Close the channel and report the error
   1 \par l27C\tab \tab PUSH\tab HL\tab Save this address.
   1 \par l23A\tab \tab LD\tab (RECNUM),A
   1 \par l0E3\tab \tab LD\tab BC,+0253\tab Amount of bytes moved down.
   1 \par l0A3\tab \tab LD\tab BC,+000C\tab Preamble is 12 bytes in length.
   1 \par l094\tab FILL-MAP\tab LD\tab (HL),A\tab Store +FF into this location.
   1 \par l06A\tab \tab INC\tab IX
   1 \par l00C\tab \tab JR\tab NZ,102A,NEXT-CHAN\tab drive.
   1 \par is a rather straightforward way of changing to '32000' the contents of the UDG system variable, as compared with the usual:
   1 \par into the middle of the LOAD~VERIFY-MERGE commands routine.
   1 \par initially calculates the number of records that composes the fil
   1 \par i26A\tab \tab LD\tab B,+20\tab Length of the map.
   1 \par holding the number of 'inserted' bytes. The addresses held into (N-STR1+2) and (N-STR2+2) are then updated, unless the filenames are stored into 'no-dynamic' areas (i.e. before the channel or after STKEND).
   1 \par found an error, and jumps to the address which is stored in a system variable called VECTOR. This address is normally that of a main ROM error handling routine, which will print out an error message and cease execution. However, since the variable VECTOR 
   1 \par expressions have incorrect syntax. Otherwise the syntax is correct and the c
   1 \par expression. A comma must be placed between them as separator. During runtime, the main ROM routines STK_FETCH and FIND_INT2 are used to fetch the string parameters, and the value of the numeric expression. No action is taken iF the 
   1 \par execution.
   1 \par different things to implement the BASIC extensions, depending on which edition of the Interface 1 you own.
   1 \par contains an unformatted cartridge). If A holds zero, all motors are turned off. Note that this subroutine returns with interrupts disabled if a motor has been switched on.
   1 \par commands given here will not work properly with it. If the extended BASIC commands do not work for you, and you suspect that you might have a third edition or later Shadow ROM, turn to Appendix 11 on page 165 to find ou
   1 \par command is in the form 'MOVE "S";N (;"NAME") TO ...'. In both cases the start address of the channel is returned into N-STR1.
   1 \par carry set if an acceptable byte has been read in the A register from the RS232 link, or zero flag set when no byte has been read.
   1 \par by the Shadow ROM (see above).
   1 \par buffer into the sector, provided that the cartridge is not write-protected. Finally the map bit is set.
   1 \par are reset to +FF.
   1 \par and then use the *CAT n command. Finally 'CLOSE #2' will send the catalogue to the Microdrive. It can then be printed with either:
   1 \par and the new comnands should be available. Note that if you use the NEW command, you should then give the direct command 'RANDOMISE USR 63744' to reinitialise the VECTOR system variable.
   1 \par \tab the start address and the length of the file.
   1 \par \tab b = frequency * time
   1 \par \tab \tab used by SAVE, MOVE, etc.).
   1 \par \tab \tab the channel is used for writing).
   1 \par \tab \tab the channel is used for reading).
   1 \par \tab \tab start of the record descriptor.
   1 \par \tab \tab number.
   1 \par \tab \tab mark the start of the header block.
   1 \par \tab \tab buffer (0..512).
   1 \par \tab \tab \tab the SAVE.
   1 \par \tab \tab \tab packet.
   1 \par \tab \tab \tab or baud rate 75..19200.
   1 \par \tab \tab \tab operations.
   1 \par \tab \tab \tab for the current packet (0..64).
   1 \par \tab \tab \tab byte if low byte is 01.
   1 \par \tab \tab \tab bit 7 -\tab set during execution of VERIFY cormnand.
   1 \par \tab \tab \tab bit 6 -\tab set during execution of MERGE conmiand.
   1 \par \tab \tab \tab bit 5 -\tab set during execution of SAVE conwsand.
   1 \par \tab \tab \tab bit 4 -\tab set during execution of LOAD and MOVE.
   1 \par \tab \tab \tab bit 3 -\tab set if using the network.
   1 \par \tab \tab \tab bit 2 -\tab set if the main ROM error handler is to
   1 \par \tab \tab \tab bit 1 -\tab set during execution of CLEAR# command.
   1 \par \tab \tab \tab bit 0 -\tab set during execution of 'new' commands.
   1 \par \tab \tab \tab and LOAD commands.
   1 \par \tab \tab \tab address to point to a RAM routine.
   1 \par \tab \tab \tab address of the routine called by using 'hook code'
   1 \par \tab \tab \tab \tab with the network.
   1 \par \tab \tab \tab \tab variables area.
   1 \par \tab \tab \tab \tab variable.
   1 \par \tab \tab \tab \tab value of A goes into H.
   1 \par \tab \tab \tab \tab valid.
   1 \par \tab \tab \tab \tab used.
   1 \par \tab \tab \tab \tab used, the 'start' has been stored
   1 \par \tab \tab \tab \tab types greater than 3).
   1 \par \tab \tab \tab \tab transmitted if during 'output').
   1 \par \tab \tab \tab \tab transferred.
   1 \par \tab \tab \tab \tab to be moved down.
   1 \par \tab \tab \tab \tab to HL.
   1 \par \tab \tab \tab \tab this is the return address stored by
   1 \par \tab \tab \tab \tab the stack.
   1 \par \tab \tab \tab \tab the line.
   1 \par \tab \tab \tab \tab the insertion of the "N" channel.
   1 \par \tab \tab \tab \tab the file.
   1 \par \tab \tab \tab \tab the file is computed (INT(length/5l2))
   1 \par \tab \tab \tab \tab the error pointer.
   1 \par \tab \tab \tab \tab the character.
   1 \par \tab \tab \tab \tab the CALL 162C inside the 'main' ROM
   1 \par \tab \tab \tab \tab than has been requested.
   1 \par \tab \tab \tab \tab temporary channel.
   1 \par \tab \tab \tab \tab syntax is being checked.
   1 \par \tab \tab \tab \tab subroutine.
   1 \par \tab \tab \tab \tab string.
   1 \par \tab \tab \tab \tab string length.
   1 \par \tab \tab \tab \tab stream.
   1 \par \tab \tab \tab \tab stream data.
   1 \par \tab \tab \tab \tab stop).
   1 \par \tab \tab \tab \tab space.
   1 \par \tab \tab \tab \tab space created.
   1 \par \tab \tab \tab \tab set to signal that the aheadow ROM
   1 \par \tab \tab \tab \tab send the byte.
   1 \par \tab \tab \tab \tab sectors.
   1 \par \tab \tab \tab \tab second channel.
   1 \par \tab \tab \tab \tab routine' pointer.
   1 \par \tab \tab \tab \tab routine is the same as that of
   1 \par \tab \tab \tab \tab returned reset to signal EOF.
   1 \par \tab \tab \tab \tab required statement.
   1 \par \tab \tab \tab \tab report the error.
   1 \par \tab \tab \tab \tab replaced with the +1349 below).
   1 \par \tab \tab \tab \tab register pair (see 0014).
   1 \par \tab \tab \tab \tab red unchanged'.
   1 \par \tab \tab \tab \tab records.
   1 \par \tab \tab \tab \tab received byte.
   1 \par \tab \tab \tab \tab received byte with that held in
   1 \par \tab \tab \tab \tab read - 82'.
   1 \par \tab \tab \tab \tab rate.
   1 \par \tab \tab \tab \tab printed.
   1 \par \tab \tab \tab \tab pressed.
   1 \par \tab \tab \tab \tab preamble.
   1 \par \tab \tab \tab \tab possibly moved up after the
   1 \par \tab \tab \tab \tab position into C.
   1 \par \tab \tab \tab \tab pointer.
   1 \par \tab \tab \tab \tab pointer - 4).
   1 \par \tab \tab \tab \tab past the separator.
   1 \par \tab \tab \tab \tab or alphanumeric array,
   1 \par \tab \tab \tab \tab or BREAK pressed.
   1 \par \tab \tab \tab \tab one).
   1 \par \tab \tab \tab \tab off drive motors.
   1 \par \tab \tab \tab \tab of the program and its variables.
   1 \par \tab \tab \tab \tab of sectors required.
   1 \par \tab \tab \tab \tab of quotes have been found).
   1 \par \tab \tab \tab \tab of a 'CODE' block.
   1 \par \tab \tab \tab \tab of "N" channel.
   1 \par \tab \tab \tab \tab not the expected one.
   1 \par \tab \tab \tab \tab not necessary.
   1 \par \tab \tab \tab \tab not exist.
   1 \par \tab \tab \tab \tab normal, +01 for end of file.
   1 \par \tab \tab \tab \tab nonexistent array.
   1 \par \tab \tab \tab \tab network was inactive.
   1 \par \tab \tab \tab \tab name is to be inserted.
   1 \par \tab \tab \tab \tab moved after the 'insertion' of the
   1 \par \tab \tab \tab \tab message in the table.
   1 \par \tab \tab \tab \tab memory.
   1 \par \tab \tab \tab \tab main ROM 'ADD-CHAR' subroutine.
   1 \par \tab \tab \tab \tab machine stack.
   1 \par \tab \tab \tab \tab loading of an autorun program.
   1 \par \tab \tab \tab \tab loading a 'new' array).
   1 \par \tab \tab \tab \tab loaded.
   1 \par \tab \tab \tab \tab loaded).
   1 \par \tab \tab \tab \tab line.
   1 \par \tab \tab \tab \tab line to be searched for.
   1 \par \tab \tab \tab \tab less than or equal to that of the
   1 \par \tab \tab \tab \tab length'.
   1 \par \tab \tab \tab \tab length count.
   1 \par \tab \tab \tab \tab left.
   1 \par \tab \tab \tab \tab it has been moved up after the
   1 \par \tab \tab \tab \tab is resting.
   1 \par \tab \tab \tab \tab is pointed by PROG.
   1 \par \tab \tab \tab \tab is not a colon).
   1 \par \tab \tab \tab \tab is not +01.
   1 \par \tab \tab \tab \tab is needed.
   1 \par \tab \tab \tab \tab is found.
   1 \par \tab \tab \tab \tab is already stored.
   1 \par \tab \tab \tab \tab inverted through the RS232 link).
   1 \par \tab \tab \tab \tab invalid code (greater than 0-32).
   1 \par \tab \tab \tab \tab into NTRESF.
   1 \par \tab \tab \tab \tab into +5CE4 (see +1583).
   1 \par \tab \tab \tab \tab interrupts.
   1 \par \tab \tab \tab \tab insertion of the new space.
   1 \par \tab \tab \tab \tab insertion of the "N" channel.
   1 \par \tab \tab \tab \tab inserted.
   1 \par \tab \tab \tab \tab inserted area.
   1 \par \tab \tab \tab \tab inserted after the 2nd opening
   1 \par \tab \tab \tab \tab insert the 'end marker'.
   1 \par \tab \tab \tab \tab insert ion.
   1 \par \tab \tab \tab \tab in the buffer.
   1 \par \tab \tab \tab \tab in the buffer'-82.
   1 \par \tab \tab \tab \tab if syntax is being checked.
   1 \par \tab \tab \tab \tab have to be sent'.
   1 \par \tab \tab \tab \tab have been made).
   1 \par \tab \tab \tab \tab has been paged for the first time
   1 \par \tab \tab \tab \tab handling a 'new' array).
   1 \par \tab \tab \tab \tab from the current bit value.
   1 \par \tab \tab \tab \tab from D-STR2.
   1 \par \tab \tab \tab \tab found (or five passes of the tape
   1 \par \tab \tab \tab \tab for writing.
   1 \par \tab \tab \tab \tab for use'.
   1 \par \tab \tab \tab \tab following the string.
   1 \par \tab \tab \tab \tab followed by station number).
   1 \par \tab \tab \tab \tab flags both reset.
   1 \par \tab \tab \tab \tab finished.
   1 \par \tab \tab \tab \tab finished).
   1 \par \tab \tab \tab \tab file'.
   1 \par \tab \tab \tab \tab file' block (only with Network).
   1 \par \tab \tab \tab \tab fetched from the main ROM code.
   1 \par \tab \tab \tab \tab expression.
   1 \par \tab \tab \tab \tab expression and zero flag.
   1 \par \tab \tab \tab \tab expected. But first advance CH-ADD
   1 \par \tab \tab \tab \tab expected one.
   1 \par \tab \tab \tab \tab existing program or array) from
   1 \par \tab \tab \tab \tab exist.
   1 \par \tab \tab \tab \tab error handler to signal the error.
   1 \par \tab \tab \tab \tab error code.
   1 \par \tab \tab \tab \tab error code).
   1 \par \tab \tab \tab \tab erased).
   1 \par \tab \tab \tab \tab during syntax time.
   1 \par \tab \tab \tab \tab default
   1 \par \tab \tab \tab \tab data for other streams.
   1 \par \tab \tab \tab \tab corrupted.
   1 \par \tab \tab \tab \tab compared.
   1 \par \tab \tab \tab \tab code received.
   1 \par \tab \tab \tab \tab code after a RST\tab 8).
   1 \par \tab \tab \tab \tab cleared'.
   1 \par \tab \tab \tab \tab claimed by another Spectrum.
   1 \par \tab \tab \tab \tab channels).
   1 \par \tab \tab \tab \tab channel expression.
   1 \par \tab \tab \tab \tab channel (NCIBL=0).
   1 \par \tab \tab \tab \tab carry flags reset to signal 'end of
   1 \par \tab \tab \tab \tab byte'.
   1 \par \tab \tab \tab \tab byte counter.
   1 \par \tab \tab \tab \tab buffer (i.e. 'lower' than the current
   1 \par \tab \tab \tab \tab both ROMs.
   1 \par \tab \tab \tab \tab block has been fetched.
   1 \par \tab \tab \tab \tab between 'temporary' and 'permanent'
   1 \par \tab \tab \tab \tab been saved.
   1 \par \tab \tab \tab \tab been read.
   1 \par \tab \tab \tab \tab been fetched.
   1 \par \tab \tab \tab \tab been exchanged.
   1 \par \tab \tab \tab \tab be used. (Normally it is always reset).
   1 \par \tab \tab \tab \tab be sent.
   1 \par \tab \tab \tab \tab be reclaimed.
   1 \par \tab \tab \tab \tab be received.
   1 \par \tab \tab \tab \tab attribute.
   1 \par \tab \tab \tab \tab at the first 'paging' operation.
   1 \par \tab \tab \tab \tab array.
   1 \par \tab \tab \tab \tab array is fetched from D-STR2 area.
   1 \par \tab \tab \tab \tab area.
   1 \par \tab \tab \tab \tab area, but is actually used to update
   1 \par \tab \tab \tab \tab are out of a string).
   1 \par \tab \tab \tab \tab are correct.
   1 \par \tab \tab \tab \tab and store into HD area.
   1 \par \tab \tab \tab \tab and set L-STR1, D-STR1.
   1 \par \tab \tab \tab \tab and map address.
   1 \par \tab \tab \tab \tab and HL the start of the data block
   1 \par \tab \tab \tab \tab and 'permanent' channels is made.
   1 \par \tab \tab \tab \tab already present on cartridge.
   1 \par \tab \tab \tab \tab already held in HL.
   1 \par \tab \tab \tab \tab address following the RST 10).
   1 \par \tab \tab \tab \tab address +5CB6.
   1 \par \tab \tab \tab \tab accumulator.
   1 \par \tab \tab \tab \tab a NEW command).
   1 \par \tab \tab \tab \tab \tab transmitted.
   1 \par \tab \tab \tab \tab \tab to be updated.
   1 \par \tab \tab \tab \tab \tab response code.
   1 \par \tab \tab \tab \tab \tab no header has been found).
   1 \par \tab \tab \tab \tab \tab is not the required one.
   1 \par \tab \tab \tab \tab \tab into RD-RANDOM.
   1 \par \tab \tab \tab \tab \tab header) unless broadcasting.
   1 \par \tab \tab \tab \tab \tab header block.
   1 \par \tab \tab \tab \tab \tab goes into E.
   1 \par \tab \tab \tab \tab \tab channel.
   1 \par \tab \tab \tab \tab \tab byte reaches zero.
   1 \par \tab \tab \tab \tab \tab broadcasting).
   1 \par \tab \tab \tab \tab \tab broadcast.
   1 \par \tab \tab \tab \tab \tab be tested for 6890 T cycles.
   1 \par \tab \tab \tab \tab \tab another Spectrum.
   1 \par \tab \tab \tab \tab \tab (unless broadcasting).
   1 \par \tab \tab \tab \tab \tab (possible maps inserted).
   1 \par \tab \tab \tab \tab STRMS contents.
   1 \par \tab \tab \tab \tab STMT-R-1.
   1 \par \tab \tab \tab \tab SER-FL-hi holds a valid byte.
   1 \par \tab \tab \tab \tab SBRT area.
   1 \par \tab \tab \tab \tab RS232 link.
   1 \par \tab \tab \tab \tab ROM for the first time (i.e. after
   1 \par \tab \tab \tab \tab ROM 'MERGE' control routine.
   1 \par \tab \tab \tab \tab On entry to the shadow ROM, it is set
   1 \par \tab \tab \tab \tab Microdrive if so.
   1 \par \tab \tab \tab \tab LOAD-VERIFY-MERGE commands routine.
   1 \par \tab \tab \tab \tab L=9 (bit counter).
   1 \par \tab \tab \tab \tab First move it into HL.
   1 \par \tab \tab \tab \tab FORMAT "T".
   1 \par \tab \tab \tab \tab D-STR2 area.
   1 \par \tab \tab \tab \tab D-STR1 is in range.
   1 \par \tab \tab \tab \tab D-STR areas.
   1 \par \tab \tab \tab \tab CHANS area starts after the
   1 \par \tab \tab \tab \tab CH-ADD to the 1st char. in the line).
   1 \par \tab \tab \tab \tab A..F.
   1 \par \tab \tab \tab \tab ;code.
   1 \par \tab \tab \tab \tab 15BA above.
   1 \par \tab \tab \tab \tab 10 bytes for the current name).
   1 \par \tab \tab \tab \tab 0 of H.
   1 \par \tab \tab \tab \tab +7F (ASCII 7 bit).
   1 \par \tab \tab \tab \tab +0001 (i.e. reset stream 0 to the
   1 \par \tab \tab \tab \tab (the actual FORMAT with RS232 link).
   1 \par \tab \tab \tab \tab (separator numeric expression).
   1 \par \tab \tab \tab \tab (see 00D2).
   1 \par \tab \tab \tab \tab (or +0000 with 'NEW' array to be
   1 \par \tab \tab \tab \tab (i.e., 8 bits have been read),
   1 \par \tab \tab \tab \tab (i.e. S-STR1<>+FF).
   1 \par \tab \tab \tab \tab (i.e. 9600 baud).
   1 \par \tab \tab \tab \tab (i.e. 'bit position').
   1 \par \tab \tab \tab \tab (after a RST 20).
   1 \par \tab \tab \tab \tab (N-STR2+2) (see 14EB).
   1 \par \tab \tab \tab \tab (HD-11 is not affected).
   1 \par \tab \tab \tab \tab 'time-out'.
   1 \par \tab \tab \tab \tab 'output' routine.
   1 \par \tab \tab \tab \tab 'old' checksum.
   1 \par \tab \tab \tab \tab 'number'.
   1 \par \tab \tab \tab \tab 'number' ).
   1 \par \tab \tab \tab \tab 'new' one.
   1 \par \tab \tab \tab \tab 'free sector'.
   1 \par \tab \tab \tab \tab 'autostart'
   1 \par \tab \tab \tab \tab 'alphanumeric array'.
   1 \par \tab \tab \tab \tab 'CALL-SUB' subroutine.
   1 \par \tab \tab \tab \tab "K" channel).
   1 \par \tab \tab \tab \tab   pressed.
   1 \par \tab \tab \tab \tab   keyboard to be examined.
   1 \par \tab \tab \tab Used to save the value of HL while calling 'main'
   1 \par \tab \tab \tab ROM routines.
   1 \par \tab \tab \tab May be obtained with:
   1 \par \tab \tab \tab MERGE commands. File type, may be:
   1 \par \tab \tab \tab H-L EQU +5CBA
   1 \par \tab \tab \tab FLAGS3 may be addressed with (IY+124).
   1 \par \tab \tab \tab 5CC2 RET
   1 \par \tab \tab \tab 5CBF LD (H-L),HL
   1 \par \tab \tab \tab 5CBC CALL nnnnn
   1 \par \tab \tab \tab 5CB9 LD HL,nnnnn
   1 \par \tab \tab \tab 1..8, destination station number 0..64
   1 \par \tab \tab \tab 02 - string array\tab 03 - bytes
   1 \par \tab \tab \tab +32.
   1 \par \tab \tab \tab (3500000/(26*baud rate))-2
   1 \par \tab \tab XOR\tab A\tab ;Turn off drive motors.
   1 \par \tab \tab XOR\tab A\tab ;Disable next CR code.
   1 \par \tab \tab XOR\tab A\tab ;C1ear CHBYTE.
   1 \par \tab \tab XOR\tab A\tab  Switch off drive motor.
   1 \par \tab \tab SUB\tab B
   1 \par \tab \tab SRL\tab A\tab ;A holds the number of Kbytes left.
   1 \par \tab \tab SET\tab 0,(IY+FLAGS)\tab ;Otherwise set 'leading space' flag.
   1 \par \tab \tab SET\tab 0,(IX+CHFLAG)\tab ;Make this a 'write' file.
   1 \par \tab \tab SBC\tab HL,DE\tab ;'Trial subtraction'.
   1 \par \tab \tab SBC\tab HL,BC\tab ;Subtract 'step' from 'a'.
   1 \par \tab \tab SBC\tab HL,BC
   1 \par \tab \tab RST\tab MAIN_ROM
   1 \par \tab \tab RST\tab ERROR_1\tab ;Create new system variables if
   1 \par \tab \tab RST\tab ERROR_1
   1 \par \tab \tab RST\tab CALBAS\tab ;Use this stream.
   1 \par \tab \tab RST\tab CALBAS\tab ;Store this number on calculator stack.
   1 \par \tab \tab RST\tab CALBAS\tab ;Print the number on the screen.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch string parameters.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch stream number.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch start address.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch line number.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch address.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch 'y'.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch 'y'
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch 's'.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch 'n'.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch 'n'
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch 'd'.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch 'c'.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch 'b'.
   1 \par \tab \tab RST\tab CALBAS\tab ;Fetch 'a'.
   1 \par \tab \tab RST\tab CALBAS\tab ;Evaluste 'a','b'
   1 \par \tab \tab RST\tab CALBAS\tab ;Evaluate string expression.
   1 \par \tab \tab RST\tab CALBAS\tab ;Evaluate line number.
   1 \par \tab \tab RST\tab CALBAS\tab ;Evaluate 's','n'
   1 \par \tab \tab RST\tab CALBAS\tab ;Evaluate 'c','d'.
   1 \par \tab \tab RST\tab 8
   1 \par \tab \tab RST\tab 08
   1 \par \tab \tab RST\tab 0
   1 \par \tab \tab RET\tab Z\tab ;Return if already in place.
   1 \par \tab \tab RET\tab Z\tab ;Do not do a CR if CLRCR=0.
   1 \par \tab \tab RET\tab Z
   1 \par \tab \tab RES\tab 1,(IY+FLAGS3)\tab ;channel.
   1 \par \tab \tab RES\tab 0,(IY+FLAGS)\tab ;Clear 'leading space' flag.
   1 \par \tab \tab PUSH\tab IX\tab ;Make HL point to data block preamble.
   1 \par \tab \tab PUSH\tab IX\tab ;Make HL point to HDNANE.
   1 \par \tab \tab PUSH\tab HL\tab ;Save current address.
   1 \par \tab \tab PUSH\tab DE\tab ;Save stream data.
   1 \par \tab \tab PUSH\tab BC\tab ;Save it temporarily.
   1 \par \tab \tab PUSH\tab BC\tab ;Save counter for later,
   1 \par \tab \tab PUSH\tab BC\tab ;Save 'length' and 'start'.
   1 \par \tab \tab PUSH\tab BC\tab ;Save 'b' briefly.
   1 \par \tab \tab PUSH\tab BC\tab ;Move it into HL.
   1 \par \tab \tab PUSH\tab AF\tab ;arrays).
   1 \par \tab \tab PUSH\tab AF\tab ;Save it.
   1 \par \tab \tab PUSH\tab AF\tab ;Save it for later.
   1 \par \tab \tab POP\tab IX\tab ;Restore channel start address.
   1 \par \tab \tab POP\tab HL\tab ;Restore\tab 'a', 'b', 'c' and 'd' values.
   1 \par \tab \tab POP\tab HL\tab ;Restore string 'start' and 'length'.
   1 \par \tab \tab POP\tab HL\tab ;Restore 'a' for repetition.
   1 \par \tab \tab POP\tab HL\tab ;Finally print the 'length'.
   1 \par \tab \tab POP\tab DE\tab ;Restore values.
   1 \par \tab \tab POP\tab DE\tab ;Restore stream data.
   1 \par \tab \tab POP\tab BC\tab ;Restore value.
   1 \par \tab \tab POP\tab BC\tab ;Restore counter and address.
   1 \par \tab \tab POP\tab AF\tab ;Store record number into CHREC.
   1 \par \tab \tab POP\tab AF\tab ;Return with numeric arrays.
   1 \par \tab \tab POP\tab AF\tab ;Restore the code.
   1 \par \tab \tab OR\tab C
   1 \par \tab \tab OR\tab A\tab ;Jump with type=0 (program files).
   1 \par \tab \tab OR\tab A\tab ;Clear carry flag.
   1 \par \tab \tab OR\tab 30H\tab ;Make the counter an ASCII character
   1 \par \tab \tab OR\tab 20H\tab ;Make the letter lower case.
   1 \par \tab \tab OR\tab (HL)
   1 \par \tab \tab NEG\tab \tab ;A=number of spaces required.
   1 \par \tab \tab LD\tab SP,(ERR SP)\tab ;Clear machine stack.
   1 \par \tab \tab LD\tab L,(IX+RECLEN)\tab ;Use RECLEN as current position.
   1 \par \tab \tab LD\tab HL,STSYN\tab ;Store start address of new routine
   1 \par \tab \tab LD\tab HL,RDESC\tab ;Repeat also if loaded wrong block type
   1 \par \tab \tab LD\tab HL,RDESC\tab ;And a record descriptor from the address
   1 \par \tab \tab LD\tab HL,RDESC+4\tab ;Print record name.
   1 \par \tab \tab LD\tab HL,RDESC+3
   1 \par \tab \tab LD\tab HL,LABEL
   1 \par \tab \tab LD\tab HL,ENDED\tab ;Final return address.
   1 \par \tab \tab LD\tab HL,END1\tab ;Note how the return is made to the
   1 \par \tab \tab LD\tab HL,ED_ERROR\tab ;The new error address.
   1 \par \tab \tab LD\tab HL,5\tab ;Make HL point to 'address of output
   1 \par \tab \tab LD\tab HL,11H
   1 \par \tab \tab LD\tab HL,0FFH\tab ;Counts through 255 sectors.
   1 \par \tab \tab LD\tab HL,0FFH\tab ;Counts 255 sectors.
   1 \par \tab \tab LD\tab HL,0
   1 \par \tab \tab LD\tab HL,(POSN)\tab ;L= POSN  H= WIDTH
   1 \par \tab \tab LD\tab HL,(ERR_SP)\tab ;Save current error address.
   1 \par \tab \tab LD\tab HL,(CURCHL)
   1 \par \tab \tab LD\tab H,B\tab ;Move it into HL.
   1 \par \tab \tab LD\tab H,(IX+RECLEN+l)
   1 \par \tab \tab LD\tab E,C
   1 \par \tab \tab LD\tab DE,PAR2\tab ;Output address for next byte.
   1 \par \tab \tab LD\tab DE,PAR1\tab ;Alter output address.
   1 \par \tab \tab LD\tab DE,NRSOUT\tab ;Change this address to NRSOUT below.
   1 \par \tab \tab LD\tab DE,37H
   1 \par \tab \tab LD\tab DE,32768
   1 \par \tab \tab LD\tab DE,2CH
   1 \par \tab \tab LD\tab DE,1\tab ;Print last digit.
   1 \par \tab \tab LD\tab DE,18H\tab ;RDESC.
   1 \par \tab \tab LD\tab DE,10\tab ;Print fourth digit.
   1 \par \tab \tab LD\tab DE,100\tab ;Print third digit.
   1 \par \tab \tab LD\tab DE,1000\tab ;Print second digit.
   1 \par \tab \tab LD\tab D,B\tab ;Move address into DE.
   1 \par \tab \tab LD\tab D,(HL)
   1 \par \tab \tab LD\tab C,B
   1 \par \tab \tab LD\tab C,A\tab ;Otherwise move it into BC.
   1 \par \tab \tab LD\tab C,A\tab ;Move it into BC.
   1 \par \tab \tab LD\tab C,A
   1 \par \tab \tab LD\tab C,0
   1 \par \tab \tab LD\tab BC,8192
   1 \par \tab \tab LD\tab BC,0168H\tab ;Wait to create a first gap.
   1 \par \tab \tab LD\tab B,6\tab ;Display 6 bytes.
   1 \par \tab \tab LD\tab B,5
   1 \par \tab \tab LD\tab A,SPACE\tab ;this routine.
   1 \par \tab \tab LD\tab A,SPACE\tab ;Print a space.
   1 \par \tab \tab LD\tab A,SPACE\tab ;Follow it with a space.
   1 \par \tab \tab LD\tab A,PRINT\tab ;Otherwise print the keyword 'PRINT'.
   1 \par \tab \tab LD\tab A,L\tab ;display low byte
   1 \par \tab \tab LD\tab A,L\tab ;Display low byte.
   1 \par \tab \tab LD\tab A,LINE\tab ;Print the keyword LINE, and then
   1 \par \tab \tab LD\tab A,L
   1 \par \tab \tab LD\tab A,E
   1 \par \tab \tab LD\tab A,DATA\tab ;Print the keyword DATA.
   1 \par \tab \tab LD\tab A,CR\tab ;Finally print a carriage return.
   1 \par \tab \tab LD\tab A,COMMA\tab ;Print a comma.
   1 \par \tab \tab LD\tab A,B\tab ;Exit with null string.
   1 \par \tab \tab LD\tab A,B\tab ;Error with line number out of range.
   1 \par \tab \tab LD\tab A,3\tab ;Use stream 3.
   1 \par \tab \tab LD\tab A,3\tab ;Otherwise stream 3 reverts to "p"
   1 \par \tab \tab LD\tab A,2\tab ;Use stream 2 (screen).
   1 \par \tab \tab LD\tab A,2
   1 \par \tab \tab LD\tab A,1\tab ;Reset flag to 1 for later.
   1 \par \tab \tab LD\tab A,1\tab ;Accept next CR code.
   1 \par \tab \tab LD\tab A,0EEH\tab ;'End of writing' signal.
   1 \par \tab \tab LD\tab A,0E6H\tab ;Start writing.
   1 \par \tab \tab LD\tab A,(TVDATA+1)\tab ;Fetch column 'n'.
   1 \par \tab \tab LD\tab A,(RDESC+20)\tab ;Fetch array name.
   1 \par \tab \tab LD\tab A,(RDESC+1)\tab ;Ignore other than first records.
   1 \par \tab \tab LD\tab A,(RDESC)\tab ;This is 'RECFLG'.
   1 \par \tab \tab LD\tab A,(RDESC)\tab ;Jump forward with 'not free' sectors.
   1 \par \tab \tab LD\tab A,(POSN)
   1 \par \tab \tab LD\tab A,(LPAGE)
   1 \par \tab \tab LD\tab A,(LFEED)\tab ;Fetch LF code.
   1 \par \tab \tab LD\tab A,(IX+RECNUM)\tab ;Copy RECNUM into CHREC.
   1 \par \tab \tab LD\tab A,(IX+HDNUMB)\tab ;Store current sector number (to
   1 \par \tab \tab LD\tab A,(IX+HDNUMB)\tab ;Otherwise fetch sector number to CHREC.
   1 \par \tab \tab LD\tab A,(IX+HDNUMB)\tab ;Jump forward when the whole tape has
   1 \par \tab \tab LD\tab A,(IX+CHREC)\tab ;Jump unless first time (CHREC=0).
   1 \par \tab \tab LD\tab A,(IX+CHREC)\tab ;Continue if this is not the one.
   1 \par \tab \tab LD\tab A,(IX+CHDRIV)\tab ;The drive motor is turned on.
   1 \par \tab \tab LD\tab A,(FFC)\tab ;Fetch form feed code.
   1 \par \tab \tab LD\tab A,(CRCD)\tab ;Fetch CR code.
   1 \par \tab \tab LD\tab A,(CMMSP)
   1 \par \tab \tab LD\tab A,(CLRCR)
   1 \par \tab \tab LD\tab A,(CLINE)
   1 \par \tab \tab LD\tab A,"$"\tab ;But print '$' with string arrays.
   1 \par \tab \tab LD\tab (WIDTH),A\tab ;Store the value.
   1 \par \tab \tab LD\tab (VECTOR),HL\tab ;into VECTOR.
   1 \par \tab \tab LD\tab (POSN),A\tab ;Clear POSN.
   1 \par \tab \tab LD\tab (POSN),A
   1 \par \tab \tab LD\tab (LPAGE),A\tab ;Store it.
   1 \par \tab \tab LD\tab (IY+ERR_NR),0FFH\tab ;Clear the error.
   1 \par \tab \tab LD\tab (IX,CHBYTE),A
   1 \par \tab \tab LD\tab (IX+CHREC),A\tab ldetect when the whole tape has been
   1 \par \tab \tab LD\tab (IX+CHBYTE+1),H
   1 \par \tab \tab LD\tab (IX+CHBYTE+1),A
   1 \par \tab \tab LD\tab (IX+CHBYTE),L
   1 \par \tab \tab LD\tab (HL),E\tab ;Store new output address.
   1 \par \tab \tab LD\tab (HL),E
   1 \par \tab \tab LD\tab (HL),C\tab ;POKE the low byte.
   1 \par \tab \tab LD\tab (HL),B\tab ;POKE the high byte.
   1 \par \tab \tab LD\tab (HL),0FFH
   1 \par \tab \tab LD\tab (HD_11),HL\tab ;shadow ROM.
   1 \par \tab \tab LD\tab (FFC),A\tab ;Store it.
   1 \par \tab \tab LD\tab (E_PPC),BC\tab ;Make this line 'current'.
   1 \par \tab \tab LD\tab (ERR_SP),SP
   1 \par \tab \tab LD\tab (CURCHL),A
   1 \par \tab \tab LD\tab (CMMSP),A\tab ;Store this value.
   1 \par \tab \tab LD\tab (CLINE),A\tab ;Clear line counter.
   1 \par \tab \tab LD\tab (5CD8H),A
   1 \par \tab \tab LDIR\tab \tab ;The actual POKE.
   1 \par \tab \tab LDIR
   1 \par \tab \tab JR\tab Z,SPLOOP\tab ;continue if not.
   1 \par \tab \tab JR\tab Z,RESBIT\tab ;Jump with 'free' sectors.
   1 \par \tab \tab JR\tab Z,OUT3\tab ;jump with LPRINT ?n
   1 \par \tab \tab JR\tab Z,OUT2\tab ;Jump with LPRINT /x,y
   1 \par \tab \tab JR\tab Z,OUT1\tab ;Jump with LPRINT !x,y
   1 \par \tab \tab JR\tab Z,NXTS\tab ;the file.
   1 \par \tab \tab JR\tab Z,NEWOUT\tab ;Open new channel if n=1.
   1 \par \tab \tab JR\tab Z,ENDCAT
   1 \par \tab \tab JR\tab Z,CATLOOP
   1 \par \tab \tab JR\tab SPLOOP\tab ;Jump back.
   1 \par \tab \tab JR\tab SPLOOP\tab ;Jump back to insert the spaces.
   1 \par \tab \tab JR\tab ONESPC
   1 \par \tab \tab JR\tab NZ,SPLOOP
   1 \par \tab \tab JR\tab NZ,SLOOP
   1 \par \tab \tab JR\tab NZ,NOSPC\tab ;Jump if not a space.
   1 \par \tab \tab JR\tab NZ,NOFEED\tab ;Jump if not the end of the page.
   1 \par \tab \tab JR\tab NZ,NOCR
   1 \par \tab \tab JR\tab NZ,NOCOMMA
   1 \par \tab \tab JR\tab NZ,LOOP\tab ;examined.
   1 \par \tab \tab JR\tab NZ,L00P2\tab ;Repeat the sound until d=0.
   1 \par \tab \tab JR\tab NXTS
   1 \par \tab \tab JR\tab NC,REJECT
   1 \par \tab \tab JR\tab NC,OUTD\tab ;Continue until borrowing found.
   1 \par \tab \tab JR\tab NC,NLIN\tab ;Jump if POSN>WIDTH.
   1 \par \tab \tab JR\tab NC,NLIN\tab ;Jump if POSN>=WIDTH.
   1 \par \tab \tab JR\tab NC,LOOP1\tab ;Continue while subtraction possible.
   1 \par \tab \tab JR\tab NC,GRT\tab ;Jump if POSN>'n'.
   1 \par \tab \tab JR\tab NC,GOOD
   1 \par \tab \tab JR\tab NC,CHKPOS
   1 \par \tab \tab JR\tab ENDLI\tab ;Otherwise loop back.
   1 \par \tab \tab JR\tab CATLOOP
   1 \par \tab \tab JR\tab C,REJECT
   1 \par \tab \tab JR\tab C,NXTS\tab ;Jump with any error.
   1 \par \tab \tab JR\tab C,CTRL\tab ;than 20H.
   1 \par \tab \tab JR\tab C,CONV-1
   1 \par \tab \tab JR\tab ALTOP
   1 \par \tab \tab JR\tab AGAIN\tab ;Jump back.
   1 \par \tab \tab JR\tab ACCEPT
   1 \par \tab \tab JP\tab Z,RS\emdash SH
   1 \par \tab \tab JP\tab Z,PROG
   1 \par \tab \tab JP\tab Z,PGM9
   1 \par \tab \tab JP\tab Z,PGM8
   1 \par \tab \tab JP\tab Z,PGM7
   1 \par \tab \tab JP\tab Z,PGM6
   1 \par \tab \tab JP\tab Z,PGM5
   1 \par \tab \tab JP\tab Z,PGM3
   1 \par \tab \tab JP\tab Z,PGM1\tab ;depending on the command code.
   1 \par \tab \tab JP\tab Z,OTRNG
   1 \par \tab \tab JP\tab Z,ERR_6
   1 \par \tab \tab JP\tab Z,END1
   1 \par \tab \tab JP\tab Z,BYTES
   1 \par \tab \tab JP\tab PRCHAR\tab ;and print it.
   1 \par \tab \tab JP\tab OP_STREAM\tab ;Attach channel to a stream.
   1 \par \tab \tab JP\tab NZ,RWF\emdash ERR\tab ;writlng.
   1 \par \tab \tab JP\tab NZ,PRI_NA
   1 \par \tab \tab JP\tab NZ,PGM4
   1 \par \tab \tab JP\tab NZ,PGM2
   1 \par \tab \tab JP\tab NZ,NREPORT\emdash N
   1 \par \tab \tab JP\tab NZ,NOTPRINT\tab ;'PRINT\emdash type' file.
   1 \par \tab \tab JP\tab NZ,ERR_6\tab ;after READ.
   1 \par \tab \tab JP\tab NZ,ERR_6\tab ;Report the error if it is not present.
   1 \par \tab \tab JP\tab NZ,CATLOOP
   1 \par \tab \tab JP\tab NC, TCHAN\emdash OUT+4
   1 \par \tab \tab JP\tab GT_M_BLK\tab ;Fetch descriptor and header information.
   1 \par \tab \tab JP\tab FPRINT
   1 \par \tab \tab JP\tab ERR_6\tab ;Give an error if none of these.
   1 \par \tab \tab JP\tab ERR_6\tab ;Error if none of these.
   1 \par \tab \tab JP\tab CATLOOP\tab ;examined).
   1 \par \tab \tab JP\tab C,RS\emdash SH2\tab ;Error with wrong checksum.
   1 \par \tab \tab JP\tab C,NREPORT\emdash C\tab ;Error if stream is already opened.
   1 \par \tab \tab JP\tab 1E7F,SAVE-RUN\tab Jump forward.
   1 \par \tab \tab JP\tab 12B4H\tab ;Jump back to the main execution loop.
   1 \par \tab \tab IN\tab A,(0EFH)\tab ;Error with write\emdash protected cartridge.
   1 \par \tab \tab INC\tab L
   1 \par \tab \tab INC\tab HL\tab ;Save pointer to 'length'.
   1 \par \tab \tab INC\tab HL\tab ;Examine each byte in turn.
   1 \par \tab \tab INC\tab HL\tab ;Advance the pointer.
   1 \par \tab \tab INC\tab HL\tab ;Advance pointer.
   1 \par \tab \tab INC\tab A\tab ;Otherwise increment POSN.
   1 \par \tab \tab INC\tab A
   1 \par \tab \tab EX\tab DE,HL\tab ;Move value into DE.
   1 \par \tab \tab DJNZ\tab PRLOOP\tab ;Loop for the whole name.
   1 \par \tab \tab DJNZ\tab L_LOOP
   1 \par \tab \tab DJNZ\tab C_LOOP\tab ;Continue the toop.
   1 \par \tab \tab DEFW\tab STR_DATA1\tab ;Fetch current stream data.
   1 \par \tab \tab DEFW\tab STK_FETCH
   1 \par \tab \tab DEFW\tab STACK_A
   1 \par \tab \tab DEFW\tab PRINT_FP
   1 \par \tab \tab DEFW\tab NEXT_CHAR\tab ;Jump if the command is CAT.
   1 \par \tab \tab DEFW\tab NEXT_2NUM\tab ;Evaluate the two parameters.
   1 \par \tab \tab DEFW\tab GET_CHAR\tab ;Fetch command code.
   1 \par \tab \tab DEFW\tab FND_ NT1
   1 \par \tab \tab DEFW\tab FIND_INT2\tab ;Fetch number to be POKEd.
   1 \par \tab \tab DEFW\tab FIND_INT2\tab ;Fetch address.
   1 \par \tab \tab DEFW\tab EXPT_EXP
   1 \par \tab \tab DEFW\tab EXPT_1NUM\tab ;Evaluate stream number.
   1 \par \tab \tab DEFW\tab EXPT_1NUM\tab ;Evaluate start address.
   1 \par \tab \tab DEFW\tab EXPT_1NUM\tab ;Evaluate 'n'
   1 \par \tab \tab DEFW\tab ED_EDIT\tab ;Copies the line into the editing area.
   1 \par \tab \tab DEFW\tab CHAN_OPEN\tab ;Use this stream.
   1 \par \tab \tab DEFW\tab 1601H
   1 \par \tab \tab DEFW\tab 10H
   1 \par \tab \tab DEFB\tab HOOK32
   1 \par \tab \tab DEFB\tab HOOK31\tab ;nonexistent.
   1 \par \tab \tab DEFB\tab 20H\tab ;check keypress
   1 \par \tab \tab DEC\tab HL\tab ;Point to the low byte.
   1 \par \tab \tab DEC\tab C
   1 \par \tab \tab DEC\tab A\tab ;Save zero flag (set with numeric
   1 \par \tab \tab DEC\tab A\tab ;Range of 'x' is from 0 onwards.
   1 \par \tab \tab DEC\tab A\tab ;Decrease 'd'
   1 \par \tab \tab DEC\tab A
   1 \par \tab \tab CP\tab SPACE\tab ;Reject codes lower than SPACE.
   1 \par \tab \tab CP\tab SPACE\tab ;Jump forward with control codes lower
   1 \par \tab \tab CP\tab RESTORE
   1 \par \tab \tab CP\tab READ
   1 \par \tab \tab CP\tab POKE\tab ;Jump to the appropriate routine,
   1 \par \tab \tab CP\tab LPRINT
   1 \par \tab \tab CP\tab H
   1 \par \tab \tab CP\tab COMMA\tab ;A separator must be present.
   1 \par \tab \tab CP\tab COMMA\tab ;A separator must be found after 'b'.
   1 \par \tab \tab CP\tab CAT
   1 \par \tab \tab CP\tab BEEP
   1 \par \tab \tab CP\tab 80H\tab ;Reject codes greater than 7FH.
   1 \par \tab \tab CP\tab 3\tab ;Jump with type=3 (bytes).
   1 \par \tab \tab CP\tab 10H\tab ;Reject stream number > 15.
   1 \par \tab \tab CP\tab 10H\tab ;Give an error if 's' is greater than 15
   1 \par \tab \tab CP\tab 1
   1 \par \tab \tab CP\tab 0AH
   1 \par \tab \tab CP\tab (IX+HDNUMB)
   1 \par \tab \tab CP\tab (IX+CHREC)\tab ;been examined.
   1 \par \tab \tab CP\tab "l"\tab ;Jump if this is not an "*L" command.
   1 \par \tab \tab CP\tab "M"\tab ;Error if not an "m" channel.
   1 \par \tab \tab CP\tab "M"\tab ;Error if not an "M" channel.
   1 \par \tab \tab CP\tab "?"
   1 \par \tab \tab CP\tab "/"
   1 \par \tab \tab CP\tab "*"\tab ;The '*' must be present.
   1 \par \tab \tab CP\tab "*"\tab ;Jump if it is not a POKE *x,y command.
   1 \par \tab \tab CP\tab "*"
   1 \par \tab \tab CP\tab "#"\tab ;A hash sign must be present
   1 \par \tab \tab CP\tab "!"
   1 \par \tab \tab CALL\tab UNPAGE\tab ;Use main ROM.
   1 \par \tab \tab CALL\tab TCHAN_OUT\tab ;Use "t" channel to print it,
   1 \par \tab \tab CALL\tab ST_END\tab ;Confirm end of statement,
   1 \par \tab \tab CALL\tab SET_T_MCH\tab ;Create a temporary "m" channel.
   1 \par \tab \tab CALL\tab SEL_DRIVE\tab ;Switch off drive motor.
   1 \par \tab \tab CALL\tab RES_B_MAP\tab ;Mark 'free' this sector,
   1 \par \tab \tab CALL\tab RES_B_MAP\tab ;Mark 'free' sectors.
   1 \par \tab \tab CALL\tab RD_SECTOR\tab ;Fetch the EOF record.
   1 \par \tab \tab CALL\tab PRNANE\tab ;Print cartridge name.
   1 \par \tab \tab CALL\tab PRNAME
   1 \par \tab \tab CALL\tab PRCR\tab ;Leave a blank line.
   1 \par \tab \tab CALL\tab PRCR\tab ;Final carriage return.
   1 \par \tab \tab CALL\tab PRCHAR\tab ;the line number:
   1 \par \tab \tab CALL\tab PRCHAR\tab ;Print it.
   1 \par \tab \tab CALL\tab PRCHAR\tab ;Print array name.
   1 \par \tab \tab CALL\tab OUT_M_BUF\tab ;Erase this sector.
   1 \par \tab \tab CALL\tab OUTNAM\tab ;Examine current record.
   1 \par \tab \tab CALL\tab OP_RS_CH\tab ;Open a "t" channel.
   1 \par \tab \tab CALL\tab NRSOUT
   1 \par \tab \tab CALL\tab IN_CHK\tab ;Set 'free sector' descriptor.
   1 \par \tab \tab CALL\tab GET_R_LP\tab ;Fetch record.
   1 \par \tab \tab CALL\tab GETD
   1 \par \tab \tab CALL\tab FREESECT\tab ;Fetch number of 'free' sectors.
   1 \par \tab \tab CALL\tab FPRINT\tab ;Print the 'start'.
   1 \par \tab \tab CALL\tab EXPT_NUM\tab ;Evaluate drive number.
   1 \par \tab \tab CALL\tab ENDLI\tab ;First advance to next line.
   1 \par \tab \tab CALL\tab DISPHEX2\tab ;Display it in hex.
   1 \par \tab \tab CALL\tab DISP-NIB
   1 \par \tab \tab CALL\tab DISP-HEX
   1 \par \tab \tab CALL\tab DISP-CH
   1 \par \tab \tab CALL\tab DEL_M_BUF\tab ;Reclaim the channel.
   1 \par \tab \tab CALL\tab DELAY_BC
   1 \par \tab \tab CALL\tab CLOSE
   1 \par \tab \tab CALL\tab CHKS_HD R\tab ;Repeat until the checksum is correct.
   1 \par \tab \tab CALL\tab CHECK_M_2\tab ;Check range of drive number.
   1 \par \tab \tab CALL\tab BEEPER\tab ;Emit a sound.
   1 \par \tab \tab CALL\tab ALTOP
   1 \par \tab \tab Bit 2 is reset if the record is part of a PRINT-type file.
   1 \par \tab \tab Bit 1 is set if the record is the EOF one.
   1 \par \tab \tab Bit 0 reset indicates a 'read' channel.
   1 \par \tab \tab BIT\tab 7,(IY+PPC_HI)\tab ;Accept only as 'direct' command.
   1 \par \tab \tab BIT\tab 2,A\tab ;Jump if this is not a
   1 \par \tab \tab BIT\tab 1,(IX+RECFLG)\tab ;Jump if this is not the last record in
   1 \par \tab \tab BIT\tab 0,(IX+CHFLAG)\tab ;Error if the file is opened for
   1 \par \tab \tab BIT\tab 0,(IX+CHFLAG)\tab ;Error also with 'write' files.
   1 \par \tab \tab BIT\tab 0,(HL)\tab ;(header).
   1 \par \tab \tab AND\tab A\tab ;Reject spacing=0.
   1 \par \tab \tab AND\tab A\tab ;Give an error if c=0.
   1 \par \tab \tab AND\tab A\tab ;Give an error if b=0.
   1 \par \tab \tab AND\tab A\tab ;Check current state of CR flag.
   1 \par \tab \tab AND\tab 7FH\tab ;Clear bit 7.
   1 \par \tab \tab AND\tab 2
   1 \par \tab \tab AND\tab 1FH\tab ;Clear bit 5,6,7.
   1 \par \tab \tab AND\tab 1
   1 \par \tab \tab AND\tab 0C0H\tab ;Return if no autostart was specified.
   1 \par \tab \tab AND\tab 0C0H
   1 \par \tab \tab ADD\tab HL,DE\tab ;routine'.
   1 \par \tab \tab ADD\tab HL,DE\tab ;Balance last SBC.
   1 \par \tab \tab ADD\tab HL,BC
   1 \par \tab \tab ADD\tab A,7
   1 \par \tab \tab ADD\tab A,60H\tab ;Obtain an ASCII code.
   1 \par \tab WIDTH\tab DEFB\tab 80
   1 \par \tab SPLOOP\tab PUSH\tab BC\tab ;Print 'C' spaces by calling recursively
   1 \par \tab SLOOP\tab CALL\tab GET_M_HD02\tab ;Fetch a header block.
   1 \par \tab RESBIT\tab CALL\tab RES_B_MAP\tab ;Mark 'free' sector.
   1 \par \tab REJECT\tab LD\tab A,SPACE\tab ;Replace invalid codes with 'space'
   1 \par \tab RDESC\tab DEFB\tab l8H\tab ;Space to store record descriptor.
   1 \par \tab RANGE\tab LD\tab (IY+ERR_NR),0\tab ;Call the error handling routine.
   1 \par \tab PROG\tab LD\tab HL,RDESC+23\tab ;Fetch high byte of autostart line no.
   1 \par \tab PRNUM\tab LD\tab DE,10000\tab ;Print first digit.
   1 \par \tab PRNAME\tab LD\tab B,10\tab ;Counts ten characters.
   1 \par \tab PRLOOP\tab LD\tab A,(HL)\tab ;Fetch character,
   1 \par \tab PRI_NA\tab LD\tab A,(RDESC+4)\tab ;Ignore names starting with CHR$ 0.
   1 \par \tab PRDIG\tab LD\tab A,-1\tab ;Counter.
   1 \par \tab PRCR\tab LD\tab A,CR\tab ;Print a carriage return.
   1 \par \tab POSN\tab DEFB\tab 0
   1 \par \tab POKE 23676,INT (32000/256)
   1 \par \tab PAR2\tab LD\tab DE,NRSOUT\tab ;Restore initial output address.
   1 \par \tab PAR1\tab LD\tab (TVDATA+1),A\tab ;Store 'n'.
   1 \par \tab OUTNAM\tab LD\tab HL,SCR_CT\tab ;Suppresa scrolling.
   1 \par \tab OUTD\tab INC\tab A\tab ;Increment the counter.
   1 \par \tab OUT3\tab RST\tab CALBAS\tab ;Advance CH_ADD.
   1 \par \tab OUT2\tab RST\tab CALBAS\tab ;Evaluate 'x,y'
   1 \par \tab OUT1\tab RST\tab CALBAS\tab ;Evaluate 'x,y'.
   1 \par \tab OTRNG\tab LD\tab (IY+ERR_NR),0AH\tab ;Error if 'n' is greater than WIDTH.
   1 \par \tab ONESPC\tab INC\tab C\tab ;Increment counters.
   1 \par \tab NXTS\tab CALL\tab DEC_SECT\tab ;Continue until the whole tape has been
   1 \par \tab NRSOUT\tab CP\tab 0A5H\tab ;Use shadow ROM routine with token codes.
   1 \par \tab NOSPC\tab PUSH\tab AF\tab ;Save the code temporarily.
   1 \par \tab NOFEED\tab LD\tab (CLINE),A\tab ;Store new line number.
   1 \par \tab NOCR\tab CP\tab PRCOMMA\tab ;Jump if not a comma.
   1 \par \tab NOCOMMA\tab CP\tab TAB\tab ;Return if not the TAB code.
   1 \par \tab NLIN\tab CALL\tab ENDLI\tab ;Advance to next line.
   1 \par \tab NEWOUT\tab LD\tab A,3
   1 \par \tab MOVE "m";d;"CAT" TO "b"\tab (with RS232 printers)
   1 \par \tab MAINPG\tab EQU\tab $
   1 \par \tab L_LOOP\tab LD\tab A,(HL)\tab ;Fetch a byte.
   1 \par \tab LPAGE\tab DEFB\tab 60
   1 \par \tab LOOP\tab CALL\tab G_HD_R\tab ;Fetch header and data block.
   1 \par \tab LOOP2\tab PUSH\tab HL\tab ;Save 'a'\tab for next pass.
   1 \par \tab LOOP1\tab PUSH\tab AF\tab ;Save values.
   1 \par \tab LFEED\tab DEFB\tab 0AH
   1 \par \tab GRT\tab PUSH\tab BC
   1 \par \tab GOOD\tab LD\tab A,(POSN)
   1 \par \tab GETD\tab PUSH\tab HL\tab ;Save start address.
   1 \par \tab FFC\tab DEFB\tab 12
   1 \par \tab EXAMPLE\tab RST\tab 0008H\tab ;hook code restart
   1 \par \tab ENDLI\tab LD\tab A,1\tab ;Accept next CR code.
   1 \par \tab ENDED\tab POP\tab HL\tab ;Remove +l303 from the stack.
   1 \par \tab ENDCAT\tab PUSH\tab IX\tab ;Save channel start address.
   1 \par \tab DISP-NIB\tab AND\tab 0FH
   1 \par \tab C_LOOP\tab LD\tab A,(HL)\tab ;Fetch a byte.
   1 \par \tab CTRL\tab CP\tab CR\tab ;Jump if the code is not CR.
   1 \par \tab CRCD\tab DEFB\tab CR
   1 \par \tab CONV-1\tab ADD\tab A,30H
   1 \par \tab CMMSP\tab DEFB\tab 20
   1 \par \tab CLRCR\tab DEFB\tab 1
   1 \par \tab CLINE\tab DEFB\tab 0
   1 \par \tab CHKPOS\tab SUB\tab B\tab ;Jump if reached the correct place, or
   1 \par \tab CATLOOP\tab CALL\tab GET_M_HD02\tab ;Get a header.
   1 \par \tab BYTES\tab LD\tab A,CODE\tab ;Print the keyword CODE.
   1 \par \tab ALTOP\tab LD\tab HL,(CURCHL)
   1 \par \tab AGAIN\tab LD\tab A,H\tab ;display high byte of address in hex
   1 \par \tab AGAIN\tab LD\tab A,H\tab ;Display high byte of address in hex.
   1 \par \tab ACCEPT\tab CALL\tab DISP_CH\tab ;Print the character.
   1 \par \tab ;NOTE: Main ROM in use.
   1 \par \tab 90\tab LET a=a+l2
   1 \par \tab 90\tab IF CODE Y$<>78 AND CODE Y$<>l10 THEN GO TO 80
   1 \par \tab 90\tab IF CODE Y$<>78 AND CODE Y$<>110 THEN GO TO 80
   1 \par \tab 90\tab FOR B=1 TO 10
   1 \par \tab 90\tab CLEAR: REM The file has been cleared.
   1 \par \tab 80\tab PRINT
   1 \par \tab 80\tab INPUT "THIS IS WRONG ? (Y/N) "; LINE Y$: IF CODE Y$=80 OR CODE Y$=121 THEN PRINT "Retype from address ";A: PAUSE 100: CLS : GO TO 20
   1 \par \tab 80\tab INPUT "THIS IS WROMG ? (Y/N) ";LINE Y$: IF CODE Y$=89 OR CODE Y$=l2l THEN PRINT "Retype from address ";A: PAUSE 100: CLS: GO TO 20
   1 \par \tab 80\tab IF SGN a()-1 THEN GO TO 70
   1 \par \tab 80\tab DATA 33,0,0,17,0,128,1,0,32,237,176,199,201
   1 \par \tab 80\tab CLOSE\tab #4
   1 \par \tab 70\tab OPEN #4;"M";l;'NUMBERS"
   1 \par \tab 70\tab LET b=b+1: LET a~a-12
   1 \par \tab 70\tab FOR a=l TO 24: READ a$(a): NEXT a
   1 \par \tab 70\tab DATA 33,248,210,34,237,92,207,50,225,225
   1 \par \tab 65040:\tab 72\tab 24\tab 180\tab 0\tab 80\tab 20\tab 12\tab 60\tab 1\tab 13\tab 10\tab 0\tab 472
   1 \par \tab 65040:\tab 20\tab 12\tab 60\tab 1\tab 13\tab 10\tab 0\tab \tab \tab \tab \tab \tab 116
   1 \par \tab 65028:\tab 48\tab 5\tab 237\tab 68\tab 79\tab 24\tab 188\tab 197\tab 205\tab 111\tab 253\tab 193\tab 1608
   1 \par \tab 65028:\tab 24\tab 187\tab 197\tab 205\tab 105\tab 253\tab 193\tab 72\tab 24\tab 179\tab 0\tab 80\tab 1519
   1 \par \tab 65016:\tab 48\tab 5\tab 253\tab 54\tab 0\tab 10\tab 239\tab 58\tab 19\tab 254\tab 144\tab 200\tab 1284
   1 \par \tab 65016:\tab 10\tab 239\tab 58\tab 14\tab 254\tab 144\tab 200\tab 48\tab 5\tab 237\tab 68\tab 79\tab 1356
   1 \par \tab 65004:\tab 253\tab 205\tab 216\tab 253\tab 58\tab 15\tab 92\tab 71\tab 58\tab 20\tab 254\tab 184\tab 1679
   1 \par \tab 65004:\tab 15\tab 92\tab 71\tab 58\tab 15\tab 254\tab 184\tab 48\tab 5\tab 253\tab 54\tab 0\tab 1049
   1 \par \tab 64992:\tab 17\tab 229\tab 253\tab 24\tab 237\tab 17\tab 53\tab 253\tab 205\tab 210\tab 253\tab 58\tab 1809
   1 \par \tab 64992:\tab 114\tab 201\tab 50\tab 15\tab 92\tab 17\tab 234\tab 253\tab 24\tab 238\tab 17\tab 53\tab 1308
   1 \par \tab 64980:\tab 92\tab 1\tab 5\tab 0\tab 9\tab 115\tab 35\tab 114\tab 201\tab 50\tab 15\tab 92\tab 729
   1 \par \tab 64980:\tab 192\tab 17\tab 226\tab 253\tab 42\tab 81\tab 92\tab 6\tab 5\tab 9\tab 115\tab 35\tab 1073
   1 \par \tab 64968:\tab 62\tab 32\tab 205\tab 53\tab 253\tab 193\tab 13\tab 32\tab 246\tab 201\tab 254\tab 23\tab 1567
   1 \par \tab 64968:\tab 13\tab 32\tab 246\tab 201\tab 254\tab 23\tab 192\tab 17\tab 221\tab 253\tab 42\tab 81\tab 1575
   1 \par \tab 64956:\tab 4\tab 48\tab 251\tab 24\tab 243\tab 197\tab 62\tab 32\tab 205\tab 53\tab 253\tab 193\tab 1565
   1 \par \tab 64956:\tab 125\tab 188\tab 48\tab 167\tab 144\tab 40\tab 4\tab 48\tab 251\tab 24\tab 243\tab 197\tab 1479
   1 \par \tab 64944:\tab 33\tab 42\tab 19\tab 254\tab 58\tab 21\tab 254\tab 71\tab 14\tab 0\tab 12\tab 44\tab 822
   1 \par \tab 64944:\tab 254\tab 71\tab 14\tab 0\tab 12\tab 44\tab 125\tab 188\tab 48\tab 167\tab 144\tab 40\tab 1107
   1 \par \tab 64932:\tab 200\tab 24\tab 194\tab 254\tab 6\tab 32\tab 33\tab 42\tab 14\tab 254\tab 58\tab 16\tab 1127
   1 \par \tab 64932:\tab 167\tab 62\tab 1\tab 50\tab 24\tab 254\tab 200\tab 24\tab 194\tab 254\tab 6\tab 32\tab 1268
   1 \par \tab 64920:\tab 175\tab 50\tab 27\tab 254\tab 201\tab 254\tab 13\tab 32\tab 12\tab 58\tab 24\tab 254\tab 1354
   1 \par \tab 64920:\tab 13\tab 32\tab 12\tab 58\tab 19\tab 254\tab 167\tab 62\tab 1\tab 50\tab 19\tab 254\tab 941
   1 \par \tab 64908:\tab 254\tab 60\tab 184\tab 32\tab 0\tab 58\tab 22\tab 254\tab 167\tab 196\tab 7\tab 13\tab 1255
   1 \par \tab 64908:\tab 17\tab 254\tab 167\tab 196\tab 90\tab 12\tab 175\tab 50\tab 22\tab 254\tab 201\tab 254\tab 1692
   1 \par \tab 64896:\tab 58\tab 18\tab 254\tab 71\tab 58\tab 22\tab 254\tab 60\tab 184\tab 32\tab 8\tab 58\tab 1077
   1 \par \tab 64896:\tab 26\tab 254\tab 167\tab 196\tab 7\tab 13\tab 58\tab 23\tab 254\tab 71\tab 58\tab 27\tab 1154
   1 \par \tab 64884:\tab 61\tab 50\tab 19\tab 254\tab 58\tab 25\tab 254\tab 167\tab 196\tab 7\tab 13\tab 58\tab 1162
   1 \par \tab 64884:\tab 254\tab 167\tab 196\tab 90\tab 12\tab 58\tab 21\tab 254\tab 167\tab 196\tab 90\tab 12\tab 1517
   1 \par \tab 64872:\tab 201\tab 62\tab 1\tab 50\tab 19\tab 254\tab 61\tab 50\tab 14\tab 254\tab 58\tab 20\tab 1044
   1 \par \tab 64872:\tab 111\tab 253\tab 175\tab 50\tab 24\tab 254\tab 201\tab 62\tab 1\tab 50\tab 24\tab 254\tab 1459
   1 \par \tab 64860:\tab 60\tab 50\tab 14\tab 254\tab 201\tab 205\tab 105\tab 253\tab 175\tab 50\tab 19\tab 254\tab 1640
   1 \par \tab 64860:\tab 58\tab 19\tab 254\tab 184\tab 48\tab 5\tab 60\tab 50\tab 19\tab 254\tab 201\tab 205\tab 1357
   1 \par \tab 64848:\tab 60\tab 12\tab 58\tab 15\tab 254\tab 71\tab 58\tab 14\tab 254\tab 184\tab 48\tab 5\tab 1033
   1 \par \tab 64848:\tab 127\tab 56\tab 2\tab 62\tab 63\tab 205\tab 7\tab 13\tab 58\tab 20\tab 254\tab 71\tab 938
   1 \par \tab 64836:\tab 253\tab 203\tab 1\tab 198\tab 245\tab 62\tab 1\tab 50\tab 24\tab 254\tab 241\tab 254\tab 1786
   1 \par \tab 64836:\tab 253\tab 203\tab 1\tab 198\tab 245\tab 62\tab 1\tab 50\tab 19\tab 254\tab 241\tab 205\tab 1732
   1 \par \tab 64824:\tab 64\tab 12\tab 253\tab 203\tab 1\tab 134\tab 254\tab 32\tab 56\tab 85\tab 32\tab 4\tab 1130
   1 \par \tab 64824:\tab 62\tab 12\tab 253\tab 203\tab 1\tab 134\tab 254\tab 32\tab 56\tab 91\tab 32\tab 4\tab 1134
   1 \par \tab 64812:\tab 62\tab 3\tab 50\tab 216\tab 92\tab 209\tab 195\tab 81\tab 11\tab 254\tab 165\tab 211\tab 1548
   1 \par \tab 64812:\tab 62\tab 3\tab 50\tab 216\tab 92\tab 209\tab 195\tab 74\tab 11\tab 254\tab 165\tab 210\tab 1541
   1 \par \tab 64788:\tab 23\tab 33\tab 17\tab 0\tab 167\tab 237\tab 66\tab 218\tab 47\tab 5\tab 205\tab 23\tab 1041
   1 \par \tab 64788:\tab 23\tab 33\tab 17\tab 0\tab 167\tab 237\tab 66\tab 218\tab 47\tab 5\tab 205\tab 19\tab 1037
   1 \par \tab 64776:\tab 124\tab 142\tab 205\tab 24\tab 23\tab 195\tab 193\tab 5\tab 62\tab 3\tab 215\tab 39\tab 1230
   1 \par \tab 64776:\tab 124\tab 142\tab 205\tab 24\tab 23\tab 195\tab 193\tab 5\tab 62\tab 3\tab 215\tab 30\tab 1230
   1 \par \tab 64740:\tab 50\tab 22\tab 254\tab 215\tab 148\tab 30\tab 50\tab 23\tab 254\tab 175\tab 50\tab 27\tab 1298
   1 \par \tab 64740:\tab 50\tab 17\tab 254\tab 215\tab 148\tab 30\tab 50\tab 18\tab 254\tab 175\tab 50\tab 22\tab 1283
   1 \par \tab 64716:\tab 250\tab 253\tab 50\tab 21\tab 254\tab 215\tab 148\tab 30\tab 61\tab 50\tab 20\tab 254\tab 1606
   1 \par \tab 64716:\tab 245\tab 253\tab 50\tab 16\tab 254\tab 215\tab 148\tab 30\tab 61\tab 50\tab 15\tab 254\tab 1591
   1 \par \tab 64692:\tab 40\tab 1l\tab 254\tab 47\tab 40\tab 33\tab 254\tab 63\tab 40\tab 54\tab 195\tab 240\tab 1271
   1 \par \tab 64692:\tab 40\tab 11\tab 254\tab 47\tab 40\tab 33\tab 254\tab 63\tab 40\tab 54\tab 195\tab 240\tab 1271
   1 \par \tab 64680:\tab 175\tab 205\tab 50\tab 21\tab 195\tab 193\tab 5\tab 215\tab 32\tab 0\tab 254\tab 33\tab 1378
   1 \par \tab 64680:\tab 175\tab 205\tab 247\tab 23\tab 195\tab 193\tab 5\tab 215\tab 32\tab 0\tab 254\tab 33\tab 1577
   1 \par \tab 64668:\tab 238\tab 211\tab 239\tab 205\tab 254\tab 18\tab 221\tab 126\tab 68\tab 221\tab 119\tab 13\tab 1933
   1 \par \tab 64668:\tab 238\tab 211\tab 239\tab 205\tab 227\tab 19\tab 221\tab 126\tab 68\tab 221\tab 119\tab 13\tab 1907
   1 \par \tab 64656:\tab 24\tab 221\tab 229\tab 225\tab 11\tab 55\tab 0\tab 25\tab 205\tab 120\tab 24\tab 62\tab 1207
   1 \par \tab 64656:\tab 22\tab 221\tab 229\tab 225\tab 17\tab 55\tab 0\tab 25\tab 205\tab 179\tab 21\tab 62\tab 1261
   1 \par \tab 64644:\tab 41\tab 32\tab 245\tab 62\tab 230\tab 211\tab 239\tab 1\tab 104\tab 1\tab 205\tab 82\tab 1453
   1 \par \tab 64644:\tab 41\tab 32\tab 245\tab 62\tab 230\tab 211\tab 239\tab 1\tab 104\tab 1\tab 205\tab 250\tab 1621
   1 \par \tab 64632:\tab 198\tab 205\tab 73\tab 30\tab 205\tab 169\tab 19\tab 221\tab 126\tab 13\tab 221\tab 190\tab 1670
   1 \par \tab 64632:\tab 198\tab 205\tab 62\tab 30\tab 205\tab 196\tab 18\tab 221\tab 126\tab 13\tab 221\tab 190\tab 1685
   1 \par \tab 64608:\tab 202\tab 197\tab 26\tab 205\tab 75\tab 26\tab 218\tab 163\tab 17\tab 221\tab 110\tab 69\tab 1529
   1 \par \tab 64608:\tab 202\tab 185\tab 31\tab 205\tab 63\tab 31\tab 218\tab 126\tab 18\tab 221\tab 110\tab 69\tab 1479
   1 \par \tab 64596:\tab 205\tab 254\tab 18\tab 205\tab 18\tab 19\tab 32\tab 227\tab 219\tab 239\tab 230\tab 1\tab 1667
   1 \par \tab 64596:\tab 205\tab 227\tab 19\tab 205\tab 247\tab 19\tab 32\tab 227\tab 219\tab 239\tab 230\tab 1\tab 1870
   1 \par \tab 64584:\tab 67\tab 78\tab 49\tab 11\tab 221\tab 126\tab 41\tab 221\tab 119\tab 13\tab 24\tab 3\tab 964
   1 \par \tab 64584:\tab 67\tab 78\tab 40\tab 11\tab 221\tab 126\tab 41\tab 221\tab 119\tab 13\tab 24\tab 3\tab 964
   1 \par \tab 64572:\tab 34\tab 201\tab 92\tab 205\tab 165\tab 17\tab 56\tab 19\tab 40\tab 14\tab 221\tab 203\tab 1267
   1 \par \tab 64572:\tab 34\tab 201\tab 92\tab 205\tab 128\tab 18\tab 56\tab 19\tab 40\tab 14\tab 221\tab 203\tab 1231
   1 \par \tab 64560:\tab 194\tab 6\tab 9\tab 221\tab 126\tab 25\tab 205\tab 50\tab 21\tab 33\tab 255\tab 0\tab 1145
   1 \par \tab 64560:\tab 194\tab 2\tab 9\tab 221\tab 126\tab 25\tab 205\tab 247\tab 23\tab 33\tab 255\tab 0\tab 1340
   1 \par \tab 64548:\tab 221\tab 126\tab 4\tab 254\tab 77\tab 194\tab 45\tab 6\tab 221\tab 203\tab 24\tab 70\tab 1445
   1 \par \tab 64548:\tab 221\tab 126\tab 4\tab 254\tab 71\tab 194\tab 45\tab 6\tab 221\tab 203\tab 24\tab 70\tab 1445
   1 \par \tab 64512:\tab 221\tab 119\tab 11\tab 221\tab 119\tab 12\tab 205\tab 50\tab 21\tab 195\tab 193\tab 5\tab 1372
   1 \par \tab 64512:\tab 221\tab 119\tab 11\tab 221\tab 119\tab 12\tab 205\tab 247\tab 23\tab 195\tab 193\tab 5\tab 1571
   1 \par \tab 64500:\tab 50\tab 21\tab 33\tab 255\tab 0\tab 34\tab 201\tab 92\tab 205\tab 95\tab 18\tab 175\tab 1179
   1 \par \tab 64500:\tab 247\tab 23\tab 33\tab 255\tab 0\tab 34\tab 201\tab 92\tab 205\tab 132\tab 11\tab 175\tab 1414
   1 \par \tab 64488:\tab 70\tab 194\tab 50\tab 17\tab 241\tab 221\tab 119\tab 13\tab 221\tab 126\tab 25\tab 205\tab 1502
   1 \par \tab 64488:\tab 70\tab 194\tab 13\tab 18\tab 241\tab 221\tab 119\tab 13\tab 221\tab 126\tab 25\tab 205\tab 1466
   1 \par \tab 64440:\tab 35\tab 16\tab 249\tab 201\tab 215\tab 32\tab 8\tab 254\tab 35\tab 194\tab 240\tab 1\tab 1472
   1 \par \tab 64440:\tab 35\tab 16\tab 249\tab 201\tab 215\tab 32\tab 0\tab 254\tab 35\tab 194\tab 240\tab 1\tab 1472
   1 \par \tab 64428:\tab 113\tab 29\tab 225\tab 195\tab 112\tab 251\tab 6\tab 10\tab 126\tab 205\tab 113\tab 29\tab 1414
   1 \par \tab 64428:\tab 102\tab 29\tab 225\tab 195\tab 112\tab 251\tab 6\tab 10\tab 126\tab 205\tab 102\tab 29\tab 1392
   1 \par \tab 64416:\tab 113\tab 29\tab 35\tab 229\tab 35\tab 35\tab 205\tab 112\tab 251\tab 62\tab 44\tab 205\tab 1355
   1 \par \tab 64416:\tab 102\tab 29\tab 35\tab 229\tab 35\tab 35\tab 205\tab 112\tab 251\tab 62\tab 44\tab 205\tab 1344
   1 \par \tab 64404:\tab 82\tab 48\tab 250\tab 25\tab 246\tab 48\tab 195\tab 113\tab 29\tab 62\tab 175\tab 205\tab 1478
   1 \par \tab 64404:\tab 82\tab 48\tab 250\tab 25\tab 246\tab 48\tab 195\tab 102\tab 29\tab 62\tab 175\tab 205\tab 1467
   1 \par \tab 64380:\tab 3\tab 205\tab 143\tab 251\tab 17\tab 100\tab 0\tab 205\tab 143\tab 251\tab 17\tab 19\tab 1345
   1 \par \tab 64380:\tab 3\tab 205\tab 143\tab 251\tab 17\tab 100\tab 0\tab 205\tab 143\tab 251\tab 17\tab 10\tab 1345
   1 \par \tab 64356:\tab 32\tab 251\tab 126\tab 230\tab 192\tab 192\tab 43\tab 62\tab 202\tab 205\tab 113\tab 29\tab 1677
   1 \par \tab 64356:\tab 32\tab 251\tab 126\tab 230\tab 192\tab 192\tab 43\tab 62\tab 202\tab 205\tab 102\tab 29\tab 1668
   1 \par \tab 64344:\tab 96\tab 205\tab 113\tab 29\tab 241\tab 200\tab 62\tab 36\tab 195\tab 113\tab 29\tab 33\tab 1352
   1 \par \tab 64344:\tab 96\tab 205\tab 102\tab 29\tab 241\tab 200\tab 62\tab 36\tab 195\tab 102\tab 29\tab 33\tab 1330
   1 \par \tab 64332:\tab 245\tab 62\tab 228\tab 205\tab 113\tab 29\tab 58\tab 29\tab 251\tab 230\tab 31\tab 198\tab 1679
   1 \par \tab 64332:\tab 245\tab 62\tab 228\tab 205\tab 102\tab 29\tab 58\tab 29\tab 251\tab 230\tab 31\tab 198\tab 1668
   1 \par \tab 64308:\tab 203\tab 87\tab 194\tab 62\tab 251\tab 62\tab 245\tab 195\tab 113\tab 29\tab 33\tab 24\tab 1498
   1 \par \tab 64308:\tab 203\tab 87\tab 194\tab 62\tab 251\tab 62\tab 245\tab 195\tab 102\tab 29\tab 33\tab 24\tab 1487
   1 \par \tab 64296:\tab 251\tab 205\tab 178\tab 251\tab 62\tab 32\tab 205\tab 113\tab 29\tab 58\tab 9\tab 251\tab 1644
   1 \par \tab 64296:\tab 251\tab 205\tab 178\tab 251\tab 62\tab 32\tab 205\tab 102\tab 29\tab 58\tab 9\tab 251\tab 1633
   1 \par \tab 64260:\tab 29\tab 229\tab 195\tab 242\tab 21\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 716
   1 \par \tab 64260:\tab 29\tab 229\tab 195\tab 173\tab 24\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 0\tab 650
   1 \par \tab 64248:\tab 221\tab 225\tab 205\tab 196\tab 16\tab 195\tab 193\tab 5\tab 62\tab 13\tab 195\tab 102\tab 1628
   1 \par \tab 64248:\tab 221\tab 225\tab 205\tab 159\tab 17\tab 195\tab 193\tab 5\tab 62\tab 13\tab 195\tab 113\tab 1603
   1 \par \tab 64224:\tab 44\tab 0\tab 25\tab 205\tab 178\tab 251\tab 205\tab 0\tab 251\tab 205\tab 67\tab 29\tab 1460
   1 \par \tab 64224:\tab 44\tab 0\tab 25\tab 205\tab 178\tab 251\tab 205\tab 0\tab 251\tab 205\tab 56\tab 29\tab 1449
   1 \par \tab 64212:\tab 229\tab 175\tab 205\tab 50\tab 21\tab 205\tab 0\tab 251\tab 221\tab 229\tab 225\tab 17\tab 1828
   1 \par \tab 64212:\tab 229\tab 175\tab 205\tab 247\tab 23\tab 205\tab 0\tab 251\tab 221\tab 229\tab 225\tab 17\tab 2027
   1 \par \tab 64164:\tab 205\tab 254\tab 18\tab 24\tab 215\tab 58\tab 13\tab 251\tab 183\tab 40\tab 209\tab 58\tab 1528
   1 \par \tab 64164:\tab 205\tab 227\tab 19\tab 24\tab 215\tab 58\tab 13\tab 251\tab 183\tab 40\tab 209\tab 58\tab 1502
   1 \par \tab 64140:\tab 205\tab 65\tab 19\tab 32\tab 239\tab 33\tab 9\tab 251\tab 203\tab 78\tab 32\tab 232\tab 1390
   1 \par \tab 64140:\tab 205\tab 38\tab 20\tab 32\tab 239\tab 33\tab 9\tab 251\tab 203\tab 70\tab 32\tab 232\tab 1364
   1 \par \tab 64128:\tab 205\tab 196\tab 18\tab 33\tab 9\tab 251\tab 17\tab 24\tab 0\tab 205\tab 5\tab 251\tab 1214
   1 \par \tab 64128:\tab 205\tab 169\tab 19\tab 33\tab 9\tab 251\tab 17\tab 24\tab 0\tab 205\tab 5\tab 251\tab 1188
   1 \par \tab 64116:\tab 215\tab 1\tab 22\tab 205\tab 232\tab 15\tab 221\tab 126\tab 25\tab 205\tab 247\tab 23\tab 1537
   1 \par \tab 64116:\tab 215\tab 1\tab 22\tab 205\tab 165\tab 16\tab 221\tab 126\tab 25\tab 205\tab 50\tab 21\tab 1272
   1 \par \tab 64092:\tab 34\tab 237\tab 92\tab 207\tab 50\tab 253\tab 54\tab 0\tab 0\tab 239\tab 215\tab 32\tab 1413
   1 \par \tab 64092:\tab 34\tab 237\tab 92\tab 207\tab 50\tab 253\tab 54\tab 0\tab 0\tab 239\tab 215\tab 32 \tab 1413
   1 \par \tab 63936:\tab 205\tab 248\tab 20\tab 24\tab 202\tab 254\tab 101\tab 194\tab 240\tab 1\tab 215\tab 32\tab 1736
   1 \par \tab 63936:\tab 205\tab 169\tab 30\tab 24\tab 202\tab 254\tab 101\tab 194\tab 240\tab 1\tab 215\tab 32\tab 1667
   1 \par \tab 63924:\tab 24\tab 2\tab 62\tab 32\tab 205\tab 248\tab 20\tab 35\tab 16\tab 235\tab 62\tab 13\tab 954
   1 \par \tab 63924:\tab 24\tab 2\tab 62\tab 32\tab 205\tab 169\tab 30\tab 35\tab 16\tab 235\tab 62\tab 13\tab 885
   1 \par \tab 63900:\tab 229\tab 6\tab 6\tab 197\tab 126\tab 205\tab 237\tab 20\tab 35\tab 16\tab 249\tab 193\tab 1519
   1 \par \tab 63900:\tab 229\tab 6\tab 6\tab 197\tab 126\tab 205\tab 158\tab 30\tab 35\tab 16\tab 249\tab 193\tab 1450
   1 \par \tab 63888:\tab 205\tab 214\tab 20\tab 125\tab 205\tab 214\tab 20\tab 62\tab 32\tab 205\tab 248\tab 20\tab 1570
   1 \par \tab 63888:\tab 205\tab 135\tab 30\tab 125\tab 205\tab 135\tab 30\tab 62\tab 32\tab 205\tab 169\tab 30\tab 1363
   1 \par \tab 63840:\tab 213\tab 215\tab 153\tab 30\tab 80\tab 89\tab 225\tab 193\tab 120\tab 177\tab 202\tab 193\tab 1890
   1 \par \tab 63840:\tab 213\tab 215\tab 153\tab 30\tab 80\tab 89\tab 223\tab 193\tab 120\tab 177\tab 202\tab 193\tab 1890
   1 \par \tab 63756:\tab 254\tab 244\tab 202\tab 45\tab 249\tab 254\tab 42\tab 202\tab 114\tab 249\tab 254\tab 215\tab 2384
   1 \par \tab 63756:\tab 254\tab 244\tab 202\tab 45\tab 249\tab 254\tab 42\tab 202\tab 114\tab 249\tab 254\tab 215\tab 2324
   1 \par \tab 60\tab RAND USR 54000
   1 \par \tab 60\tab PRINT '"READING THE FILE"
   1 \par \tab 60\tab OPEN #4;"M";1;"FILE"
   1 \par \tab 60\tab LET a=i+60: LET b=-6
   1 \par \tab 60\tab GO TO 10
   1 \par \tab 50\tab NEXT X
   1 \par \tab 50\tab LET pk=(pi*.0577622606)+1
   1 \par \tab 50\tab LET Z=A+B-1: IF Z<=65051 THEN INPUT X: PRINT X: POKE Z,X: LET C=C+X
   1 \par \tab 50\tab LET Z=A+B-1: IF Z<=65046 THEN INPUT X: PRINT X: POKE Z,X: LET =C+X
   1 \par \tab 50\tab DATA "THE NETWORK", "enables you and your friends to play computer games together", "and to send each other programs and data.",
   1 \par \tab 50\tab CLOSE #4
   1 \par \tab 50\tab BEEP *a,b,c,d
   1 \par \tab 40\tab POKE X,Y
   1 \par \tab 40\tab NEXT N
   1 \par \tab 40\tab LET i=INT p: LET pi=p-i
   1 \par \tab 40\tab LET d=RND*3+1
   1 \par \tab 40\tab FOR B=l TO 12
   1 \par \tab 40\tab FOR B=1 TO 12
   1 \par \tab 40\tab 
   1 \par \tab 31H - Creates the new system variables used by the Interface 1. This happens when the system is powered up, and when NEW is typed, but it also can be done manually.
   1 \par \tab 30\tab READ Y
   1 \par \tab 30\tab PRINT #4;N'N*N
   1 \par \tab 30\tab LET c=RND*50+1
   1 \par \tab 30\tab INPUT "PITCH ? ";p
   1 \par \tab 30\tab 
   1 \par \tab 30H - Sends a packet over a network channel.
   1 \par \tab 2FH - Fetches a 'packet' of information from a network channel.
   1 \par \tab 2EH - Closes a network channel.
   1 \par \tab 2CH - Reclaims the memory used by a Microdrive channel.
   1 \par \tab 2BH - Due to a programming error, this has the same effect as 'create channel' in the first issue ROM. This should be corrected in later issues.
   1 \par \tab 2AH - Writes a record to a specified sector of tape.
   1 \par \tab 29H - Reads the record from the next sector of tape that passes under the read head of the Microdrive.
   1 \par \tab 28H - Reads a record from a specified sector of tape.
   1 \par \tab 27H - Read random. Similar to 'read sequential', except that the record read need not be the next one in the file.
   1 \par \tab 26H - Write record. Writes a new record onto the next free sector of a microdrive cartridge.
   1 \par \tab 260\tab CLOSE\tab #4
   1 \par \tab 25H - Read sequential. Allows the user to fetch the 'next' record of a named file.
   1 \par \tab 250\tab NEXT B
   1 \par \tab 24H - Delete file. Used to erase a named file from a Microdrive channel.
   1 \par \tab 240\tab PRINT "THE SQUARE OF ";M;" IS ";N
   1 \par \tab 23H - Close channel. The Microdrive channel is reclaimed.
   1 \par \tab 230\tab INPUT #4;M;N
   1 \par \tab 22H - Open channel. Allows the user to create a microdrive channel.
   1 \par \tab 220\tab FOR B=l TO 20
   1 \par \tab 210\tab PRINT
   1 \par \tab 20\tab REM Some data for the file
   1 \par \tab 20\tab PRINT "ADDRESS:";A''
   1 \par \tab 20\tab PRINT "ADDRESS:";A'
   1 \par \tab 20\tab LET b=RND*6+1
   1 \par \tab 20\tab INPUT "TIME (SEC.) ? ";t
   1 \par \tab 20\tab FOR X=54000 TO 54022
   1 \par \tab 20\tab FOR N=1 TO 10
   1 \par \tab 20H - Tests for keypress.
   1 \par \tab 200\tab OPEN #4;"M";1;"NUMBERS"
   1 \par \tab 1FH - A character is output to stream 3, which is normally the ZX printer.
   1 \par \tab 1EH - Sends a byte of data to the RS\emdash 232 link.
   1 \par \tab 1DH - Accepts a byte of data from the RS\emdash 232 link.
   1 \par \tab 1CH - A character is output to stream 2, which is normally the upper part of the screen.
   1 \par \tab 190\tab PRINT '"READING EXTENDED FILE"
   1 \par \tab 180\tab CLOSE #4
   1 \par \tab 170\tab NEXT N
   1 \par \tab 160\tab PRINT #4;N'N*N
   1 \par \tab 160\tab PAUSE 0: GO TO 110
   1 \par \tab 150\tab FOR N=11 TO 20
   1 \par \tab 150\tab CLS: FOR a=1 TO 8: INPUT #4;a$: PRINT a$: NEXT a
   1 \par \tab 140\tab RESTORE #4
   1 \par \tab 140\tab READ #4,VAL a$
   1 \par \tab 130\tab PRINT '"EXTENDING THE FILE"
   1 \par \tab 130\tab IF a$="3" THEN CLOSE #4: STOP
   1 \par \tab 120\tab SAVE *"M";l;"SHADP" CODE 63744,1308
   1 \par \tab 120\tab SAVE *"M";1;"SHADP"CODE 63744,1303
   1 \par \tab 120\tab PRINT "A=";INT (437500/f-30.125)'"B=";INT (f*t)
   1 \par \tab 120\tab PAUSE 0: LET a$=INKEY$; IF a$<"0" OR a$>"3" THEN GO TO 110
   1 \par \tab 120\tab NEXT B
   1 \par \tab 110\tab PRINT "THE SQUARE OF ";M;" IS ";N
   1 \par \tab 110\tab PRINT "Saving the program"
   1 \par \tab 110\tab PRINT "SAVING THE PROGRAM"
   1 \par \tab 110\tab LET f=(pk*c)*2-b: IF f*t=0 THEN PRINT "ERROR": STOP
   1 \par \tab 110\tab CLS: PRINT "Press a key for your choice: "''"0. MICRODRIVES"''"l. CARTRIDGES"''"2. NETWORK"''"3. STOP"
   1 \par \tab 10\tab OPEN #4;"M";1;"NUMBERS"
   1 \par \tab 10\tab FOR A=63744 TO 65951 STEP 12
   1 \par \tab 10\tab FOR A=63744 TO 65046 STEP 12
   1 \par \tab 100\tab RESTORE: FOR x=0 TO a: READ c: NEXT x
   1 \par \tab 100\tab OPEN #4;"M";1;"FILE"
   1 \par \tab 100\tab INPUT #4;M;N
   1 \par \tab 02D5 42 41 53 49 43 02 BASIC
   1 \par \tab 02CF 73 65 20 69 6E 20 se in
   1 \par \tab 02C9 41 6F 6E 73 65 6E Nonsen
   1 \par \tab 02C3 69 73 68 65 64 01 ished
   1 \par \tab 02BD 61 6D 20 66 69 6E am fin
   1 \par \tab - zero set, carry reset\tab The sector is unused.
   1 \par \tab - zero reset, carry reset\tab Successful loading.
   1 \par \tab - carry set\tab \tab With any error.
   1 \par \tab - bit 2 of RECFLG\tab set with PRINT-type files.
   1 \par \tab - bit 1 of RECFLG\tab set with EOF block.
   1 \par \tab - bit 0 of CHFLAG\tab set with 'write' files.
   1 \par \tab (frequency=Hz, time=sec.)
   1 \par \tab  \tab descriptor.
   1 \par \tab            ....
   1 \par \tab 
   1 \par \page USE OF HOOK CODES
   1 \par \page Pseudo-random file handling: READ #S,N
   1 \par \page Pokeing strings into memory: POKE n,"s"
   1 \par \page Modified EDIT function: *E n
   1 \par \page Memorydump:\tab *L n
   1 \par \page Main program
   1 \par \page Here is the data for the new Shadow ROM:
   1 \par \page Extending the RS-232 channel
   1 \par \page EXTENSIONS TO BASIC
   1 \par \page Basic loader program
   1 \par \page An improved sound command: BEEP *a,b,c,d
   1 \par \page Adding data to a file: RESTORE #S
   1 \par \page APPENDIX 9
   1 \par \page APPENDIX 7
   1 \par \page APPENDIX 6
   1 \par \page A simple 'double POKE' routine: Poke * x,y
   1 \par \page A faster and more complete catalogue:* CAT n
   1 \par \lquote Shadow\rquote  system variables
   1 \par You should note that variable line width is allowed by POKEing the required value into the location 23729; the default value is 80.
   1 \par You may also use the following BASIC program which calculates the values for A and B, starting from the 'x', 'y' values used in a normal BEEP command. For example, the sound obtained with BEEP 0.01,10 requires '908' and '4' as A and B 
   1 \par X2\tab 23768 5CD0\tab NTNUMB\tab Current packet block number (0..65535).
   1 \par X2\tab 23735 5CB7\tab VECTOR\tab Normally points to +01F0 (ERR-6). You may modify this
   1 \par X1\tab 23763 5CD3\tab NTLEN\tab Length of the data block being received, 1..255.
   1 \par X1\tab 23734 5CB6\tab FLAGS3\tab Various flags:
   1 \par X10\tab 23737 5CB9\tab SBRT\tab ROM paging subroutine as follows:
   1 \par Without the READ #S,N command you have to read sequentially all items before reaching the desired one.
   1 \par Will list the contents of the memory starting from address 31920. Note that when dumping memory at addresses lower than 16384, the 'shadow' ROM code is shown. Try for example to dump from the address 695, that is the start of the 'shadow 
   1 \par Will POKE the ASCII values of the characters in the string "FRED BLOGGS", starting from the address 30000. You may check this by reading back the values with PEEK:
   1 \par While the disassembly of the ROM given here will be a valuable aid to machine code programmers wishing to use the Interface I, there is one prob
   1 \par While the 'shadow' ROM is paged-in, the keyboard is not scanned.
   1 \par While 'sending', the bytes 11.18 form the 'header block' (to be stored into the system variables NTDEST...NTCHS of the receiving Spectrum). Bytes 21..275 form the 'data block'.
   1 \par Whenever a 'filename' is to be compared against the channel name CHNAME, this subroutine is called. On entry, HL must point to the filename to be compared, while C must contain its length. If the comparison is successful, the zero flag is returned set.
   1 \par Whenever BREAK is pressed during an I/O operation, the interrupts have to be enabled, the border colour to be restored and the error "BREAK into program" to be given.
   1 \par When you have finished typing this program into your Spectrum, you should 'RUN' it. You should then type from the listing on the next page, the 12 bytes from the address shown on the screen. When you have typed the first 12 bytes, a 'checksum' should be d
   1 \par When you have finished typing this program into the Spectrum, you should 'RUN' it. You should then type, from the listing on the next page, the 12 bytes from the address shown on the screen. When you have typed the first 12 bytes, a 'checksum' shoul
   1 \par When the character has been read from the required channel, a return is made here to add the character to the INPUT line, or to return if the character is ENTER.
   1 \par When the SCOUT has been identifIed, the routine waits until it is finished.
   1 \par When all numbers have been entered, the program will automatically be saved on Microdrive cartridge (there must be a cartridge with at least 2K free into Microdrive 1). IF you wish to sav
   1 \par When all numbers have been entered, the program will automatically be saved on Microdrive cartridge (there must be a cartridge with at least 2K free in Microdrive 1). If you wish to save the program on tape, line 120 of the listing sh
   1 \par When a map has been deleted, the addresses of the other 'higher' maps have to be updated. The 'REST-MAP' subroutine does this. HL should hold on entry the address of the deleted map.
   1 \par We should first consider the workings of the Spectrums syntax checking routine. When the syntax checker detects an error in a statement, either as it 
   1 \par WTKEY\tab 19DE\tab  
   1 \par WT-SCOUT\tab 0FD6\tab WT-SYNC\tab 0FED\tab WTKEY\tab 1ED2
   1 \par WR-SECTOR\tab 1A91\tab WRITE-PRC\tab 120D\tab WT-SCOUT\tab 0F1E\tab WT-SYNC\tab 0F35
   1 \par WR-S-3\tab 1FBB\tab WR-SECTOR\tab 1F85\tab WRITE-PRC\tab 12EE\tab WT-SC-E\tab 0FD3
   1 \par WR-RECD\tab 11FF\tab WR-S-1\tab 1AAD\tab WR-S-2\tab 1ABF\tab WR-S-3\tab 1AC7
   1 \par WR-F-TEST\tab 1BAB\tab WR-RECD\tab 12DA\tab WR-S-1\tab 1FA1\tab WR-S-2\tab 1FB3
   1 \par WR-BLK\tab 16AF\tab WR-BYT-1\tab 16C4\tab WR-BYT-2\tab 16C8\tab WR-BYT-3\tab 16CD
   1 \par VR-DATA\tab 0803\tab WAIT-1\tab 0BF0\tab WAIT-2\tab 0BF1\tab WR-F-TEST\tab 1BD6
   1 \par VR-BN\tab 0A8E\tab VR-DATA\tab 0803\tab WAIT-1\tab 0BEE\tab WAIT-2\tab 0BEF
   1 \par VECTOR\tab EQU\tab 5CB7H
   1 \par VE-FAIL\tab 1664\tab VE-M-E\tab 1658\tab VERIF-SYN\tab 089E\tab VR-BN\tab 0A8A
   1 \par VAR~EXIST\tab 023D\tab VE-FAIL\tab 1A55\tab VE-M-E\tab 1A49\tab VERIFSYN\tab 08A2
   1 \par Use the 'main' ROM error handler only if bit 2 of FLAGS3 is set.
   1 \par USE-C-RC\tab 1A63\tab USE-R\tab 1495\tab USE-REC\tab 15DF\tab VAR-EXIST\tab 0235
   1 \par USE OF HOOK CODES
   1 \par UPD-STRM\tab 1787\tab USE-C-RC\tab 1F57\tab USE-R\tab 1899\tab USE-REC\tab 19D0
   1 \par UNTILFIVE\tab 1673\tab UPD-NXT-S\tab 17A4\tab UPD-POINT\tab 1384\tab UPD-STRM\tab 1789
   1 \par UNTIL-MK\tab 106B\tab UNTILFIVE\tab 1A64\tab UPD-NXT-S\tab 17A2\tab UPD-POINT\tab 1469
   1 \par UNPAGE\tab EQU\tab 0700H
   1 \par UNKN-9\tab 1976\tab UNPAGE\tab 0700\tab UNT-MARK\tab 0FD2\tab UNTIL-MK\tab 0FAE
   1 \par UNKN-5\tab 1959\tab UNKN-6\tab 1961\tab UNKN-7\tab 1968\tab UNKN-8\tab 196C
   1 \par UNKN-1\tab 1902\tab UNKN-2\tab 191C\tab UNKN-3\tab 1929\tab UNKN-4\tab 1952
   1 \par To page the main ROM back in, simply do CALL 0700H
   1 \par To do the same thing from BASIC:
   1 \par To do the same thing from BASIC, use the following program:
   1 \par To add the extended BASIC commands to your Spectrum, if you own an edition 2 Shadow ROM and an assembler, first enter the assembly program on pages 12 to 32 into your Spect
   1 \par Time first command is LPRINT ? n. If n=1, a new RS232 channel is opened, so subsequent LPRINT and LLIST commands will use this for their outputs. If n=0, the "p" channel is defaulted for the LPRINT and LLIST Commands (the ZX Printer).
   1 \par This wont work as it stands, as it includes a call to the Shadow ROM routine DISP-HEX, and the address given for DISP-HEX in the table of EQU statements will not be correct. What you should do to make this work is to remove the entry for DISP-HEX from the
   1 \par This very important subroutine sets a temporary "M" channel in the CHANS area; the Microdrive map is created unless it already exists (if another channel refers to the same drive). The subroutine returns with the IX register pointing to the start of the c
   1 \par This very important subroutine is called to evaluate the syntax of the SAVE, LOAD, VERIFY and MERGE commands referred to the 'new' channels. The subroutine is entered with CH-ADD pointing to the command code; on exit during runtime the variables D-STR1, L
   1 \par This time, the interpreter syntax is failed by starting the command with a non\emdash standard character, namely, a '*'. The letter 'L' (for 'L'ist) maybe either upper or lower case.
   1 \par This table contains the default values of all the 'new' system variables from FLAGS3 to SER-FL.
   1 \par This subroutine, called from LV-MCH above, simply copies the '32' bytes that form the Microdrive map into the machine stack.
   1 \par This subroutine simply calls SEND-PACK below. If broadcasting, a certain delay is to be inserted after having sent the packet.
   1 \par This subroutine returns when the network is considered to be 'resting', i.e. when the network line is inactive for 3-4 ms. The exact time is 'randomised' as to prevent Spectrums from claiming the network at the same time.
   1 \par This subroutine prints on the screen the character held in the accumulator. All registers are preserved.
   1 \par This subroutine performs the actual LOAD or VERIFY operation. It is entered with HL holding the data start address, and with DE holding the address from which the data have to be loaded or verified.
   1 \par This subroutine performs exactly the same task as the EX-D-STR subroutine at 059F, even if it is slightly different. The D-STR1 area is copied into the
   1 \par This subroutine opens a permanent "B" or "T" channel (depending upon the specifier held in L-STR1) at the end of the CHANS area. On return, the DE
   1 \par This subroutine makes a CATalogue of the cartridge inserted in the drive whose number must be specified by D-STR1. S-STR1 must hold the stream to which the catalogue is to be directed.
   1 \par This subroutine is used whenever the remaining buffer contents of the current  "n" channel have to be sent as the "end of file" block.
   1 \par This subroutine is used whenever the border colour has been changed to IOBORD during an I/O operation, and needs to be restored to its original state.
   1 \par This subroutine is used whenever a single numeric expression is to be evaluated. The result is returned during runtime into the BC register pair and into the\line D-STR1 system variable.
   1 \par This subroutine is used to reset the bit in the map area corresponding to the sector HDNUMB.
   1 \par This subroutine is used to load a record of a 'PRINT-type file. The number of the wanted record must be stored into CHREC, the drive number into CHDRIV and the filename into CHNAME. If
   1 \par This subroutine is used to identify a SCOUT leader from the network. This is done by checking the network line for about 7000 T cycles, to prove whether it is resting. After this, the networ
   1 \par This subroutine is used to fetch a header from the current Microdrive unit (whose motor must be turned on). The header is loaded into HDFLG...HDCHK. The procedure is repeated unless the checksum is correct.
   1 \par This subroutine is used to deck the syntax of the MOVE Command. If the 'current' character is a hash sign (#), then a stream number is evaluated and stored into
   1 \par This subroutine is used to collect the first nine bytes of the file into the "m" channel buffer, i.e. the 'header information' when handling files which have been written using the SAVE command (see 08C8). These bytes are copied into the HD system variabl
   1 \par This subroutine is used to collect from the selected Hicrodrive unit a header followed by its data block. Note that the drive motor is to be turned on before calling G-HD-RC. The flags returned denote the following states:
   1 \par This subroutine is used to check whether the currently used Microdrive unit contains a full cartridge, with no 'free tot use' sectors. The zero flag is returned set if the cartridge is full (i.e. if all map bits are set).
   1 \par This subroutine is used to LOAD or VERIFY (depending upon the state of bit 7 of FLAGS3 system variable) a block of bytes. It must be entered with the 'start' and the 'length' in the HL and DE register pairs, and with all system variables properly set.
   1 \par This subroutine is used to 
   1 \par This subroutine is used from the MOVE command routine above to fetch the start address of the channel attached to a stream (if the command is of the type 'MOVE #N TO ...' ), or to open a temporary channel and fetch its start address if the 
   1 \par This subroutine is used from the FORMAT and ERASE coamnand routines to fetch from the current Microdrive unit the record descriptor held in the current sector (i.e. RECFLG...DESCHK). The zero flag is returned reset with any error.
   1 \par This subroutine is used for writing a block of bytes onto a Microdrive cartridge. On entry, HL must hold the start of the block to be written. The block is then sent to the Interface (provided that the write-protect tab is present) in a parallel form (the
   1 \par This subroutine is entered with BC holding the length of a reclaime
   1 \par This subroutine is called to reclaim from the CHANS area all 'temporary' channels (i.e. with bit 7 of channel specifier set). Also the drive motors are turned off. The routine is always called when any error report occurs, and on some other occasions.
   1 \par This subroutine is called to insert delays in the program execution, depending upon the value of BC. The exact delay is (BC * 26 - 43) T cycles.
   1 \par This subroutine is called to calculate the number of 'free sectors' (I...> bits reset in the map). The number is returned in the I register.
   1 \par This subroutine is called from the FORMAT and ERASE command routines to mark the current record descriptor as 'free sector' identifier.
   1 \par This subroutine is called from the 'LOAD OR VERIFY' subroutine (see 0A66) to load or verify (depending upon the state of bit 7 of FLAGS3) a block of bytes in memory, starting from the address held in the HL register pair. The subroutine 
   1 \par This subroutine is called from RD-SECTOR and RD-NEXT subroutines to clear the data received into the "m" buffer, if they are not part of a PRINT-type file.
   1 \par This subroutine is called by using hook code +1F. This is identical to the preceding one, but the output is directed to the stream +03 (normally the ZX 
   1 \par This subroutine is called by using 'hook code' +27. The record number CHREC of a PRINT-type file is loaded into the data block. The other variables are to be set as for READ-SEQ above.
   1 \par This subroutine is called by using 'hook code' +1C. The character held in the A register is printed on the screen, with scroll suppressed.
   1 \par This subroutine is called by using 'hook code' +1B. It simply waits until a key is pressed and returns the character code in the A register. This 'hook code' has been included because the keyboard is not scanned when the main ROM is paged-in.
   1 \par This subroutine is apparently equal to the CHECK-MAP subroutine at 12DA, however it does not refer to the standard map, but to a 'pseudo-map' set up in the 512-byte buffer of the "m" channel. This map is used from the ERASE command to mark the sectors to 
   1 \par This subroutine is also\tab called by using 'hook code' +30. It sends over the network a SCOUT leader,\tab 
   1 \par This subroutine is also called by using the hook code +1D; it always returns
   1 \par This subroutine is also called by using the 'hook code' +2D. It simply opens a permanent 'n' channel, and then makes it "temporary" by se
   1 \par This subroutine is also called by using hook code +26. The record held in the "m" channel pointed by the IX register (with name CHNAME and number CHREC), is written into the first unused sector in the cartridge inserted in the drive CHDRIV. Then the appro
   1 \par This subroutine is also called by using 'hook code' +21. On entry, A must hold a drive number in the range 1. .8; the appropriate drive motor is turned on, and an error occurs if the specified drive is not present (or if it contains no cartridge, or 
   1 \par This subroutine is actually made by a single RET instruction, but the hardware detects that the Program Counter reaches the address +0700 and pages-in the 'main' ROM.
   1 \par This subroutine inserts a delay of about 3600 T cycles. It is called from
   1 \par This subroutine exchanges the contents of D-STR1 area with those of the D-STR2 area and vice-versa.
   1 \par This subroutine displays the values of the ten bytes from the location passed in the HL register. Again all registers are preserved.
   1 \par This subroutine checks the state of the network and returns with carry reset if it is inactive for a 'sufficient' time determined by the value passed to the B register ((B * 54) - 22) T cycles).
   1 \par This subroutine calls the OUTPAK subroutine to send over the network the block of bytes starting from (HL), and whose length is held into the E register. Then a 'response byte' is to be received into the NTRESP system variable
   1 \par This subroutine adds to the tests performed by the previous one, also a check to N-STR1-hi, that holds +FF when no filename has been evaluated.
   1 \par This subroutine CLOSEs a 'PRINT-type' "m" channel. If the channel is used for reading, then it is reclaimed; but if it is used for writing, any unsent data in the buffer is written onto the Microdrive cartridge before reclaiming the channel. The entry poi
   1 \par This subroutine (also called by using 'hook code' +2C) is used to reclaim the "m" channel pointed by the IX index register. Any stream attached to this channel will be closed, and other 'dynamic' areas updated. The map is also reclaimed, unless it is used
   1 \par This short subroutine is frequently called to decrease the content of the system variable SECTOR, used to count a given number of sectors during microdrive operations. The zero flag is returned set when SECTOR reaches zero.
   1 \par This short subroutine is called several times to see if the character held in the accumulator is a valid separator (i.e. a comma or a semicolon). A return with the Zero flag reset is made if the character is not a separator.
   1 \par This short subroutine inserts a delay of about 40 msec. when it is called. Its task is that of separating outputs during 'broadcasts' transmissions.
   1 \par This section of the book shows how to add a number of new commands to the Spectrums BASIC. Those with no knowledge of machine code, or simply no interest in it can simply type the routines that follow into their Spectrums, save them 
   1 \par This routine, called in the format 'CALL ERR-RS / DEFB nn' emulates the sequence 'RST 8 / DEFB nn' that is used (when the main ROM is paged in) to give an error report. ERR-RS is never called from the shadow ROM code.
   1 \par This routine uses the SBRT area to call the required routine in the 'main' ROM.
   1 \par This routine simply checks that D-STR1 holds a valid baud rate (i.e. it is not set to +FFFF). Any value below +FFFF is accepted (but later rounded to the nearest 'standard' value).
   1 \par This routine must be entered with the error code in (ERR-NR), and has the same effect as the 'main' ROM 'ERROR' restart.
   1 \par This routine is very similar to 'MAIN-3' (+1303) in the 'main' ROM, but the
   1 \par This routine is used to create the 'new' system variables if nonexistent and it is called from the restart 0030. Many variables are initialised to its default value.
   1 \par This routine is used to calculate HDCHK, DESCHK and DCHK checksums, or to compare the previous checksum against the current one; the zero flag is returned set if the checksums match. The entry point is CHKS-HD-R for HDCHK or DESCHK, or CHKS-BUFF for 
   1 \par This routine is the actual OPEN command referred to the network. It is called from the 'OPEN' command syntax routine to attach a permanent "n" channel to a stream.
   1 \par This routine is entered with a baud rate in the range 0. .65534 in the system
   1 \par This routine is entered from 00EB with the A register holding a 'hook code', or an invalid error code. The routine calls a set of subroutines in the shadow ROM, and is intended to help the machine-code user. Only the value held in the accumulator may be p
   1 \par This routine is called from ST-SHADOW at 0008 when the shadow ROM is paged-in. It has 3 main tasks:
   1 \par This routine has the tasks of both 'syntax checking' and 'execution'. During runtime, ATTR-P, ATTR-T, MASK-P, MASK-T, P-FLAG and BORDCR system variables are reset to the 'initiaP value (as after a NEW command).
   1 \par This routine deals with OPEN #s;"m";n;"name" - OPEN #s;"b" - OPEN #s;"t" -
   1 \par This routine creates three new commmands for time user who has an RS232 printer connected to their Spectrum.
   1 \par This routine creates a new command '*L n' that lists the memory contents, starting from the address n, in both hexadecimal and ASCII. Unprintable ASCII codes ate printed as spaces. For example, the following statement:
   1 \par This routine checks that the command is in the form CAT n, or CAT #s,n then sets S-STR1 and D-STR1 system variables before exiting in syntax time or executing the CAT during runtime.
   1 \par This routine allows for a subroutine in the 'main' ROM to be called from the 'shadow' ROM, and can be called by using a RST\tab 10 instruction, followed by the address of the 'main' ROM subroutine.
   1 \par This restart is used to return to the "main" ROM, starting from the address held in the stack before calling this routine.
   1 \par This performs the same task as the preceding one, but the hex number is followed by a space. All registers are preserved.
   1 \par This loop is used to read the eight data bits that follows the 'start' bit. First, a delay equal to ((BAUD)*1.5)*26 T cycles is entered, so the first reading is made at the middle of the first data bit. The seven subsequent readings are separated by a del
   1 \par This loop advances the pointer 'HP until it reaches the start of the statement that has produced the error.
   1 \par This jump table is made by the 24 addresses of the routines called by using the various 'hook codes'. Note that hook code +2B jumps incorrectly to the same routine as hook code +22. The correct address seems to be +1AF0.
   1 \par This is used from the CAT command routine to print a file-name starting from the address held into the HL register.
   1 \par This is used by using 'hook code' +2A. It is the opposite routine of 'RD-SECTOR' above. The Microdrive unit is to be started before calling the routine. The current data block in the "m" channel pointed by the IX register is written onto the sector whose 
   1 \par This is used by using 'hook code' +29. The first header and data block that pass through the Microdrive head are copied into the channel area pointed by IX. As with the previous subroutine, the drive motor is to be started before calling it.
   1 \par This is the opposite to the INPAK subroutine and t
   1 \par This is the opposite subroutine of the preceding one, and is used to CLOSE the channel used by the MOVE command routine. If S-STR1 denotes that a stream was used, no action is made.
   1 \par This is the opposite routine to the preceding one. On entry, HL must hold the start address of the header block or of the data block (AFTER the preamble). The bytes are collected from Microdrive head and stored In the appropriate block. The entry points a
   1 \par This is the opposite of the preceding routine; the SCOUT leader, followed by an 8-bit station number, is sent o
   1 \par This is the main entry point to the 'shadow' ROM; it is paged in when the Program Counter reaches the address +0008 that is, the address of the main ROM 'ERROR' routine. (The other time in which the "shadow" ROM is paged in is when the Program Counter rea
   1 \par This is the actual SAVE command referred to the Microdrive (see 082F). The '9' bytes that form the 'header information' are collected from the HD variables and passed to the channel data block; then the memory block, whose 'start' and 'length' are held in
   1 \par This is the actual OPEN corinnand referred to the "m" channel. A permanent "m" channel is opened, and it is attached to the stream held into S-STR1 (provided that the file is a PRINT-type file).
   1 \par This is the CLOSE routine for the "n" channel,
   1 \par This is called by using 'hook code' +2F. Unfortunately the subroutine is unusable, because the carry flag (that signals if an error has occurred) is corrupted by exit via the BORD-REST subroutine. You may use GET-N-BUF at 03DF to read a packet.
   1 \par This is called by using 'hook code' +2E. First, the remaining bytes in the "n" channel buffer whose base address is held in the CURCHL system variable, are sent as EOF block (if the channel is opened for writing). The channel is then reclaimed.
   1 \par This is called by using 'hook code' +28. Before using this, you must start the required drive motor, and store a sector number into CHREC. The data block stored into the given sector is then read in the channel area (pointed by IX), and used if it is a PR
   1 \par This is called by using 'hook code' +20. The keyboard is scanned and the zero flag returned reset if any key has been pressed.
   1 \par This is called by using 'ho
   1 \par This is also called by using 'hook code' +24. The subroutine is entered with
   1 \par This fundamental subroutine is used to open a temporary "m" channel in the CHANS area. First a temporary "m" channel is created. Then the drive whose number is held into D-STR1 is started, and searched for a file whose name is held into
   1 \par This does not, however mean that it is not possible for you to add the expanded BASIC commands to your machine. The code that we have given is still quite correct, but the calls it makes to the ROM are no longer accurate. The solution, then is to add to t
   1 \par This corresponds to the 'main' ROM 'SYNTAX-Z' subroutine. A test of bit 7 of FLAGS wHL give the Zero flag set during syntax checking, and reset during
   1 \par This command will permit a 'pseudo\emdash random' handling of Microdrive files. When READ #S,N is executed, the 'read' Microdrive channel attached to the stream 'S' is used, and record 'n' of that file is loaded into the channel buffer.
   1 \par This command will convert the 'read' file attached to the stream 's' back to a 'write' file, thus permiting the addition of more data. When you have finished adding data, you may CLOSE the stream that returns a 'read' file. You may use RESTORE #S again to
   1 \par This command makes it possible to POKE a string in memory, starting from the address 'n'. For example, the statement:
   1 \par This command has only one form and, thus, this routine is more straightforward than the preceding ones.
   1 \par This channel is created only when the RS232 link is to be attached to a stream. 'Temporary' RS232 channels are never created, because the RS232 I/O does not require a buffer to store the data to be sent or received (the only 'workspace' is made by the SER
   1 \par This book provides a complete listing of this program, fully commented and explained, permitting you 
   1 \par This basic subroutine is used to receive from the network a block of bytes. On entry. HL must hold the address from which the bytes will be loaded, while E must hold the length of the block. The subroutine returns with the zero flag reset if the network i
   1 \par This area is used to communicate with the Microdrive device; it is created in the CHANS area. The start address is pointed by the IX index register in the shadow ROM program.
   1 \par This ROM, which is kept between memory adresses 0000H and 1FFFH is "paged" back and forth with the main ROM so that both ROMs appear to occupy the same section of memory.
   1 \par This 'hook code' is designed to call (when the main ROM is paged in) any subroutine held in the shadow ROM. The address of the subroutine to be called is taken from HD-11.
   1 \par This 'hook code' has the task of creating the new system variables if nonexistent. Note that the routine is made by a single RET instruction, because the variables have been created on entry to the shadow RON.
   1 \par There is the possibility that Sinclair Research may release a third edition of the Shadow ROM, with a few more changes. If you should get one of these, the extended BASIC commands may not work properly with it. The 'PRINT PEEK 23729' 
   1 \par There are two different versions of the ZX Interface, each having a slightly different program in its ROM. It is important that you know which version of the ROM you have, and you can find this out in the fo5lowing manner:
   1 \par The syntax of the new command is 'BEEP * a,b,c,d', where 'a' and 'b' are the values that the main ROM 'BEEPER' subroutine accepts as 'pitch' and 'length',  'c' is a 
   1 \par The syntax is handled by EXFT-PRMS the routine continues into the LOAD-VERIFY-MERGE routine below.
   1 \par The syntax is checked with a single call to the EXPT-PRMS subroutine.
   1 \par The subroutine which calculates the new filename address is the following:
   1 \par The subroutine is entered at EXPT-SPEC or at EXP-SPEC2 depending upon whether or not the character pointer is to be updated to the next character. A single character string is evaluated, and its upper case ASCII value is stored into
   1 \par The subroutine continues into OUTPAK below.
   1 \par The steps involved in doing the RESTORE #S command are as follows:
   1 \par The standard 'BEEP x,y'\tab command is very limited: it will only make sounds of a constant pitch. This routine creates a new 'BEEP' command that accepts four parameters, giving an endless range of possible sound effects.
   1 \par The six following calls are entered from the appropriate command syntax routine; on return from the command routine, the control returns to END1.
   1 \par The second command is LPRINT ! x,y. The parameter 'x' will define the width of the line. If, for example, you specify a width equal to 32, the standard Spectrum screen format is used. A width of 40, 80, 132 columns, or other, is suitable depending on your
   1 \par The routines in this section of the shadow ROM check the syntax of the 'new' commands and call the command routines during runtime.
   1 \par The routine is very similar to that for the "N" channel output. The byte passed to the accumulator is stored into the 512-byte buffer. When it is filled, the record is written onto the Microdrive cartridge.
   1 \par The routine is listed below:
   1 \par The routine is listed below.
   1 \par The routine is entered from the POKE *x,y routine with CH_ADD pointing to the character following the 'POKE' token. The main ROM routines EXPT_ 1NUM and EXPT_EXP are then used, respectively to evaluate a numeric and a string 
   1 \par The routine is entered at 01F7.
   1 \par The routine is as folllows:
   1 \par The routine enters the main ROM 'EDITOR' subroutine, after having copied the line into the editing area, and returns to the main execution loop when finished.
   1 \par The routine can be divided into eleven different sections:
   1 \par The routine STSYN is listed below.
   1 \par The r
   1 \par The program starts at the address F900 hex (63744 decimal), and is located above RAMTOP. When it is used for the first time, you must use a command
   1 \par The pressing of BREAK during the loading of 'autorun' programs wHL reset the system; otherwise the error routine continues.
   1 \par The only difference in respect to the "B" input is that the most significant bit of the received character is always cleared.
   1 \par The normal 'EDIT' function is not very well implemented; if you wish, for example, to EDIT line 4385 of your program, you must first make the line 'current' by using something like LIST 4385, and then (aft
   1 \par The next twelve hook codes refer to the Microdrives.
   1 \par The next instructions are the same as those stored from 0BD3 above, so they are not commented.
   1 \par The new ZX Interface 1's with serial number greater than 87315 have been provided with a new shadow ROM, with some general improvements.
   1 \par The new BASIC includes improvements to the POKE, CAT, and BEEP commands, a  better version of EDIT, more versatile file handling for the Microdrives, an extension to the RS\emdash 
   1 \par The name of the current record is compared against that of the file to be erased. If the comparison is successful, the 'pseudo-map' bit is set to mark the sector.
   1 \par The main changes may be summed up as follows:
   1 \par The main ROM routines EXPT_1NUM and FIND_INT2 are used to evaluate and fetch the given parameter 'n'.
   1 \par The main ROM 'CLOSE' routine at +16E5 is rather inadequate to deal with Interface's channels:
   1 \par The machine code program used to do this is very simple:
   1 \par The last command is LPRINT / x,y. In this case, 'x' will define the number of lines that will be printed before the form feed code (which advances to the next page) is sent to the printer (default=60, suitable for 66\emdash 
   1 \par The information given in this section, together with the examples given earlier should be sufficient to allow experienced machine code programmers to write their own new BASIC commands, and incorporate them into the Spectrum's BASIC. Non\emdash 
   1 \par The hook codes available for your use are numbered from 1BH to 32H (27 to 50 decimal). The hook codes are all fully described in the disassembly, from 1981H to 1B6DH. If you use the hook codes within your programs, instead of calling 
   1 \par The header and the data block preambles are made by the following bytes:
   1 \par The following two subroutines are used to get from the Network an 8-byte header and a data block respectively. Both require that the IX register point to the start of the "n" channel. The zero flag is returned reset with any error.
   1 \par The following subroutine fetches the first 'free' header and then writes the
   1 \par The following subroutine does the actual switching' of t
   1 \par The following loop tests to make sure that the name of the current record is not already stored in the buffer.
   1 \par The following is a complete, fully commented assembler listing of the machine code programs which make the new BASIC commands possible. These consist of a main program which sets up the new system variables needed by the Interface 1, and a number of small
   1 \par The following four hook codes refer to the local area network.
   1 \par The following example shows the use of hook code 20H (which tests to see if a key has been pressed) from machine code:
   1 \par The following are two subroutines that are never called from the Shadow ROM code. These subroutines operate evidently on the buffer's contents of a Microdrive channel.
   1 \par The following are four subroutines that are never called from the shadow ROM code; these routines are however described below as they may be useful to the programmer.
   1 \par The following BASIC program will generate a wide range of sounds:
   1 \par The following BASIC program will demonstrate this.
   1 \par The first implemented 'new' command is a 'double POKE' command. That is, a POKE command that uses word operands (16 bits) instead of byte operands (8 bits). The syntax is 'POKE *x,y\bullet 
   1 \par The final loop is made during syntax checking, for removing all 6-byte floating point numbers inserted in the line by the 'main' ROM interpreter.
   1 \par The final branch of the routine deals with the LOADIng of a program or an array.
   1 \par The extensions to BASIC consist of a number of machine code routines, each of which makes up a new BASIC command, along with a main program which will prepare the computer to run the new commands.
   1 \par The extended BASIC command '*L n' includes the following code:
   1 \par The execution of the new commands then, is a fairly complex procedure, comprised of the following steps:
   1 \par The error code in A determines the task to be executed.
   1 \par The entry point is OP-R
   1 \par The control returns to the main interpreter, when a 'new' command has been checked or executed, for the interpretation of the next statement.
   1 \par The contents of the A register are displayed on the screen in hexadecimal. All registers are preserved, excluding A.
   1 \par The command runs about 2\emdash 3 seconds faster than the standard 'CAT n' command, does not limit the output to 59 names, and provides information on the nature of the file, its length, etc., that is not given when the standard 'CAT' command is used.
   1 \par The command is also rejected if you specify wrong line numbers. If you use a nonexistent line number, the next existent number is used.
   1 \par The checksum of  the header is calculated.
   1 \par The checking operation done by the FORMAT command routine is now made directly with OUT instructions, without using the Microdrive channel to send/receive the blocks containing 'test data'.
   1 \par The character whose code is held in the A register is sent over the currently selected stream.
   1 \par The channel opened has more features than the normal "t" channel. The TAB function and the comma are supported on the printer, the 'leading space bug' present with the "t" channel has been corrected, the CR and LF codes are re\emdash defin
   1 \par The channel name is transferred into CHNAME.
   1 \par The catalogue can then be erased with ERASE "m";n;"CAT" (where 'n' is the drive number).
   1 \par The cartridge is simply searched for the 'n'th record of the file 'n' being in range 0..255), then it is loaded and CHBYTE cleared so as to direct INKEY$ and INPUT commands to the first byte loaded.
   1 \par The cartridge is searched for the sectors to be erased, and when any such sector is found, the relevant 'pseudo-map' bit is set. A 'normal' map is also set-up.
   1 \par The byte pointed by the HL register pair is fetched and sent by using the "B" or the "N" channel output routing, depending upon the state of bit 3 of the FLAGS3 variable.
   1 \par The bit correspondent to a given sector in the microdrive map is checked. The zero flag is returned set if the bit was reset, and vice-versa. Also the B register will hold, on return, a bit set in the position of the map bit; HL will hold the address of t
   1 \par The assembly code for our final extension to BASIC is listed below.
   1 \par The address of the syntax module routine STSYN is then stored into VECTOR. This causes the routine STSYN to be used whenever a command fails the syntax of the main ROM interpreter, and then that of the shadow ROM interpreter. The sy
   1 \par The address at which the name is to be inserted has been calculated; the following names are moved down to create the space for storing the new name.
   1 \par The actual saving is handled directly with "B" and "N" channels, or by SAVE-RUN if the 'N" channel is being used.
   1 \par The actual MOVE command inv
   1 \par The actual 'input' is handled via the CALL-INP routine above. The service routine is NCHAN-IN.
   1 \par The actual 'input' is handled via CALL-INP. The service routine is MCHAN-IN below.
   1 \par The actual 'input' is handled by the CALL-INP routine; the service routine is TCHAN-IN below.
   1 \par The actual "n" input involves the reading of the byte from the network buffer. If no other bytes are found in the buffer, a further data block is to be received (provided that the 'current' block is not the 'EOF' one) before reading the byte.
   1 \par The action to be performed depends on the state of bits 4,6,7 of FLAGS3. The 'old' header Is expected to be in the HD area, and is immediately transferred into the D-STR2 area, while the 'new' header is loaded into the HD area.
   1 \par The action of FORMATting a new cartridge is performed by this subroutine. It is entered with the drive number into D-STR1, the cartridge name address and length into N-STR1.
   1 \par The \lquote not used\rquote  routines
   1 \par The \lquote Hook code\rquote  routines
   1 \par The TCHAN-OUT subroutine ("t" channel output routine) has been remarkably improved; the TAB function now is supported, as well as the 'comma' control code, and the 'leading space' bug has been corrected. The whole subroutine is listed below.
   1 \par The Spectrums fitted with the 'new' interface will print '80' in response to the command 'PRINT PEEK 23729'.
   1 \par The Sinclair ZX Interface I adds enormously to the power of the ZX Spectrum, allowing it to send and receive data over an RS\emdash 232 link, to use the Local Area Network, and to store information on the Micro
   1 \par The RS\emdash 232 link routines
   1 \par The RS-232 link routines
   1 \par The EQU statements given here define all the labels referred to in the preceding program:
   1 \par The CR code is sent as 'CR' followed by 'LF' (Line Feed). If your printer does not need the LF code, you may end up with a double spacing between lines; the problem may be eliminated with POKE 65045,0.
   1 \par The BREAK key is checked and the error 'BREAK into program' is made if it is pressed.
   1 \par The 8 bits that forms the byte held in the A register are sent inverted through the RS232 link, after an initial 'start' bit (high), and followed by two 'stop' bits (or rather a 'double length' stop bit, with low signal level). As w
   1 \par The 'not used' routines
   1 \par The 'errors' include wrong checksums, and no matching between the wanted filename (CHNAME) and the loaded one (RECNAM).
   1 \par The 'Hook code' routines
   1 \par The '9' entries in this table are the 'standard' baud rate values (from 75 to 19200), each one followed by the 'timing constant' to be stored in the BAUD system variable.
   1 \par The '25' bytes that compose the initial part of an "M" channel are as follows:
   1 \par The '11' bytes that composes the initial part of a "N" channel are as follows:
   1 \par The '11' bytes that composes a "T" RS232 channel are as follows:
   1 \par The "t" channel output involves the 'sending' over the RS232 link of the character held into the A register, provided that it is within the range +20...+7F. Characters from +80 to 
   1 \par ThE 'OPEN' COMMAND SYNTAX ROUTINE
   1 \par TVDATA\tab EQU\tab 5C0EH
   1 \par TUE 'LOAD' COMMAND SYNTAX ROUTINE
   1 \par TST-WIDTH\tab 0CE6\tab TURN-ON\tab 153D\tab UNPAGE\tab 0700\tab UNT-MARK\tab 108F
   1 \par TST-PLACE\tab 16AC\tab TST-SPACE\tab 09BE\tab TST-TYPE\tab 09C7\tab TURN-ON\tab 1802
   1 \par TST-NUM\tab 1DE5\tab TST-PLACE\tab 1A9D\tab TST-SPACE\tab 09C2\tab TST-TYPE\tab 09CB
   1 \par TST-MR-M\tab 0988\tab TST-MR-N\tab 0994\tab TST-N-EOF\tab 0D38\tab TST-NUM\tab 1DDA
   1 \par TST-MERGE\tab 0908\tab TST-MR-M\tab 098C\tab TST-MR-N\tab 0998\tab TST-N-EOF\tab 0DD5
   1 \par TS-L-NET\tab 08CD\tab TS-L-RS\tab 08D3\tab TST-AGAIN\tab 0BC5\tab TST-MERGE\tab 0904
   1 \par TRY-AGAIN\tab 0DE2\tab TS-L-NET\tab 08D1\tab TS-L-RS\tab 08D7\tab TST-AGAIN\tab 0BC3
   1 \par TIlE 'TEST-BRK' SUBROUTINE
   1 \par TIlE 'SEND-BLK' SUBROUTINE
   1 \par THE\tab 'READ NEXT SECTOR' SUBROUTINE
   1 \par THE\tab '"T" CHANNEL INPUT' ROUTINE
   1 \par THE SHADOW ROM DISASSEMBLY
   1 \par THE 'WRITE SECTOR' SUBROUTINE
   1 \par THE 'WRITE A RECORD ONTO MICRODRIVE' SUBROUTINE
   1 \par THE 'WAIT-SCOUT' SUBROUTINE
   1 \par THE 'VERIFY' COMMAND SYNTAX ROUTINE
   1 \par THE 'USE STREAM OR TEMPORARY CHANNEL' SUBROUTINE
   1 \par THE 'UNPAGE' SUBROUTINE
   1 \par THE 'TEST-SP' ROUTINE
   1 \par THE 'TEST IF SYNTAX IS BEING CHECKED' RESTART
   1 \par THE 'SYSTEM VARIABLES DEFAHLT VALDES' TABLE
   1 \par THE 'START'
   1 \par THE 'ST-ERROR' ROUTINE
   1 \par THE 'SIGNAL "FREE SECTOR"' SUBROUTINE
   1 \par THE 'SHADOW' REPORT MESSAGES
   1 \par THE 'SHADOW REPORT PRINTING' ROUTINE
   1 \par THE 'SHADOW ERROR' RESTART
   1 \par THE 'SET A TEMPORARY "M" CHANNEL' SUBROUTINE
   1 \par THE 'SET "BAUD" SYSTEM VARIABLE' ROUTINE
   1 \par THE 'SEPARATOR' SUBROUTINE
   1 \par THE 'SEND-SCOUT' SUBROUTINE
   1 \par THE 'SEND-PACK' SUBROUTINE
   1 \par THE 'SEND RESPONSE BYTE' SUBROUTINE
   1 \par THE 'SEND DATA BLOCK TO MICRODRIVE HEAD' SUBROUTINE
   1 \par THE 'SELECT DRIVE MOTOR' SUBROUTINE
   1 \par THE 'SAVE' COMMAND SYNTAX ROUTINE
   1 \par THE 'SAVE MICRODRIVE MAP CONTENTS' SUBROUTINE
   1 \par THE 'SAVE DATA BLOCK INTO MICRODRIVE' SUBROUTINE
   1 \par THE 'SAVE A BYTE TO NETWORK OR RS232 LINK' SUBROUTINE
   1 \par THE 'S-PACK-1' SUBROUTINE
   1 \par THE 'RS232 TIMING CONSTANTS' TABLE
   1 \par THE 'RETURN TO THE MAIN INTERPRETER' ROUTINE
   1 \par THE 'RETURN TO MAIN ROM' RESTART
   1 \par THE 'RESTORE STREAM DATA' SUBROUTINE
   1 \par THE 'RESTORE MICRODRIVE MAP CONTENTS' SUBROUTINE
   1 \par THE 'RESTORE MAP ADDRESSES' SUBROUTINE
   1 \par THE 'RESTORE ADDRESS OF "FILENAME"' ROUTINE
   1 \par THE 'RESET NEW SYSTEM VARIABLES' SUBROUTINE
   1 \par THE 'RESET BIT IN MAP AREA' SUBROUTINE
   1 \par THE 'RECLAIM TEMPORARY CHANNELS' SUBROUTINE
   1 \par THE 'RECLAIM "M" CHANNEL' SUBROUTINE
   1 \par THE 'RECEIVE BLOCK FROM MICRODRIVE HEAD' SUBROUTINE
   1 \par THE 'READ SEQUENTIAL' SUBROUTINE
   1 \par THE 'READ SECTOR' SUBROUTINE
   1 \par THE 'READ RANDOM' SUBROUTINE
   1 \par THE 'PRNAME' SUBROUTINE
   1 \par THE 'PRINTER OUTPUT' SUBROUTINE
   1 \par THE 'PREAMBLE DATA' TABLE
   1 \par THE 'PRCHAR' SUBROUTINE
   1 \par THE 'OUTPAK' SUBROUTINE
   1 \par THE 'OUT-BLK-N' SUBROUTINE
   1 \par THE 'OPEN TEMPORARY "N" CHANNEL' SUBROUTINE
   1 \par THE 'OPEN TEMPORARY "M" CHANNEL' SUBROUTINE
   1 \par THE 'OPEN RS232 CHANNEL IN CHANS AREA' SUBROUTINE
   1 \par THE 'OPEN PERMANENT "N" CHANNEL" SUBROUTINE
   1 \par THE 'OPEN A PERMANENT "M" CHANNEL' SUBROUTINE
   1 \par THE 'OPEN "N" CHANNEL' COMMAND ROUTINE
   1 \par THE 'OBTAIN A RECORD DESCRIPTOR' SUBROUTINE
   1 \par THE 'NON-MASKABLE INTERRUPT' ROUTINE
   1 \par THE 'NETWORK STATE' SUBROUTINE
   1 \par THE 'MOVE' COMMAND SYNTAX ROUTINE
   1 \par THE 'MOVE' COMMAND SUBROUTINE
   1 \par THE 'MERGE' COMMAND SYNTAX ROUTINE
   1 \par THE 'MASKABLE INTERRUPT' ROUTINE
   1 \par THE 'MAIN ROM ERROR' ROUTtNE
   1 \par THE 'MAIN ROM ERROR' RESTART
   1 \par THE 'MAIN ERROR RESTART' EMULATION ROUTINE
   1 \par THE 'LOAD OR VERIFY' SUBROUTINE
   1 \par THE 'LOAD OR VERIFY BLOCK FROM MICRODRIVE' SUBROUTINE
   1 \par THE 'LOAD "RUN" PROGRAM' ROUTINE
   1 \par THE 'LD-VE-M' SUBROUTINE
   1 \par THE 'KEYBOARD TEST' SUBROUTINE
   1 \par THE 'INPAK' SUBROUTINE
   1 \par THE 'HOOK-CODE' ROUTINE
   1 \par THE 'HOOK CODE ADDRESSES' TABLE
   1 \par THE 'HOOK CODE +32' ROUTINE
   1 \par THE 'HOOK CODE +31' ROUTINE
   1 \par THE 'HEX-LINE' SUBROUTINE
   1 \par THE 'HEADER AND DATA BLOCK RECEIVING' ROUTINES
   1 \par THE 'GET PACKET FROM NETWORK' SUBROUTINE
   1 \par THE 'GET HEADER\tab INFORMATION FROM MICRODRIVE' SUBROUTINE
   1 \par THE 'GET HEADER AND DATA BLOCK' SUBROUTINE
   1 \par THE 'GET A RECORD' SUBROUTINE
   1 \par THE 'FREESECT' SUBROUTINE
   1 \par THE 'FORMAT' COMMAND SYNTAX ROUTINE
   1 \par THE 'FORMAT' COMMAND ROUTINE
   1 \par THE 'FETCH HEADER FROM HICRODRIVE' SUBROUTINE
   1 \par THE 'FETCH A RECORD FROM MICRODRIVE' SUBROUTINE
   1 \par THE 'EXCHANGE FILE SPECIFIERS' SUBROUTINE
   1 \par THE 'EXCHANGE DSTR1 AND DSTR2 CONTENTS' SUBROUTINE
   1 \par THE 'EVALUATE STRING EXPRESSION' SUBROUTINE
   1 \par THE 'EVALUATE STREAM OR EXPRESSION' SUBROUTINE
   1 \par THE 'EVALUATE STREAM NUMBER' SUBROUTINE
   1 \par THE 'EVALUATE PARAMETERS' SUBROUTINE
   1 \par THE 'EVALUATE NUMERIC EXPRESSION' SUBROUTINE
   1 \par THE 'EVALUATE FILENAME' SUBROUTiNE
   1 \par THE 'EVALUATE CHANNEL SPECIFIER' SUBROUTINE
   1 \par THE 'EVALUATE "X";N;"NAME"' SUBROUTINE
   1 \par THE 'ERASE' COMMAND SYNTAX ROUTINE
   1 \par THE 'ERASE' COMMAND SUBROUTINE
   1 \par THE 'END OF STATEMENT' ROUTINE
   1 \par THE 'DISP-HEX2' SUBROUTINE
   1 \par THE 'DISP-HEX' SUBROUTINE
   1 \par THE 'DISP-CH' SUBROUTINE
   1 \par THE 'DELAY-BC' SUBROUTINE
   1 \par THE 'DECREASE SECTOR NUMBER' SUBROUTINE
   1 \par THE 'CREATE NEW SYSTEMS VARIABLES' ROUTINE
   1 \par THE 'CREATE NEW SYSTEM VARIABLES' RESTART
   1 \par THE 'CONSOLE OUTPUT' SUBROUTINE
   1 \par THE 'CONSOLE INPUT' SUBROUTINE
   1 \par THE 'CLS#' COMMAND ROUTINE
   1 \par THE 'CLOSE-STREAM' ROUTINE
   1 \par THE 'CLOSE' COMMAND SUBROUTINE
   1 \par THE 'CLOSE NETWORK CHANNEL' SUBROUTINE
   1 \par THE 'CLOSE FILE' SUBROUTINE
   1 \par THE 'CLOSE "MOVE" CHANNEL' SUBROUTINE
   1 \par THE 'CLEAR#' COMMAND ROUTINE
   1 \par THE 'CLEAR BUFFER CONTENTS' SUBROUTINE
   1 \par THE 'CHK-FULL' SUBROUTINE
   1 \par THE 'CHECK-SP' ROUTINE
   1 \par THE 'CHECK-RESTING' SUBROUTINE
   1 \par THE 'CHECK-NAME' SUBROUTINE
   1 \par THE 'CHECK STATION NUMBER' SUBROUTINE
   1 \par THE 'CHECK MAP BIT STATE' SUBROUTINE
   1 \par THE 'CHECK BAUD RATE' SUBROUTINE
   1 \par THE 'CHECK "PSEUDO-MAP" BIT STATE' SUBROUTINE
   1 \par THE 'CHECK "M" PARAMETERS' SUBROUTINE
   1 \par THE 'CHECK "M" PARAMETERS AND FILENAME' SUBROUTINE
   1 \par THE 'CAT' COMMAND SYNTAX ROUTINE
   1 \par THE 'CAT' COMMAND ROUTINE
   1 \par THE 'CALLS TO THE COMMAND ROUTINES'
   1 \par THE 'CALL-INP' ROUTINE
   1 \par THE 'CALL A MAIN ROM ROUTINE' RESTART
   1 \par THE 'CALCULATE/COMPARE CHECKSUMS' ROUTINE
   1 \par THE 'CALBAS-2' ROUTINE
   1 \par THE 'BREAK INTO I/O OPERATION' ROUTINE
   1 \par THE 'BR-DELAY' SUBROUTINE
   1 \par THE 'BORDER COLOUR RESTORE' SUBROUTINE
   1 \par THE 'ATTACH CHANNEL TO A STREAM' ROUTINE
   1 \par THE '1 MILLISECOND DELAY' SUBROUTINE
   1 \par THE '"T" CHANNEL OUTPUT' ROUTINE
   1 \par THE '"T" CHANNEL INPUT' SERVICE ROUTINE
   1 \par THE '"T" CHANNEL DATA' TABLE
   1 \par THE '"N" CHANNEL OUTPUT' ROUTINE
   1 \par THE '"N" CHANNEL INPUT' SERVICE ROUTINE
   1 \par THE '"N" CHANNEL INPUT' ROUTINE
   1 \par THE '"N" CHANNEL DATA' TABLE
   1 \par THE '"M" CHANNEL OUTPUT' ROUTINE
   1 \par THE '"M" CHANNEL INPUT' SERVICE ROUTINE
   1 \par THE '"M" CHANNEL INPUT' ROUTINE
   1 \par THE '"M" CHANNEL DATA' TABLE
   1 \par THE '"B" CHANNEL OUTPUT' ROUTINE
   1 \par THE '"B" CHANNEL INPUT' SERVICE ROUTINE
   1 \par THE '"B" CHANNEL INPUT' ROUTINE
   1 \par THE "LOAD-VERIFY-MERGE' COMMANDS ROUTINE
   1 \par THE  'SEND EOF BLOCK TO NETWORK' SUBROUTINE
   1 \par TEST-TYPE\tab 08F2\tab TIME-OUT\tab 0D5F\tab TON-DELAY\tab 1809\tab TRY-AGAIN\tab 0D45
   1 \par TEST-STAT\tab 068F\tab TEST-TYPE\tab 08F6\tab TIME-OUT\tab 0DFC\tab TON-DELAY\tab 1344
   1 \par TEST-SAVE\tab 07A7\tab TEST-SCT\tab 1C0A\tab TEST-SP\tab 003A\tab TEST-STAT\tab 068F
   1 \par TEST-RET\tab 05BF\tab TEST-SAVE\tab 07A7\tab TEST-SCT\tab 1BDF\tab TEST-SP\tab 003A
   1 \par TEST-NEXT\tab 060C\tab TEST-OUT\tab 0D7A\tab TEST-PMAP\tab 1306\tab TEST-RET\tab 05BF
   1 \par TEST-MNAM\tab 0685\tab TEST-NEXT\tab 060C\tab TEST-OUT\tab 0E17\tab TEST-PMAP\tab 13E8
   1 \par TEST-M-BF\tab 1134\tab TEST-MAP\tab 106F\tab TEST-MCHL\tab 10F5\tab TEST-MNAM\tab 0685
   1 \par TEST-LOW\tab 013B\tab TEST-N-BF\tab 120F\tab TEST-MAP\tab 1143\tab TEST-MCHL\tab 11D0
   1 \par TEST-CODE\tab 00E9\tab TEST-DTR\tab 0C74\tab TEST-ERR\tab 18E9\tab TEST-LOW\tab 013B
   1 \par TEST-BRK\tab 163E\tab TEST-BUFF\tab 0DBB\tab TEST-CODE\tab 00E9\tab TEST-DTR\tab 0D21
   1 \par TCHAN_ OUT\tab EQU\tab 0C3CH
   1 \par TCHAN-OUT\tab 0C3C\tab TEST-BAUD\tab 06B0\tab TEST-BLKN\tab 0E45\tab TEST-BUFF\tab 0D1E
   1 \par TCHAN-IN\tab 0B82\tab TCHAN-OUT\tab 0C3A\tab TEST-BAUD\tab 06B0\tab TEST-BLKN\tab 0EE2
   1 \par TAB\tab EQU\tab 17H
   1 \par TAB-PROC\tab 0CB5\tab TAB-SERV\tab 0CC8\tab TABLOOP\tab 0CF9\tab TABZERO\tab 0CF4
   1 \par T-NA-1\tab 1CAA\tab T-NA-2\tab 1CB5\tab T-OTHER\tab 1E31\tab TAB-MOD\tab 0CEE
   1 \par T-NA-1\tab 1CA4\tab T-NA-2\tab 1CAF\tab T-OTHER\tab 1E26\tab TCHAN-IN\tab 0B7B
   1 \par T-FURTHER\tab 0BF9\tab T-INPUT\tab 0B6F\tab T-LD-NET\tab 09DE\tab T-M-CODE\tab 0911
   1 \par T-FURTHER\tab 0BF7\tab T-INPUT\tab 0B76\tab T-LD-NET\tab 09E2\tab T-M-COOE\tab 0915
   1 \par Such an application is shown by using the following BASIC program. Each item is made by 8 elements (length=63 characters + carriage return) of an array, exactly 512 bytes.
   1 \par Some other tests are now made.
   1 \par Sinclair Research have released two different versions of the Interface 1. Each of the versions contains a slightly different program in its ROM. The newer version of 
   1 \par Since the names are printed as they are found on the cartridge, the list is not alphabetically ordered.
   1 \par Since the Microdtive system splits the main 'PRINT\emdash type' files into records 512 bytes long, you may write items with 'length=512', thereby having each record contain a single item, and then read back that item with the READ #S,N command.
   1 \par Similarly to the "n" input, the "m" input involves the readin
   1 \par Secondl
   1 \par SW-MOTOR above.
   1 \par ST_END\tab EQU\tab 05B7H
   1 \par STR_DATA1\tab EQU\tab 1727H
   1 \par STR-DATA1 in the main ROM is made to fetch into BC the 'stream data' for the given stream, and to make HL point to the first of the two data bytes.
   1 \par STORE-LEN\tab 0F30\tab SW-MOTOR\tab 1565\tab SYNC-RD\tab 167C\tab T-CH-NAME\tab 1135
   1 \par STORE-DSP\tab 1B23\tab STORE-LEN\tab 0E93\tab SW-MOTOR\tab 182A\tab T-CH-NAME\tab 1061
   1 \par STK_FETCH\tab EQU\tab 2BF1H
   1 \par STCHK\tab 1439\tab STO-DISP\tab 1463\tab STORE-COD\tab 0CB8\tab STORE-DSP\tab 1AFF
   1 \par START-BIT\tab 0BD1\tab START-SA\tab 14E8\tab STCHK\tab 1354\tab STO-DISP\tab 137E
   1 \par START-3\tab 00A5\tab START-4\tab 00BC\tab START-BIT\tab 0BCF\tab STAR-SA\tab 18D9
   1 \par STACK_A\tab EQU\tab 2D28H
   1 \par ST-SHADOW\tab 0008\tab START-2\tab 009A\tab START-3\tab 00A5\tab START-4\tab 00BC
   1 \par ST-ERROR\tab 0068\tab ST-MAP-AD\tab 1168\tab ST-SHADOW\tab 0008\tab START-2\tab 009A
   1 \par ST-BF-LEN\tab 0D88\tab ST-END\tab 05B7\tab ST-ERROR\tab 0068\tab ST-MAP-AD\tab 108A
   1 \par SPACE\tab EQU\tab 28H
   1 \par SP-N-END\tab 0EA2\tab SPC-COUNT\tab 0C8C\tab ST-BF-LEN\tab 0E25\tab ST-END\tab 05B7
   1 \par SH_ERR\tab EQU\tab 20H
   1 \par SH-ERR\tab 0020\tab SKIP-NUN\tab 014E\tab SP-DL-1\tab 0DF6\tab SP-N-END\tab 0E05
   1 \par SH-ERR\tab 0020\tab SIGN-ERR\tab 15DE\tab SKIP-NUM\tab 014E\tab SP-DL-1\tab 0E93
   1 \par SET_T_MCH\tab EQU\tab 0FE8H
   1 \par SERIAL-IN\tab 0BD8\tab SET-BAUD\tab 0AC9\tab SET-PROG\tab 0A15\tab SET-T-MCH\tab 0FE8
   1 \par SERIAL-IN\tab 0BD6\tab SET-BAUD\tab 0ACD\tab SET-PROG\tab 0A19\tab SET-T-MCH\tab 10A5
   1 \par SENDSCOUT\tab 0E77\tab SEPARATOR\tab 05B1\tab SER-IN2\tab 0C1B\tab SER-OUT-L\tab 0D2C
   1 \par SENDSCOUT\tab 0DDA\tab SEPARATOR\tab 05B1\tab SER-IN-2\tab 0C1D\tab SER-OUT-L\tab 0C88
   1 \par SEND-NEOF\tab 0FAE\tab SEND-PACK\tab 0E4F\tab SEND-RESP\tab 107B\tab SEND-SC\tab 101E
   1 \par SEND-NEOF\tab 0EF5\tab SEND-PACK\tab 0DB2\tab SEND-RESP\tab 0FBE\tab SEND-SC\tab 0F61
   1 \par SEL_DRIVE\tab EQU\tab 17F7H
   1 \par SECTOR\tab EQU\tab 5CC9H
   1 \par SCR_CT\tab EQU\tab 5C8CH
   1 \par SCREEN$\tab 0771\tab SE-NAME\tab 1CA0\tab SEL-DRIVE\tab 1532\tab SEND-BLK\tab 135A
   1 \par SCREEN$\tab 0771\tab SE-NAME\tab 1C9A\tab SEL-DRIVE\tab 17F7\tab SEND-BLK\tab 1275
   1 \par SAVE-RUN\tab 1E7F\tab SAVE-SYN\tab 082F\tab SC-L-LOOP\tab 0133\tab SCOUT-END\tab 0F56
   1 \par SAVE-RUN\tab 1AC4\tab SAVE-SYN\tab 082F\tab SC-L-LOOP\tab 0133\tab SCOUT-END\tab 1013
   1 \par SA-MAP\tab 1A04\tab SA-MAP-LP\tab 1A11\tab SA-NET\tab 0892\tab SAVE-M\tab 0849
   1 \par SA-MAP\tab 1613\tab SA-MAP-LP\tab 1620\tab SA-NET\tab 088E\tab SAVE-M\tab 0849
   1 \par SA-DRI-4\tab 194F\tab SA-DRI-WR\tab 1943\tab SA-DRIVE\tab 18CB\tab SA-HEADER\tab 084F
   1 \par SA-DRI-4\tab 155E\tab SA-DRI-WR\tab 1552\tab SA-DRIVE\tab 14DA\tab SA-HEADER\tab 084F
   1 \par SA-BLOCK\tab 086E\tab SA-BYTE\tab 0884\tab SA-DRI-2\tab 1921\tab SA-DRI-3\tab 1929
   1 \par SA-BLOCK\tab 086E\tab SA-BYTE\tab 0880\tab SA-DRI-2\tab 1530\tab SA-DRI-3\tab 1538
   1 \par S. Vickers, ZX SPECTRUM BASIC PROGRAMMING (Sinclair Research Ltd.)
   1 \par S-SC-DEL\tab 103A\tab S-STAT\tab 016F\tab SA-B-END\tab 0895\tab SA-BLK-LP\tab 0872
   1 \par S-SC-DEL\tab 0F7D\tab S-STAT\tab 016F\tab SA-B-END\tab 0891\tab SA-BLK-LP\tab 0872
   1 \par Run the following line of BASIC:
   1 \par RWF\emdash ERR\tab EQU\tab 1132H
   1 \par RUNTIME\tab 011B\tab RWF-ERR\tab 1132\tab S-BLK-END\tab 0881\tab S-PACK-1\tab 0E48
   1 \par RUNTIME\tab 011B\tab RWF-ERR\tab 1132\tab S-BLK-END\tab 087D\tab S-PACK-1\tab 0DAB
   1 \par RS\emdash SH\tab EQU\tab 1AC5H
   1 \par RS\emdash SH2\tab EQU\tab 11A3H
   1 \par ROMERR\tab EQU\tab 08H
   1 \par ROMERR\tab 0028\tab ROTATE\tab 13DD\tab RS-SH\tab 1AC5\tab RS-SH2\tab 11A3
   1 \par ROMERR\tab 0028\tab ROTATE\tab 12F8\tab RS-SH\tab 1AC5\tab RS-SH2\tab 11A3
   1 \par ROM report messages table. The result will be as follows:
   1 \par RES_B_MAP\tab EQU\tab 12FEH
   1 \par RESTORE\tab EQU\tab 0E5H
   1 \par REST-STRM\tab 1444\tab RETAD-RUN\tab 05DD\tab RETAD-SYN\tab 05E0\tab RMERR-2\tab 0040
   1 \par REST-STRM\tab 135F\tab RETAD-RUN\tab 05DD\tab RETAD-SYN\tab 05E0\tab RMERR-2\tab 0040
   1 \par RES-B-MAP\tab 13E3\tab RES-VARS\tab 0255\tab REST-MAP\tab 1476\tab REST-N-AD\tab 1A82
   1 \par RES-B-MAP\tab 12FE\tab RES-VARS\tab 024D\tab REST-MAP\tab 1391\tab REST-N-AD\tab 1691
   1 \par RECNUM\tab EQU\tab 44H
   1 \par RECLEN\tab EQU\tab 45H
   1 \par RECFLG\tab EQU\tab 43H
   1 \par REC-BYTE\tab 0B95\tab REC-PROC\tab 0B98\tab REP-MSG\tab 0260\tab REPTEST\tab 154C
   1 \par REC-BYTE\tab 0B8E\tab REC-PROC\tab 0B9A\tab REP-MSG\tab 0258\tab REPTEST\tab 1811
   1 \par READ\tab EQU\tab 0E3H
   1 \par READ-RS\tab 0BAF\tab READ-SEQ\tab 1EFD\tab READY-R2\tab 1686\tab READY-RE\tab 162A
   1 \par RE-MAP\tab 162D\tab RE-MAP-LP\tab 163D\tab READ-RS\tab 0BB1\tab READ-SEQ\tab 1A09
   1 \par RD_SECTOR\tab EQU\tab 1A4BH
   1 \par RDLOOP4\tab 166B\tab RE-MAP\tab 1A1E\tab RE-MAP-LP\tab 1A2E\tab READ-BLK\tab 165A
   1 \par RD-SECTOR\tab 1F3F\tab RDLOOP1\tab 165C\tab RDLOOP2\tab 165E\tab RDLOOP3\tab 1669
   1 \par RD-BYT-2\tab 169D\tab RD-BYT-3\tab 16A5\tab RD-NEXT\tab 1F7A\tab RD-RANDOM\tab 1F0B
   1 \par RCLM-OLD\tab 09E8\tab RD-NEXT\tab 1A86\tab RD-RANDOM\tab 1A17\tab RD-SECTOR\tab 1A4B
   1 \par RCLM-MAP\tab 11EF\tab RCLM-NUM\tab 0182\tab RCLM-OLD\tab 09EC\tab RD-BYT-1\tab 1696
   1 \par RCL-T-CH\tab 17B9\tab RCLM-CH\tab 177F\tab RCLM-MAP\tab 1114\tab RCLM-NUM\tab 0182
   1 \par R. Zaks, PROGRAMMING THE Z80 (Sybex)
   1 \par Pseudo\emdash random file handling: READ #S,N
   1 \par Printer).
   1 \par Pokeing strings into memory: POKE n,\'94s\'94
   1 \par PRT-OUT\tab 1EF0\tab PT-N-CHAN\tab 17EB\tab RCL-T-CH\tab 17B7\tab RCLM-CH\tab 177D
   1 \par PROC\tab 0753\tab PROG-LINE\tab 0130\tab PRT-OUT\tab 19FC\tab PT-N-CHAN\tab 17ED
   1 \par PRNAME\tab 1D5B\tab PRNM-LP\tab 1D5E\tab PROG\tab 0753\tab PROG-LINE\tab 0130
   1 \par PRINT_FP\tab EQU\tab 2DE3H
   1 \par PRINT\tab EQU\tab 0F5H
   1 \par PRCOMMA\tab EQU\tab 06H
   1 \par PRCHAR\tab EQU\tab 1D66H
   1 \par PR-REP-LP\tab 02A7\tab PRCHAR\tab 1D71\tab PREP-MARK\tab 1C35\tab PRINT-SPC\tab 0C9A
   1 \par PR-REP-LP\tab 029F\tab PRCHAR\tab 1D66\tab PRNAME\tab 1D50\tab PRNM-LP\tab 1D53
   1 \par PPC_HI\tab EQU\tab 0CH
   1 \par POKE\tab EQU\tab 0F4H
   1 \par Other minor changes are:
   1 \par Other important alterations concern with Microdrive reading operations (i.e. channel opening, CAT command)
   1 \par On exit, HL holds a 'stream data' displacement that may be used to attach the channel to a stream. The drive motor will not be switched off. Note that H'L' is corrupted and the user must preserve its value when using this routine from BASIC.
   1 \par On entry, D-STR1 must hold the destination station number to be copied into NCIRIS, while NTSTAT must hold the
   1 \par OUT_M_BUF\tab EQU\tab 1878H
   1 \par OUTPAK\tab 1082\tab OUTPAK-L\tab 1089\tab PAR-1\tab 079F\tab PAR-2\tab 07B2
   1 \par OUTPAK\tab 0FC5\tab OUTPAK-L\tab 0FCC\tab PAR-1\tab 079F\tab PAR-2\tab 07B2
   1 \par OUT-M-BYT\tab 15D0\tab OUT-M-HD\tab 15AD\tab OUTMEM\tab 0F9E\tab OUTMEM2\tab 119A
   1 \par OUT-M-BLK\tab 187C\tab OUT-M-BUF\tab 1878\tab OUT-M-BYT\tab 1895\tab OUT-M-HD\tab 1872
   1 \par OUT-BLK-N\tab 0E30\tab OUT-CODE\tab 1EE3\tab OUT-M-BLK\tab 15B7\tab OUT-M-BUF\tab 15B3
   1 \par OREPORT-8\tab 0CE5\tab OT-NAMS\tab 1D17\tab OUT-BLK-N\tab 0D93\tab OUT-CODE\tab 19EF
   1 \par OREP-1-2\tab 073C\tab OREPORT-1\tab 04B2\tab OREPORT-8\tab 0D82\tab OT-NAMS\tab 1D22
   1 \par OP_STREAM\tab EQU\tab 0B4AH
   1 \par OP_RS_CH\tab EQU\tab 0B13H
   1 \par OPEN-SYN\tab 04ED\tab ORD-NAM\tab 1CBB\tab OREP-1-2\tab 073C\tab OREPORT-1\tab 04B2
   1 \par OPEN-N-ST\tab 0F40\tab OPEN-RS\tab 051C\tab OPEN-SYN\tab 04ED\tab ORD-NAM\tab 1CC1
   1 \par OPEN #s;"n";n commands. All parameters are stored into S-STR1, N-STR1, D-STR1 and L-STR1 variables before exiting during syntax checking or executing the command during runtime.
   1 \par OP-TEMP-M\tab 1B29\tab OP-TEMP-N\tab 0EA9\tab OPEN-N-ST\tab 0EA3\tab OPEN-RS\tab 051C
   1 \par OP-STREAM\tab 0B51\tab OP-STRM\tab 1859\tab OP-TEMP-M\tab 1B05\tab OP-TEMP-N\tab 0F46
   1 \par OP-RSCHAN\tab 0B47\tab OP-RUN\tab 1E7A\tab OP-STREAM\tab 0B4A\tab OP-STRM\tab 1455
   1 \par OP-PERM-N\tab 0F52\tab OP-RS-CH\tab 0B17\tab OP-RSCHAN\tab 0B4E\tab OP-RUN\tab 1ABF
   1 \par OP-M-C\tab 0529\tab OP-M-STRM\tab 1AF0\tab OP-PERN-N\tab 0EB5\tab OP-RS-CH\tab 0813
   1 \par OP-F-5\tab 1B5B\tab OP-F-X\tab 1B26\tab OP-M-C\tab 0529\tab OP-M-STRM\tab 1ACC
   1 \par OP-F-2\tab 1B57\tab OP-F-3\tab 1B5C\tab OP-F-4\tab 1B5F\tab OP-F-5\tab 1B6C
   1 \par OP-F-1\tab 1B16\tab OP-F-2\tab 1B41\tab OP-F-3\tab 1B46\tab OP-F-4\tab 1B49
   1 \par Now this data block is written in all sectors with HDNUMB numbered from 254 to 1
   1 \par Now the working areas and the new system variables are cleared.
   1 \par Now the space for the new channel is created at the end of the CHANS area.
   1 \par Now the sectors contain 'test data', and are to be read back to see if they are usable. If the checksums are correct, the appropriate map bit is reset to signal 'free for use' sectors.
   1 \par Now the header checksum is calculated, and compared with NTCHS checksum.
   1 \par Now the first 32 locations in the data buffer are cleared. These locations act as a 'pseudo-map', used to mark the sectors to be erased,
   1 \par Now the file names are in the data buffer. CHREC holds the number of names stored. First the cartridge name is printed onto the selected stream.
   1 \par Now the error produced by the main ROM is confirmed.
   1 \par Now the data buffer is filled with bytes +FC; and the checksums are calculated.
   1 \par Now the data block is sent, and NCNUMB updated.
   1 \par Now the checksum of the data block is calculated.
   1 \par Now the block is received.
   1 \par Now the SCOUT pulse is waited for.
   1 \par Now the SCOUT leader, followed by the 8-byte header, is sent, and a response code is received (if not broadcasting).
   1 \par Now the 'map' is created unless it already exists.
   1 \par Now some calculation is performed to obtain into DE the address from which the data coming from the current record, will be loaded or verified. HL will point to the 512-byte buffer.
   1 \par Now see if an Interface's channel has been requested.
   1 \par Now follows the second routine, used to get the data block from the network.
   1 \par Now follows the CLOSE routine for the "t" and "b" channels.
   1 \par Now deal with loading of files of type 3 (i.e. CODE and SCREENS), or verifying of all file types.
   1 \par Now deal with LINE.
   1 \par Now deal with CODE.
   1 \par Now deal with 'INPUT #' command referred to an Interface channel.
   1 \par Now consider the MERGEing of a program.
   1 \par Now all data referring to the stream attached to the channels moved down are updated.
   1 \par Now a loop similar to that at 0BB1 is entered. If the TXdata line is found high for at least 77 T cycles, the 'sending' device is sending the 'start' bit for a second byte, even if the CTS line has a low signal level. This byte is to be read and stored in
   1 \par Now a loop is entered to find the line that has produced the error.
   1 \par Now a loop is entered to check if a 'start bit'\tab is found from the TXdata line. A 'start bit' is detected if the TXdata line is high for at least '77' T cycles. If after about 25 ms no 'start bit' is found, the routine continues forward.
   1 \par Now a loop is entered to SAVE to the "N" or "B" devices the 'header', i.e. the nine bytes taken from the system variables HD-00 to HD-11.
   1 \par Note, however, that this routine makes its own call to another Shadow ROM  routine, DISP-CH, which you will also have to add to your code. DISP-CH is located at 1EA9 in the disassembly, and is as follows:
   1 \par Note that to fail the syntax of the interpreter, the command begins with a '*' character; the command may not begin with a 'new' command token, such as CAT, SAVE, ERASE, CLS, etc.
   1 \par Note that the shadow ROM routines DISP_HEX, DISP_HEX2 and DISP_CH are used to print characters onto stream 2 (the screen). Note also that the command will never end during runtime. This, however, will not result in an endless loop, as you may simply press
   1 \par Note that the routine fails the syntax of the interpreter by using a different parameter type (i.e. a string instead of a number), while the previous routine used a '*' character following the command code.
   1 \par Note that the form *CAT #S;N is not supported, because there is not sufficient time to send the information fetched to a channel other than the screen, before the next tape sector is due to be exammin
   1 \par Note that the command is rejected at runtime (BIT 7,PPC_HI) if it is not a 'direct' one: this is because an EDIT command used within a program does not make sense.
   1 \par Note that the 'main' ROM restart GET_CHAR is used to fetch the command code into the A register; then a jump is made to the required syntax module routine. If the command code is still wrong, the error is confirmed by jumping to ERR_6.
   1 \par Note that initially 'hook code' +31 is used to create the new system variables if they do not already exist. Failure to do so in your programs will cause a probable crash when you try to POKE something into the location where the 'new' system variables sh
   1 \par Note that 'b', 'c' and 'd' must be in the range l..255, ('d' may be set to 8, but this will give the same effect that you would expect from a value of 256.)
   1 \par Normally, if you try to write data onto a Microdrive file that has previously been CLOSEd, the error 'Writing to a 'read' file' will occur. This makes the operation of extending a file with more data difficult, as one has to create a new file, copy into i
   1 \par Nonsense in BASIC.
   1 \par Names starting with CHR$ 18 are not printed; records other than 'first' ones are not examined, so as to avoid the printing of a filename more than once.
   1 \par NXTCHAN\tab 11E5\tab OFF-MOTOR\tab 1586\tab OP-B-CHAN\tab 1FF6\tab OP-CHAN\tab 186A
   1 \par NXTCHAN\tab 110A\tab OFF-MOTOR\tab 184B\tab OP-CHAM\tab 1466\tab OP-F-1\tab 1B3A
   1 \par NXT-ENTRY\tab 0AD4\tab NXT-MOTOR\tab 1597\tab NXT-SCT\tab 1279\tab NXT-STRM\tab 144A
   1 \par NXT-ENTRY\tab 0AD0\tab NXT-MOTOR\tab 185C\tab NXT-SCT\tab 119E\tab NXT-STRM\tab 1365
   1 \par NUM-ARR\tab 0819\tab NXT-1\tab 01A3\tab NXT-B-MAP\tab 1351\tab NXT-BYTE\tab 1431
   1 \par NUM-ARR\tab 0819\tab NXT-1\tab 01A3\tab NXT-B-MAP\tab 126C\tab NXT-BYTE\tab 134C
   1 \par NREPORT\emdash N\tab EQU\tab 0902H
   1 \par NREPORT\emdash C\tab EQU\tab 052FH
   1 \par NREPORT\emdash 3\tab EQU\tab 062DH
   1 \par NREPORT\emdash 2\tab EQU\tab 0663H
   1 \par NREPORT-9\tab 0683\tab NREPORT-C\tab 052F\tab NREPORT-H\tab 0902\tab NREPORT-L\tab 0930
   1 \par NREPORT-8\tab 06A1\tab NREPORT-9\tab 0683\tab NREPORT-L\tab 0934\tab NREPORT-N\tab 0906
   1 \par NREPORT-3\tab 062D\tab NREPORT-4\tab 064C\tab NREPORT-5\tab 0681\tab NREPORT-8\tab 06A1
   1 \par NREPORT-2\tab 0663\tab NREPORT-3\tab 062D\tab NREPORT-4\tab 064C\tab NREPORT-5\tab 0681
   1 \par NOTRIGHT\tab 1377\tab NREPORT-0\tab 00E7\tab NREPORT-1\tab 0139\tab NREPORT-2\tab 0663
   1 \par NOTE:\tab This test fails to exclude simple strings, but the 'bug' (present in the main ROM) is corrected at 07FF.
   1 \par NOTE:\tab The above routine is a 'duplicate' of BRK-INOUT at 0CB4.
   1 \par NOTE: If the BREAK key is pressed while the buffer is sent as 
   1 \par NOT-RECV\tab 1FF1\tab NOT-TOKEN\tab 0C44\tab NOTRIGHT\tab 145C\tab NREPORT-1\tab 0139
   1 \par NOT-OP-B\tab 051F\tab NOT-OP-M\tab 0500\tab NOT-PROT\tab 1884\tab NOT-TOKEN\tab 0C46
   1 \par NOT-NET\tab 0722\tab NOT-OP-B\tab 051F\tab NOT-OP-M\tab 0500\tab NOT-PROT\tab 15BF
   1 \par NOT-CR\tab 0C82\tab NOT-FOR-B\tab 04D3\tab NOT-GRAPH\tab 0C55\tab NOT-LEAD\tab 0C4F
   1 \par NOT-CR\tab 0C57\tab NOT-FOR-B\tab 04D3\tab NOT-GRAPH\tab 0C4C\tab NOT-NET\tab 0722
   1 \par NONSENSE\tab 0584\tab NOPRES\tab 155B\tab NOREAD\tab 12C1\tab NOT-CMM\tab 0CA5
   1 \par NONS-BSC\tab 07F4\tab NONSENSE\tab 0584\tab NOPRES\tab 1820\tab NOREAD\tab 11E6
   1 \par NOFULL\tab 12FC\tab NOINC-C\tab 1DF8\tab NONAMES\tab 1D27\tab NONS-BSC\tab 07F4
   1 \par NOEMP\tab 12B6\tab NOFULL\tab 121B\tab NOINC-C\tab 1DED\tab NONAMES\tab 1D1C
   1 \par NO-NAME\tab 0716\tab NO-PRT\tab 1374\tab NO-READ\tab 0D87\tab NOEMP\tab 139B
   1 \par NO-M-ARR\tab 07DA\tab NO-NAME\tab 0716\tab NO-PRT\tab 128F\tab NO-READ\tab 0CEA
   1 \par NO-AUTO\tab 0A4E\tab NO-AUTOST\tab 0973\tab NO-FOR-M\tab 04BF\tab NO-GOOD\tab 1A51
   1 \par NO-AUTOST\tab 0977\tab NO-FOR-M\tab 04BF\tab NO-GOOD\tab 1F45\tab NO-M-ARR\tab 07DA
   1 \par NEXT_CHAR\tab EQU\tab 20H
   1 \par NEXT_2NUM\tab EQU\tab 1C79H
   1 \par NEXT-CHAN\tab 10E7\tab NEXTNUM\tab 01A5\tab NMINT-SRV\tab 0660\tab NO-AUTO\tab 0A52
   1 \par NEWVAR\tab EQU\tab 30H
   1 \par NEWVARS\tab 0030\tab NEXT-CHAN\tab 102A\tab NEXTNUM\tab 01A5\tab NMINT-SRV\tab 0066
   1 \par NET-STATE\tab 0FBC\tab NEW-BUFF\tab 123D\tab NEW-NAME\tab 18ED\tab NEWVARS\tab 0030
   1 \par NCHAN-OUT\tab 0D6C\tab NET-STATE\tab 0F03\tab NEW-BUFF\tab 1162\tab NEW-NAME\tab 14FC
   1 \par N2\tab 23789 5CED\tab HD-11\tab Autostart line number (+FFFF if no autostart), or
   1 \par N2\tab 23788 5CE4
   1 \par N2\tab 23787 5CEB\tab HD-0F\tab Program length (without variables), or array name.
   1 \par N2\tab 23785 5CE9\tab HD-0D\tab Data block start address.
   1 \par N2\tab 23778 5CE2\tab N-STR2\tab See N-STR1.
   1 \par N2\tab 23774 5CDE\tab D-STR2\tab Start of 2nd 8-byte file specifier, used by MOVE
   1 \par N2\tab 23772 5CDC\tab \tab Filename start address.
   1 \par N2\tab 23770 5CDA\tab N-STR1\tab Filename length
   1 \par N2\tab 23766 5CD6\tab D-STR1\tab Start of first 8-byte file specifier; drive number
   1 \par N2\tab 23755 5CCB\tab CHADD-\tab Temporary store for CH-ADD.
   1 \par N2\tab 23753 5CC9\tab SECTOR\tab Counter of sectors examined during Microdrive
   1 \par N2\tab 23751 5CC7\tab SER-FL\tab Low byte may be 00 or 01; high byte holds a received
   1 \par N1\tab 23782 5CE6\tab HD-00\tab Start of workspace used by LOAD, SAVE, VERIFY and
   1 \par N1\tab 23777 5CE1\tab L-STR2\tab See L-STR1.
   1 \par N1\tab 23776 5CE0\tab S-STR2\tab See S-STR1.
   1 \par N1\tab 23769 5CD9\tab L-STR1\tab Device specifier "m", "n", "t" or "b".
   1 \par N1\tab 23768 5CD8\tab S-STR1\tab Stream number 0..15.
   1 \par N1\tab 23765 5CD5\tab NTCHS\tab Current header block checksum.
   1 \par N1\tab 23764 5CD4\tab NTDCS\tab Current data block checksum.
   1 \par N1\tab 23762 5CD2\tab NTTYPE\tab Packet type (00 for normal packets, 01 for EOF).
   1 \par N-STR1. A map area is created (unless it already exists), and its contents are setup according to the cartridge contents (the bits reset indicate 'free for use' sectors). Various flags are returned as follows:
   1 \par N-ACTIVE\tab 1051\tab N-INPUT\tab 0DA9\tab NCHAN-IN\tab 0DAF\tab NCHAN-OUT\tab 0E09
   1 \par More interesting to us, however, is what happens when a statement 'fails the syntax' (that is, is found to be syntactically incorrect) of both the main ROM and the Shadow ROM. When this happens, the Shadow ROM decides that it really has 
   1 \par Modified EDIT function: *E n
   1 \par Memory dump: *L n
   1 \par Main program
   1 \par MRG-SYN\tab 08A8\tab N-ACTIVE\tab 0F94\tab N-INPUT\tab 0D0C\tab NCHAN-IN\tab 0D12
   1 \par MOVE-OUT\tab 1827\tab MOVE-RUN\tab 1AB0\tab MOVE-SYN\tab 053D\tab MRG-SYN\tab 08AC
   1 \par MOVE-NA\tab 1CD8\tab MOVE-OUT\tab 1423\tab MOVE-RUN\tab 1E6B\tab MOVE-SYN\tab 053D
   1 \par MK-BLK\tab 1C4D\tab MOVE\tab 17F5\tab MOVE-EOF\tab 1832\tab MOVE-NA\tab 1CDE
   1 \par MISSING-D\tab 0494\tab MK-BLK\tab 1C53\tab MOVE\tab 13F1\tab MOVE-EOF\tab 142E
   1 \par MICRODRIVE AND INTERFACE I MANUAL (Sinclair Research Ltd.)
   1 \par MCHAN-OUT\tab 12B3\tab MERGE-BLK\tab 096B\tab MERGE-END\tab 09A4\tab MISSING-D\tab 0494
   1 \par MCHAN-IN\tab 112C\tab MCHAN-OUT\tab 11D8\tab MERGE-BLK\tab 0967\tab MERGE-END\tab 09A0
   1 \par MAKE-PERM\tab 1AE9\tab MAKESURE\tab 0FCA\tab MARK-FREE\tab 1C40\tab MCHAN-IN\tab 1207
   1 \par MAIN-ROM\tab 0000\tab MAKE-PERM\tab 1B0D\tab MAKESURE\tab 0F15\tab MARK-FREE\tab 1C46
   1 \par Look for any channel that uses the same map as that of the channel deleted.
   1 \par LVBN-END\tab 0A93\tab M-AGAIN\tab 1818\tab M-INPUT\tab 11FD\tab MAIN-ROM\tab 0000
   1 \par LV-N\tab 0A72\tab LVBN-END\tab 0A8F\tab M-AGAIN\tab 1414\tab M-INPUT\tab 1122
   1 \par LV-B\tab 0A79\tab LV-BN\tab 0A6A\tab LV-BN-E\tab 0A7E\tab LV-MCH\tab 15A9
   1 \par LV-BN\tab 0A6E\tab LV-BN-E\tab 0A82\tab LV-MCH\tab 199A\tab LV-N\tab 0A76
   1 \par LPRINT\tab EQU\tab 0E0H
   1 \par LP-SCOUT\tab 1015\tab LPEND\tab 14A6\tab LV-ANY\tab 0A60\tab LV-B\tab 0A7D
   1 \par LP-P-MAP\tab 1DE5\tab LP-SCOUT\tab 0F58\tab LPEND\tab 13C1\tab LV-ANY\tab 0A5C
   1 \par LOAD-SYN\tab 0898\tab LOOK-MAP\tab 19EA\tab LP-B-MAP\tab 1DF4\tab LP-P-MAP\tab 1DF0
   1 \par LOAD-RUN\tab 0A95\tab LOAD-SYN\tab 0894\tab LOOK-MAP\tab 15F9\tab LP-B-MAP\tab 1DE9
   1 \par LINE\tab EQU\tab 0CAH
   1 \par LD-VF-MR\tab 08B3\tab LINE\tab 073E\tab LINE-LEN\tab 0144\tab LOAD-RUN\tab 0A99
   1 \par LD-VE-M\tab 1648\tab LD-VF-MR\tab 08AF\tab LINE\tab 073E\tab LINE-LEN\tab 0144
   1 \par LD-NO-PGM\tab 0966\tab LD-PR-AR\tab 09A7\tab LD-PROG\tab 09B9\tab LD-VE-M\tab 1A39
   1 \par LD-HEADER\tab 08D8\tab LD-NO-PGM\tab 0962\tab LD-PR-AR\tab 09A3\tab LD-PROG\tab 09B5
   1 \par LD-HD-NET\tab 08E4\tab LD-HD-RS\tab 08EB\tab LD-HDR-2\tab 08F0\tab LD-HEADER\tab 08DC
   1 \par LD-DATA\tab 080E\tab LD-HD-NET\tab 08E0\tab LD-HD-RS\tab 08E7\tab LD-HDR-2\tab 08EC
   1 \par LD-BLK-4\tab 0956\tab LD-BLK-5\tab 095D\tab LD-BLOCK\tab 091D\tab LD-DATA\tab 080E
   1 \par LD-BLK-3\tab 0941\tab LD-BLK-4\tab 0952\tab LD-BLK-5\tab 0959\tab LD-BLOCK\tab 0919
   1 \par L-STR1 during runtime. If a separator is present after the single character string, then the routine continues into EXPT-NUM.
   1 \par KBD-TEST\tab 1EF5\tab LCHAN\tab 1482\tab LD-BLK-2\tab 0936\tab LD-BLK-3\tab 0945
   1 \par Jumps to the required routine to deal with 'new' report messages. This routine can be called by using a RST\tab 20 instruction followed by the error code (in the range +FF...+16).
   1 \par January 1985.
   1 \par It is this 'second chance' that makes it possible for the new BASIC commands provided by the Interface 1 t
   1 \par Initially the syntax of the new command is checked; CH_ADD 
   1 \par In using hook codes, only the contents of the A register may be passed to the subroutines being called. The subroutines do not preserve any registers, so be sure to save all of the main set of reg
   1 \par In this case, you must take care that the output of the catalogue will not requi
   1 \par If you should find that your Interface 1 contains a ROM which differs from both the edition 1 and the edition 2 Shadow ROM, then the code to implement the extended BASIC commands that is given in this book will not work. This is because the code that we h
   1 \par If you have some difficulty in choosing the correct 'a' and 'b' values, you may calculate them as shown below:
   1 \par If you have an edition 2 ROM, then turn to Appendix 10 on page 161 if you have an assembler, or Appendix 9 on page 157 if you don't, for instructions on how to add the new BASIC commands to your Spectrum.
   1 \par If you find you have an edition 1 ROM in your Interface 1, you will find instructions on how to add the new commands to Basic on page 11 for those who have an assembler, or on page 7 for those who don't have access to an assembler.
   1 \par If you do not have an Assembler, you may enter the routines into your Spectrum with the following BASIC loader program.
   1 \par If this prints out a '0', then you have an edition 1 Interface 1. if it prints out '80', you have an edition 2 Interface 1.
   1 \par If there are no parameters (i.e. BASIC program), the syntax checking ends here.
   1 \par If the token is SCREEN$, the parameters are entered directly into the system variables.
   1 \par If the stream(s) specified in the command is not opened, the error "invalid stream" will occur. "Invalid device expression" will occur if the stream is not attached to an "m" channel; "Reading a 'write' file" will occur if the channel is opened for writin
   1 \par If the record is not found, or if any reading error occurs, the error 'File not found' will be reported. The listing of the routine follows.
   1 \par If the pseudo-map contains at least one bit set, there are other records to be erased.
   1 \par If the new variables already exist, bit 1 of FLAGS3 is reset.
   1 \par If the file loaded is a program, the space required is to be crested and some actions to be performed.
   1 \par If the current sector is not 'free', then the name of the file held in it is to be collected and inserted in alphabetical order into the data buffer of the "m" channel. Names starting with CHR$ 0 are refused.
   1 \par If the command that has produced the error was none of these, a jump is made to the address held in VECTOR system variable.
   1 \par If the buffer is filled, the routine continues into WR-RECD below.
   1 \par If nothing is printed after the filename, then the file is a normal BASIC program saved without the autostart.
   1 \par If no data is found in the buffer, consider whether this data block is the last one.
   1 \par If no channel uses the map used by the deleted one, it is to be deleted too.
   1 \par If all bytes in the data block have been read, a check is made to see if it is the 'end of file' block, i.e. the last one.
   1 \par IN_CHK\tab EQU\tab 1E3EH
   1 \par INTRODUCTION
   1 \par INT-SERV\tab 0038\tab KBD-TEST\tab 1A01\tab LCHAN\tab 139D\tab LD-BLK-2\tab 0932
   1 \par INPAK-2\tab 105A\tab INPAK-L\tab 105B\tab INS-NAME\tab 1CDA\tab INT-SERV\tab 0038
   1 \par INPAK-2\tab 0F9D\tab INPAK-L\tab 0F9E\tab INPUT-END\tab 0CE1\tab INS-NAME\tab 1CD4
   1 \par INCREC\tab 1A14\tab INK$-END\tab 0D01\tab INKEY$\tab 0CFB\tab INPAK\tab 0F92
   1 \par INC-BLKN\tab 0E9A\tab INCREC\tab 1F08\tab INKEY$\tab 0D98\tab INPAK\tab 104F
   1 \par IN-CHK\tab 1E3E\tab IN-M-BLK\tab 18DE\tab IN-NAME\tab 1C85\tab INC-BLKN\tab 0DFD
   1 \par IN-AGAIN\tab 0D78\tab IN-CHK\tab 1E49\tab IN-M-BLK\tab 1633\tab IN-NAME\tab 1C8B
   1 \par IDE5 LP-P-MAP\tab LD\tab A,(HL)\tab Fetch pseudo-map byte.
   1 \par I. Logan, SPECTRUM MICRODRIVE BOOK (Melbourne House)
   1 \par I. Logan, F. O'Hara, THE COMPLETE SPECTRUM ROM DISASSEMBLY (Melbourne House)
   1 \par I should like, finally, to thank Massimiliano, Carlo, Giovanna, Sylvia, and Mr. Alfred Milgrom (of Melbourne House Ltd.). A special thanks must go to the entire staff of Sinclair Research Ltd.
   1 \par I feel that this book should be of interest to all users of the Interface 1. Those without experience in machine code programming can use the new BASIC commands provided, whether or not they own an assembler. More ambitious programmers will find numerous 
   1 \par Here is the new BASIC loader program, changed to run with the new shadow ROM. To enter the new BASIC commands into your Spectrum without using an assembler, enter the following BASIC loader program.
   1 \par HOOK32\tab EQU\tab 32H
   1 \par HOOK31\tab EQU\tab 31H
   1 \par HOOK-32\tab 19A4\tab HOOK-CODE\tab 1981\tab I-AGAIN\tab 141A\tab IN-AGAIN\tab 0CDB
   1 \par HOOK-31\tab 1E98\tab HOOK-32\tab 1E94\tab HOOK-CODE\tab 1E71\tab I-AGAIN\tab 181E
   1 \par HD_11\tab EQU\tab 5CEDH
   1 \par HDNUMB\tab EQU\tab 29H
   1 \par HD-LOOP\tab 0854\tab HEX-LINE\tab 1ECE\tab HEX-LINE2\tab 1ED3\tab HOOK-31\tab 19A8
   1 \par Gianluca Carri
   1 \par G_HD_RC\tab EQU\tab 11A5H
   1 \par GT_M_BLK\tab EQU\tab 18ADH
   1 \par GP-ERROR\tab 1F3A\tab HD-LOOP\tab 0854\tab HEX-LINE\tab 151D\tab HEX-LINE2\tab 1522
   1 \par GET_R_LP\tab EQU\tab 1184H
   1 \par GET_M_HD2\tab EQU\tab 12C4H
   1 \par GET_CHAR\tab EQU\tab 18H
   1 \par GET-RECD\tab 1177\tab GETNB-END\tab 0E62\tab GETNBF-END\tab 0EA1\tab GP-ERROR\tab 1A46
   1 \par GET-R-LP\tab 125F\tab GET-RECD\tab 1252\tab GETBF-END\tab 0F3E\tab GETNB-END\tab 0EFF
   1 \par GET-NBUFF\tab 0E65\tab GET-PACK\tab 1A31\tab GET-R-2\tab 117D\tab GET-R-LP\tab 1184
   1 \par GET-NBLK\tab 0EB5\tab GET-NBUFF\tab 0F02\tab GET-PACK\tab 1F25\tab GET-R-2\tab 1258
   1 \par GET-M-HD\tab 18A3\tab GET-M-HD2\tab 12C4\tab GET-N-BUF\tab 0D3F\tab GET-NBLK\tab 0E18
   1 \par GET-M-BUF\tab 15EB\tab GET-M-HD\tab 15E2\tab GET-M-HD2\tab 13A9\tab GET-N-BUF\tab 0DDC
   1 \par G-REC-ERR\tab 12B1\tab G-TYPE\tab 07F6\tab GET-DESC\tab 1FE4\tab GET-M-BLK\tab 15F2
   1 \par G-REC-ERR\tab 11D6\tab G-TYPE\tab 07F6\tab GET-M-BLK\tab 18AD\tab GET-M-BUF\tab 18A9
   1 \par For more information about the hook codes and the ZX Interface 1, see the 'Spectrum Microdrive Book' by Dr. Ian Logan. also published by Melbourne House.
   1 \par For information on how to make the extended BASIC commands work with edition 3 or later Shadow ROMs, refer to Appendix 11, page 165.
   1 \par Florence, Italy,
   1 \par First, it has a bug that may crash the system when attempting to CLOSE an unopened stream. This is because the CLOSE-2 routine at +1701 does not check whether the displacement data (found by STR-DATA, +171E) is +0000 (signalling a 
   1 \par First the various system variables are properly set, then a nine-byte header is fetched from the first record of the program called 'run'. The routine continues
   1 \par First of all you'll have to figure out which edition of the Interface you own. Instructions on how to do this are given in Appendix 8 on page 155.
   1 \par Finally, the last byte received is stored into SER-FL, and the first one returned into the A register.
   1 \par Finally, the command code is fetched from the line, and if it is a 'new' command, the appropriate routine is called.
   1 \par Finally the routine to evaluate DATA parameters.
   1 \par Finally the CLOSE routine for the "m" channel.
   1 \par FREESECT\tab EQU\tab 1D38H
   1 \par FREESECT\tab 1D43\tab FRMT-SYN\tab 04B4\tab G-HD-RC\tab 1280\tab G-RDES\tab 1E5E
   1 \par FREESECT\tab 1D38\tab FRTM-SYN\tab 04B4\tab G-HD-RC\tab 11A5\tab G-RDES\tab 1E53
   1 \par FORMAT-1\tab 1B86\tab FR-S-LPB\tab 1D46\tab FR-S-RES\tab 1D4A\tab FR-SC-LP\tab 1D42
   1 \par FORMAT-1\tab 1B75\tab FR-S-LPB\tab 1D51\tab FR-S-RES\tab 1D55\tab FR-SC-LP\tab 1D4D
   1 \par FOR-B-T\tab 04CD\tab FOR-M\tab 04E7\tab FOR-RUN\tab 1E75\tab FORMAT\tab 1B6E
   1 \par FOR-B-T\tab 04CD\tab FOR-M\tab 04E7\tab FOR-RUN\tab 1ABA\tab FORMAT\tab 185D
   1 \par FND_INT1\tab EQU\tab 1E94H
   1 \par FLAGS\tab EQU\tab 01H
   1 \par FLAGS3\tab EQU\tab 7CH
   1 \par FIND_INT2\tab EQU\tab 1E99H
   1 \par FETCH-ERR\tab 026E\tab FILL-B-F\tab 1BBD\tab FILL-B-F2\tab 1BC1\tab FILL-MAP\tab 1094
   1 \par F-REC2\tab 1A5D\tab FAILED\tab 1362\tab FETCH-ERR\tab 0276\tab FILL-MAP\tab 1163
   1 \par F-N-SCT\tab 1CEE\tab F-REC1\tab 1666\tab F-REC2\tab 166C\tab FAILED\tab 127D
   1 \par F-HD-3\tab 198A\tab F-M-HEAD\tab 1971\tab F-N-SCT\tab 1CF4\tab F-REC1\tab 1A57
   1 \par F-ERROR\tab 168A\tab F-HD-2\tab 1591\tab F-HD-3\tab 1599\tab F-M-HEAD\tab 1580
   1 \par Extending the RS\emdash 232 channel
   1 \par Extending Spectrum BASIC
   1 \par Extended BASIC commands from assembler for edition 2 Shadow ROM
   1 \par Extended BASIC commands from assembler
   1 \par Exactly the opposite of the subroutine above: the 32 bytes at the top of the 
   1 \par Enter this program into your Spectrum.
   1 \par Enter here to deal with the INKEY$ function (a single character is returned).
   1 \par Each preamble is used to fetch the start of a block of data when reading from the Microdrive unit.
   1 \par E_PPC\tab EQU\tab 5C49H
   1 \par EXTENSIONS TO BASIC
   1 \par EXPT_NUM\tab EQU\tab 061EH
   1 \par EXPT_EXP\tab EQU\tab 1C8CH
   1 \par EXPT_1NUM\tab EQU\tab 1C82H
   1 \par EXPT-STR\tab 05E7\tab EXPT-STRM\tab 064E\tab F-ERROR\tab 1A7B\tab F-HD-2\tab 1982
   1 \par EXPT-PRMS\tab 0701\tab EXPT-SPEC\tab 05F2\tab EXPT-STR\tab 05E7\tab EXPT-STRM\tab 064E
   1 \par EXPT-NAME\tab 062F\tab EXPT-NUM\tab 061E\tab EXPT-PRMS\tab 0701\tab EXPT-SPEC\tab 05F2
   1 \par EXPT-EXP1\tab 06B9\tab EXPT-EXPR\tab 06A3\tab EXPT-NAME\tab 062F\tab EXPT-NUM\tab 061E
   1 \par EX-D-STR\tab 059F\tab EXISTING\tab 07F2\tab EXPT-EXP1\tab 06B9\tab EXPT-EXPR\tab 06A3
   1 \par EX-D-STR\tab 059F\tab EX-DSTR2\tab 14C7\tab EXISTING\tab 07F2\tab EXP-SPEC2\tab 05F5
   1 \par ERR_SP\tab EQU\tab 5C3DH
   1 \par ERR_NR\tab EQU\tab 00H
   1 \par ERR_6\tab EQU\tab 01F0H
   1 \par ERROR_1\tab EQU\tab 08H
   1 \par ERR-6\tab 01F0\tab ERR-RS\tab 13A3\tab ERR-V\tab 01EC\tab EX-CHANS\tab 17C0
   1 \par ERR-6\tab 01F0\tab ERR-RS\tab 12BE\tab ERR-V\tab 01EC\tab EX-CHANS\tab 17C2
   1 \par ERASE\tab 1D79\tab ERASE-1\tab 1D8A\tab ERASE-2\tab 1DC3\tab ERASE-LP\tab 1DA7
   1 \par ERASE\tab 1D6E\tab ERASE-1\tab 1D7F\tab ERASE-2\tab 1DB8\tab ERASE-LP\tab 1D9C
   1 \par ERASE-MK\tab 1E03\tab ERASE-MK2\tab 1E06\tab ERASE-RUN\tab 1AAB\tab ERASE-SYN\tab 0531
   1 \par ERASE-MK\tab 1DF8\tab ERASE-MK2\tab 1DFB\tab ERASE-RUN\tab 1E66\tab ERASE-SYN\tab 0531
   1 \par ENDHERE\tab 06CC\tab ENDRD\tab 16AD\tab ENTRY\tab 13C7\tab ENTRY-2\tab 17C0
   1 \par ENDC\tab 1E84\tab ENDHERE\tab 06CC\tab ENTRY\tab 12E2\tab ENTRY-2\tab 12E8
   1 \par END1\tab EQU\tab 05C1H
   1 \par END-SA-DR\tab 196A\tab END-SET\tab 0AE8\tab END1\tab 05C1\tab ENDC\tab 1AC9
   1 \par END-S-DEL\tab 0F8F\tab END-SA-DR\tab 1579\tab END-SET\tab 0AE4\tab END1\tab 05C1
   1 \par END-LD-PR\tab 0A13\tab END-PR-MS\tab 02B4\tab END-RS-IN\tab 0C34\tab END-S-DEL\tab 104C
   1 \par END-INPUT\tab 0CF7\tab END-LD-PR\tab 0A0F\tab END-PR-MS\tab 02AC\tab END-RS-IN\tab 0C36
   1 \par END-CODE\tab 07B8\tab END-DATA\tab 081C\tab END-EXPT\tab 0750\tab END-INPUT\tab 0D94
   1 \par ED_LOOP\tab EQU\tab 0F38H
   1 \par ED_ERROR\tab EQU\tab 107FH
   1 \par ED_EDIT\tab EQU\tab 0FA9H
   1 \par EACH-VAR\tab 0252\tab END-CODE\tab 07B8\tab END-DATA\tab 081C\tab END-EXPT\tab 0750
   1 \par E-READ-N\tab 100A\tab EACH-ST\tab 0152\tab EACH-VAR\tab 025A\tab EMIT-CH\tab 0C6C
   1 \par Doing the same thing with all the other Shadow ROM calls should make it possible for you to run all the extended BASIC commands. Note that the program, as it stands, fits into the very highest part of memory, with no room above it to spare. The code you w
   1 \par Does this mean that we can never rely on being able to write programs that can run on all machines? Far from it. Sinclair Rese
   1 \par DL-LOOP\tab 0E12\tab DR-READY\tab 18D2\tab E-READ-N\tab 0F4D\tab EACH-ST\tab 0152
   1 \par DISP_HEX\tab EQU\tab 1E87H
   1 \par DISP_CH\tab EQU\tab 1EA9H
   1 \par DISPHEX2\tab EQU\tab IE9EH
   1 \par DISP-HEX2\tab 14ED\tab DISP-NIB\tab 14DF\tab DL-LOOP\tab 0EAF\tab DR-READY\tab 1620
   1 \par DISP-CH\tab 1EA9\tab DISP-HEX\tab 1E87\tab DISP-HEX2\tab 1E9E\tab DISP-NIB\tab 1E90
   1 \par DEL_M_BUF\tab EQU\tab 10C4H
   1 \par DELAY_BC\tab EQU\tab 18FAH
   1 \par DELAY-BC1\tab 1653\tab DELAY-SC\tab 101A\tab DISP-CH\tab 14F8\tab DISP-HEX\tab 14D6
   1 \par DEL-S-1\tab 1867\tab DELAY-BC\tab 1BFA\tab DELAY-BC1\tab 18FB\tab DELAY-SC\tab 0F5D
   1 \par DEL-M-BUF\tab 119F\tab DEL-O-1\tab 1087\tab DEL-S-1\tab 15A2\tab DELAY-BC\tab 1652
   1 \par DEFLT-0\tab 079A\tab DEL-B-CT\tab 1A81\tab DEL-D-1\tab 0FCA\tab DEL-M-BUF\tab 10C4
   1 \par DEC_SECT\tab EQU\tab 1312H
   1 \par DEC-SECT\tab 13F7\tab DEFAULT\tab 0224\tab DEFLT-0\tab 079A\tab DEL-B-CT\tab 1F75
   1 \par DATA\tab EQU\tab 0E4H
   1 \par D-STR2 one, and vice-versa.
   1 \par D-STR1 holding the drive number and N-STR1 holding the length and the start of the filename, Note that H'L' is corrupted.
   1 \par Check if it is necessary to print the required report message.
   1 \par CR\tab EQU\tab 0DH
   1 \par CRT-VARS\tab 01F7\tab DATA\tab 07D2\tab DEC-SECT\tab 1312\tab DEFAULT\tab 0224
   1 \par CRT-NEW\tab 09F7\tab CRT-VARS\tab 01F7\tab CTRL-CD\tab 0C70\tab DATA\tab 07D2
   1 \par CONV-1\tab 1E98\tab COPYCHADD\tab 00FB\tab CP-NAME\tab 121F\tab CRT-NEW\tab 09F3
   1 \par CONS-OUT\tab 1EE0\tab CONV-1\tab 14E7\tab COPYCHADD\tab 00FB\tab CP-NAME\tab 1300
   1 \par COMMA\tab EQU\tab 2CH
   1 \par CODE\tab EQU\tab 0AFH
   1 \par CLS#-SYN\tab 0559\tab CODE\tab 0789\tab CONS-IN\tab 19D9\tab CONS-OUT\tab 19EC
   1 \par CLS#-SYN\tab 0559\tab CMM-LOOP\tab 0C92\tab CODE\tab 0789\tab CONS-IN\tab 1ECD
   1 \par CLOSEd stream). Thus a channel specifier is loaded from a wrong location (CHANS+3), and finally a call to the INDEXER routine is made to search for the (wrong) specifier into the 'stream look-up table', this will result in a system crash.
   1 \par CLOSE\tab EQU\tab 1718H
   1 \par CLOSE\tab 1718\tab CLOSE-CH\tab 1708\tab CLOSE-M\tab 138B\tab CLOSE-M2\tab 138E
   1 \par CLOSE\tab 1718\tab CLOSE-CH\tab 1708\tab CLOSE-M\tab 12A6\tab CLOSE-M2\tab 12A9
   1 \par CLOSE-NET\tab 1F18\tab CLR#-SYN\tab 057F\tab CLR-BUFF\tab 1FD4\tab CLR-ERR\tab 1E77
   1 \par CLOSE-NET\tab 1A24\tab CLR#-SYN\tab 057F\tab CLR-BUFF\tab 1AE0\tab CLR-ERR\tab 1987
   1 \par CL-N-CH\tab 175E\tab CL-RS-CH\tab 1751\tab CL-WORK\tab 01AA\tab CLAIMED\tab 0F21
   1 \par CL-M-CH\tab 176B\tab CL-N-CH\tab 175C\tab CL-WORK\tab 01AA\tab CLAIMED\tab 0FD9
   1 \par CHURCHL\tab EQU\tab 5C51H
   1 \par CHREC\tab EQU\tab 0DH
   1 \par CHKS_HD_R\tab EQU\tab 1341H
   1 \par CHKSYNTAX\tab 0018\tab CL-CHAN\tab 14A4\tab CL-CHK-N\tab 14B8\tab CL-M-CN\tab 176D
   1 \par CHKSYNTAX\tab 0018\tab CKNAM-END\tab 1423\tab CL-CHAN\tab 18A8\tab CL-CHK-N\tab 18BC
   1 \par CHKS1\tab 0E62\tab CHKS2\tab 0E71\tab CHKS3\tab 0EC4\tab CHKS4\tab 0F24
   1 \par CHKS1\tab 0DC5\tab CHKS2\tab 0DD4\tab CHKS3\tab 0E27\tab CHKS4\tab 0E87
   1 \par CHKNAM-END\tab 133E\tab CHKS-ALL\tab 1349\tab CHKS-BUFF\tab 1346\tab CHKS-HD-R\tab 1341
   1 \par CHKLOOP\tab 15FD\tab CHKS-ALL\tab 142E\tab CHKS-BUFF\tab 142B\tab CHKS-HD-R\tab 1426
   1 \par CHKEND\tab 015D\tab CHKEND-L\tab 0169\tab CHKEVEN\tab 0165\tab CHKLOOP\tab 18B3
   1 \par CHK-W-MAP\tab 1E3A\tab CHKEND\tab 015D\tab CHKEND-L\tab 0169\tab CHKEVEN\tab 0165
   1 \par CHK-SCT\tab 1C1B\tab CHK-TEMPM\tab 17D2\tab CHK-TEMPN\tab 17DE\tab CHK-W-MAP\tab 1E2F
   1 \par CHK-SCT\tab 1BF6\tab CHK-SCT2\tab 1C05\tab CHK-TEMPM\tab 17D0\tab CHK-TEMPN\tab 17DC
   1 \par CHK-NAME\tab 1403\tab CHK-NSECT\tab 1C1E\tab CHK-PRES\tab 154E\tab CHK-REST\tab 0FC7
   1 \par CHK-NAME\tab 131E\tab CHK-NSECT\tab 1C3E\tab CHK-PRES\tab 1813\tab CHK-REST\tab 0F0E
   1 \par CHK-LOOP\tab 10B3\tab CHK-LP-2\tab 160F\tab CHK-M-EOF\tab 1233\tab CHK-MAP-2\tab 13BF
   1 \par CHK-LOOP\tab 0FF6\tab CHK-LP-2\tab 18C0\tab CHK-M-EOF\tab 1158\tab CHK-MAP-2\tab 12DA
   1 \par CHFLAG\tab EQU\tab 18H
   1 \par CHECK_M_2\tab EQU\tab 066DH
   1 \par CHECK-SP\tab 0077\tab CHK-AG-2\tab 18BE\tab CHK-AGAIN\tab 18B1\tab CHK-FULL\tab 1264
   1 \par CHECK-SP\tab 0077\tab CHK-AG-2\tab 1608\tab CHK-AGAIN\tab 15F6\tab CHK-FULL\tab 1349
   1 \par CHECK-M-2\tab 066D\tab CHECK-MAP\tab 13C4\tab CHECK-N\tab 1883\tab CHECK-R\tab 188F
   1 \par CHECK-M-2\tab 066D\tab CHECK-MAP\tab 12DF\tab CHECK-N\tab 147F\tab CHECK-R\tab 148B
   1 \par CHDRIV\tab EQU\tab 19H
   1 \par CHBYTE\tab EQU\tab 0BH
   1 \par CHAN_OPEN\tab EQU\tab 1601H
   1 \par CAT\tab EQU\tab 0CFH
   1 \par CAT\tab 1C52\tab CAT-LP\tab 1C68\tab CAT-LP-E\tab 1C77\tab CAT-RUN\tab 1AB5
   1 \par CAT-SCRN\tab 04A6\tab CAT-SYN\tab 0486\tab CHAN-SPC\tab 10F1\tab CHECK-M\tab 0665
   1 \par CAT-SCRN\tab 04A6\tab CAT-SYN\tab 0486\tab CHAN-SPC\tab 1034\tab CHECK-H\tab 0665
   1 \par CALL-INP\tab 0CBD\tab CAT\tab 1C58\tab CAT-LP\tab 1C6E\tab CAT-RUN\tab 1E70
   1 \par CALBAS\tab EQU\tab 10H
   1 \par Bytes 55..91 may be collected (or written) as 'record descriptor', without affecting the data buffer starting from CHDATA.
   1 \par By using this routine, you may type simply '*E 4385' to do the same thing. The listing of the routine follows:
   1 \par Below is an alphabetical list of the labels related to the edition 2 shadow ROM.
   1 \par Before using the 'new' system variables from NTRESP to HD-11, their values
   1 \par Before each report there is the correspondent error code, incremented by 1.
   1 \par Before calling this routine, (ERR-NR) must contain the error code.
   1 \par Be careful that you choose the right length for your sound, as the the BREAK key will not work in the middle of a sound.
   1 \par Basic loader program for edition 2 Shadow ROM
   1 \par BREAK-PGM\tab 05E2\tab CALBAS\tab 0010\tab CALBAS-2\tab 0081\tab CALL-INP\tab 0D5A
   1 \par BREAK-PGM\tab 05E2\tab BRK-INOUT\tab 0CB4\tab CALBAS\tab 0010\tab CALBAS-2\tab 0081
   1 \par BF-FILLED\tab 1CFF\tab BORD-REST\tab 0D4D\tab BR-DELAY\tab 0EAC\tab BRCAST\tab 0EDD
   1 \par BF-FILLED\tab 1CF4\tab BORD-REST\tab 0CA9\tab BR-DELAY\tab 0E0F\tab BRCAST\tab 0E40
   1 \par BEEP\tab EQU\tab 0D7H
   1 \par BEEPER\tab EQU\tab 03B5H
   1 \par BD-DEL-2\tab 0D32\tab BD-DEL-3\tab 0D48\tab BD-DELAY\tab 0BD8\tab BD-DELAY2\tab 0C1D
   1 \par BD-DEL-2\tab 0C8E\tab BD-DEL-3\tab 0CA4\tab BD-DELAY\tab 0BDA\tab BD-DELAY2\tab 0C1F
   1 \par BCHAN_OUT\tab EQU\tab 0C5AH
   1 \par B-INPUT\tab 0B7C\tab BCHAN-IN\tab 0B88\tab BCHAN-OUT\tab 0D07\tab BD-DEL-1\tab 0D1C
   1 \par B-INPUT\tab 0B75\tab BCHAN-IN\tab 0B81\tab BCHAN-OUT\tab 0C5A\tab BD-DEL-1\tab 0C6F
   1 \par At this point, the shadow ROM has surely been paged-in by an error in the 'main' ROM.
   1 \par At this point all sectors that have been found 'usable' (marked with a reset bit in the map) are written with RECFLG and RECLEN zeroed, as to mark them 'working' for future use.
   1 \par Assuming that our current command is POKE *x,y, the 'main' ROM routine NEXT_2NUM is then used to evaluate two numeric expressions (separated by a comma), following the character pointed by CH_ADD. An error will occur if the 
   1 \par Assembler Listings
   1 \par As with the READ #S,N command, errors are reported if the stream 'S' is closed, or if it is opened with other than "m" channel, or with "m" channels opened for writing.
   1 \par As with the Microdrive channel, this area is addressed by using the IX index
   1 \par As with the "T" channel, the 'input' is handled by CALL-INP; however the service routine is BCHAN-IN.
   1 \par As with maskable interrupts, there are no service routines.
   1 \par As in the previous routine, this routine both 'checks' and 'executes' the command. All streams are closed in turn, with bit 1 of FLAGS3 set to signal
   1 \par Any stream +00 to +0F may be CLOSEd by loading the stream number into A and then calling this subroutine. The unsent bytes in 'write'-type files are sent or lost depending upon whether bit 1 of FLAGS3 is reset or set. First a call to 
   1 \par And the new commands should be available. Note that if you use NEW command, you must re\emdash enter the command 'RANDOMIZE USR 63744' to reinitialise the VECTOR system variable.
   1 \par An improved sound command: BEEP *a,b,c,d
   1 \par Although there are only two editions of the Shadow ROM at the moment, there is some possibility that Sinclair Research may release further editions of the Interface 1. Should you own one of these, it is likely that the extended BASIC 
   1 \par Although the task of extending the Spectrum's BASIC is quite complex a close study of the examples given in this book should be quite rewarding.
   1 \par Although the individual hook codes are dealt with in detail in the disassembly, here is a brief summary of their actions:
   1 \par Along with each filename the following information will appear:
   1 \par All readers of this book should at least glance through this section, as interspersed with the listings of the new commands are examples of their use, and explanations of their functions. A brief explanation of the manner in which new commands are added t
   1 \par All inputs from "B", "T", "N" and "M" channels are handled by loading HL with the address of the service 'input' routine for the channel, and then jumping to this routine. The routine handles both INPUT and INKEY$ commands referred to the 
   1 \par All bits in the map are made high; then the 'preambles' are collected from the table at +13E5 and stored in the channel.
   1 \par Again the syntax checking is handled by EXPT-PRMS.
   1 \par After the syntax of the 'new' commands has been checked, a jump is made here to confirm that the statement is finished. An error re
   1 \par After the 'insertion' of the new space has been made, the program continues here with the initialisation of some variables.
   1 \par After the 'insertion' of some space, the 'filenames' whose start addresses are held into (N-STR1+2) and (N-STR2+2) have been moved up in the workspace area. This routine is entered with HL holding the channel start address, and with BC 
   1 \par After some 'general purpose' commands come some more complicated routines that use the new Interface's devices. This routine adds a new command '* CAT n' that gives a full catalogue of a cartridge held in the microdrive 'n'.
   1 \par After having read the byte, a return is made here.
   1 \par Adding data to a file: RESTORE #S
   1 \par APPENDIX
   1 \par ALL-MOTRS\tab 1570\tab ALL-STRMS\tab 058E\tab ALLCHR-2\tab 1418\tab ALTER-OUT\tab 0CBB
   1 \par ALL-CHARS\tab 1322\tab ALL-MOTRS\tab 1835\tab ALL-STRMS\tab 058E\tab ALLCHR-2\tab 1333
   1 \par A string expression is evaluated and, provided that the length is within the range 1..10 characters, the 'length' and the 'start' of that string are stored into N-STR1 and (N-STR1 + 2).
   1 \par A single numeric expression is evaluated and the result, in the range 0..15, is stored into S-STR1 variable during runtime.
   1 \par A simple \lquote double POKE\rquote  routine: POKE * x,y
   1 \par A return to the calling routine is made only if L-STR1 denotes the Microdrive device being used, and if D-STR1 holds a valid drive number.
   1 \par A return to the calling routine is made only if D-STR1 holds a valid station number in the range 0..64.
   1 \par A new data block is now read from the Microdrive unit.
   1 \par A further data block is to be received if the current data block is not the 'EOF' one.
   1 \par A faster and more complete catalogue: * CAT n
   1 \par A call to the subroutine EXPT-SPEC will evaluate the '"X";N', while the subroutine EXPT-NAME is used to evaluate the filename. A separator must be found between them.
   1 \par A call to the main ROM 'EXPT-EXP' (class-9A) subroutine is made, to evaluate a string expression. During runtime the parameters of the string (start and length) are returned in the DE and BC register pairs.
   1 \par A FORMAT command may have one of the following forms: FORMAT "m";n;"name" -FORMAT "b";n - FORMAT "t";n - FORMAT "n";n. This routine handles all forms and
   1 \par A 'response byte' is simply a byte +01 that is sent over the network to confirm that some data has been successfully received.
   1 \par A 'free' sector descriptor is written in all records of the file to be erased.
   1 \par A 'MOVE' command requires two sets of parameters, for the 'input' channel and for the 'output' channel. These parameters are stored respectively in the two areas D-STR1 and D-STR2.
   1 \par ;System variables
   1 \par ;Shadow ROM addresses
   1 \par ;Offsets
   1 \par ;Main ROM addresses
   1 \par ;Keywords
   1 \par ;Hook codes
   1 \par ;ASCII
   1 \par 9\tab +0253\tab Channel length.
   1 \par 9\tab +0114\tab Length of the channel.
   1 \par 82\tab CHDATA\tab Start of 512-byte buffer.
   1 \par 81\tab DESCHK\tab Checksum from RECFLG to DESCHK-l.
   1 \par 8.\tab The program continues looping back to (4) until the whole tape has been examined; this is done by comparing the current sector number against CHREC one.
   1 \par 7\tab +1122\tab Shadow ROM 'input' routine.
   1 \par 7\tab +0D9C\tab Shadow ROM 'Input' routine.
   1 \par 7\tab +0B75\tab Shadow ROM 'input' routine.
   1 \par 7\tab +0B6F\tab Shadow ROM 'input' routine.
   1 \par 71\tab RECNAM\tab 10-byte record name with trailing spaces.
   1 \par 7.\tab The filename and the various information are taken from the RDESC area and printed on the screen.
   1 \par 69\tab RECLEN\tab Number of bytes in the record (0..512).
   1 \par 68\tab RECNUM\tab Record number 0..255.
   1 \par 67\tab RECFLG\tab Bit 0 reset indicates that the received block is a record
   1 \par 6.\tab If the 'header' indicates 'free' sector, the appropriate map bit is reset and the program loops back to step (4)
   1 \par 5\tab +11D8\tab Shadow ROM 'output' routine.
   1 \par 5\tab +0D6C\tab Shadow ROM 'Output' routine.
   1 \par 5\tab +0C5A\tab Shadow ROM 'output' routine.
   1 \par 5\tab +0C3C\tab Shadow ROM 'output' routine.
   1 \par 594\tab DCHK\tab Buffer checksum.
   1 \par 55\tab -\tab 12 bytes of data preamble, as for the header; used to mark the
   1 \par 54\tab HDCHK\tab Checksum from HDFLAG to HDCHK-1.
   1 \par 4\tab 'T'\tab Channel specifier.
   1 \par 4\tab 'N'\tab Channel specifier ('N'+80H denotes a 'temporary' channel).
   1 \par 4\tab 'M'\tab Channel specifier ('M'+80H denotes a 'temporary' channel,
   1 \par 4\tab 'B'\tab Channel specifier.
   1 \par 44\tab HDNAME\tab 10-byte cartridge name with trailing spaces.
   1 \par 42\tab -\tab Unused
   1 \par 41\tab HDNUMB\tab Sector number from which the header comes.
   1 \par 40\tab HDFLAG\tab Bit 0 set indicates that the received block is a header.
   1 \par 4.\tab The channel is marked 'write channel'.
   1 \par 4.\tab RS232 "B" CIANNEL
   1 \par 4.\tab A 'header' is loaded from the cartridge into the "m" channel header area.
   1 \par 3.\tab The current sector number is stored into CHREC.
   1 \par 3.\tab That record is erased from the cartridge.
   1 \par 3.\tab RS232 "T" CHANNEL
   1 \par 2\tab 23747 5CC3\tab BAUD\tab Timing constant used during RS232 i/o.
   1 \par 2\tab +0008\tab Main ROM 'Input' routine.
   1 \par 28\tab -\tab 12 bytes of header preamble (ten zeros and two +FF). Used to
   1 \par 26\tab CHMAP\tab Address of microdrive map.
   1 \par 25\tab CHDRIV\tab Drive number 1..8.
   1 \par 24\tab CHFLAG\tab Bit 0 set indicates a 'write' channel.
   1 \par 21\tab NCB\tab 255-byte data buffer.
   1 \par 20\tab NCIBL\tab Number of bytes in the buffer during 'output' (holds zero if
   1 \par 2.\tab The required Microdrive is turned on.
   1 \par 1\tab 23791 5CEF\tab COPIES\tab Number of copies made by SAVE. Reset to +01 after
   1 \par 1\tab 23759 5CCF\tab NTSRCE\tab Station number of 'sending' Spectrum for the current
   1 \par 1\tab 23759 5CC6\tab IOBORD\tab Border colour used during I/O; normally 0 (black)
   1 \par 1\tab 23758 5CCE\tab NTDEST\tab Start of network buffer; destination station number
   1 \par 1\tab 23757 5CCD\tab NTRESP\tab Store for network response code +01.
   1 \par 1\tab 23749 5CC5\tab NTSTAT\tab Network own station number 1..64.
   1 \par 1SF7\tab \tab POP\tab AF\tab Restore character.
   1 \par 1EEl\tab \tab POP\tab HL
   1 \par 1EE3...1FFF\tab Unused locations (all set to +FF).
   1 \par 1EE2\tab \tab RET\tab \tab Finished.
   1 \par 1EE0\tab \tab POP\tab BC
   1 \par 1EDF\tab \tab POP\tab AF\tab Restore registers.
   1 \par 1EDC\tab \tab CALL\tab 1EA9,DISP-CH
   1 \par 1EDA\tab \tab LD\tab A,+0D\tab Finally print a carriage return.
   1 \par 1ED8\tab \tab DJNZ\tab 1ED3,HEX-LINE2\tab Loop for all l0 bytes.
   1 \par 1ED7\tab \tab INC\tab HL\tab Point to next byte.
   1 \par 1ED4\tab \tab CALL\tab 1E9E,DISP-HEX2\tab Display it in hex and follow with a
   1 \par 1ED3\tab HEX-LINE2\tab LD\tab A,(HL)\tab Fetch a byte.
   1 \par 1ED3\tab HEX-LINE2
   1 \par 1ED1\tab \tab LD\tab B,+0A\tab Counts 10 bytes.
   1 \par 1ED0\tab \tab PUSH\tab AF
   1 \par 1ECF\tab \tab PUSH\tab BC
   1 \par 1ECE\tab HEX-LINE\tab PUSH\tab HL\tab Save registers.
   1 \par 1ECE HEX-LINE
   1 \par 1ECD\tab \tab RET
   1 \par 1ECC\tab \tab POP\tab HL
   1 \par 1ECB\tab \tab POP\tab DE
   1 \par 1ECA\tab \tab POP\tab BC
   1 \par 1EC9\tab \tab POP\tab AF
   1 \par 1EC8\tab \tab EXX\tab \tab Restore normal registers.
   1 \par 1EC7\tab \tab POP\tab HL
   1 \par 1EC6\tab \tab POP\tab DE
   1 \par 1EC5\tab \tab POP\tab BC
   1 \par 1EC4\tab \tab POP\tab AF\tab Restore alternate registers.
   1 \par 1EC1\tab \tab LD\tab (CURCHL),A
   1 \par 1EC0\tab \tab POP\tab HL\tab Restore old channel address.
   1 \par 1EBE\tab \tab DEFW\tab +0010\tab character.
   1 \par 1EBD\tab \tab RST\tab 10,CALBAS\tab Call PRINT-A restart to print the
   1 \par 1EBC\tab \tab POP\tab AF\tab Restore character.
   1 \par 1EBA\tab \tab DEFW\tab +1601
   1 \par 1EB9\tab \tab RST\tab 10,CALBAS\tab Call CHAN-OPEN to select the stream.
   1 \par 1EB7\tab \tab LD\tab A,+02\tab Select stream 2 (screen).
   1 \par 1EB6\tab \tab PUSH\tab AF\tab Save character to be printed.
   1 \par 1EB5\tab \tab PUSH\tab HL
   1 \par 1EB2\tab \tab LD\tab HL,(CURCHL)\tab Save also current channel address.
   1 \par 1EB1\tab \tab PUSH\tab AF
   1 \par 1EB0\tab \tab PUSH\tab BC
   1 \par 1EAF\tab \tab PUSH\tab DE
   1 \par 1EAE\tab \tab PUSH\tab HL
   1 \par 1EAD\tab \tab EXX\tab \tab Save alternate registers.
   1 \par 1EAC\tab \tab PUSH\tab AF
   1 \par 1EAB\tab \tab PUSH\tab BC
   1 \par 1EAA\tab \tab PUSH\tab DE
   1 \par 1EA9\tab DISP-CH\tab PUSH\tab HL\tab Save registers.
   1 \par 1EA9 DISP-CH
   1 \par 1EA8\tab \tab RET\tab \tab Finished.
   1 \par 1EA7\tab \tab POP\tab AF\tab Restore A.
   1 \par 1EA4\tab \tab CALL\tab 1EA9,DISP-CH
   1 \par 1EA2\tab \tab LD\tab A,+20\tab Follow with a space.
   1 \par 1E9F\tab \tab CALL\tab 1E87,DISP-HEX\tab Print the hex number.
   1 \par 1E9E\tab DISP-HEX2\tab PUSH\tab AF\tab Save A register.
   1 \par 1E9E DISP-HEX2
   1 \par 1E9D\tab \tab RET\tab \tab Finished.
   1 \par 1E9A\tab \tab CALL\tab 1EA9,DISP-CH\tab Print the digit.
   1 \par 1E98\tab CONV-1\tab ADD\tab A,+30\tab Add offset for ASCII code.
   1 \par 1E98\tab CONV-1\tab 1E9E\tab DISP-HEX2\tab 1EA9\tab DISP-CH\tab 1ECE\tab HEX-LINE
   1 \par 1E96\tab \tab ADD\tab A,+07\tab Otherwise add +07 to reach the code of
   1 \par 1E94\tab \tab JR\tab C,1E98,CONV-1
   1 \par 1E92\tab \tab CP\tab +0A\tab Jump if the value is lower than 9.
   1 \par 1E90\tab DISP-NIB\tab AND\tab +0F\tab Clear left nibble.
   1 \par 1E8F\tab \tab POP\tab AF\tab Restore value.
   1 \par 1E8C\tab \tab CALL\tab 1E90,DISP-NIB\tab Print the first digit.
   1 \par 1E8B\tab \tab RRA
   1 \par 1E8A\tab \tab RRA
   1 \par 1E89\tab \tab RRA
   1 \par 1E88\tab \tab RRA\tab \tab Shift left nibble to right.
   1 \par 1E87\tab DISP-HEX\tab PUSH\tab AF\tab Save A register.
   1 \par 1E87 DISP-HEX
   1 \par 1E84\tab ENDC\tab JP\tab 05Cl,END1
   1 \par 1E82\tab \tab JR\tab 1E84,ENDC
   1 \par 1E7F\tab SAVE-RUN\tab CALL\tab 14DA,SA-DRIVE
   1 \par 1E7F\tab SAVE-RUN\tab 1E84\tab ENDC\tab 1E87\tab DISP-HEX\tab 1E90\tab DISP-NIB
   1 \par 1E7D\tab \tab JR\tab 1E84,ENDC
   1 \par 1E7A\tab OP-RUN\tab CALL\tab 1AF0,OP-M-STRM
   1 \par 1E78\tab \tab JR\tab 1E84,ENDC
   1 \par 1E75\tab FOR-RUN\tab CALL\tab 1B6E,FORMAT
   1 \par 1E73\tab \tab JR\tab 1E84,ENDC
   1 \par 1E70\tab CAT-RUN\tab CALL\tab 1C58,CAT
   1 \par 1E6E\tab \tab JR\tab 1E84,ENDC
   1 \par 1E6B\tab MOVE-RUN\tab CALL\tab 13F1,MOVE
   1 \par 1E6B\tab MOVE-RUN\tab 1E70\tab CAT-RUN\tab 1E75\tab FOR-RUN\tab 1E7A\tab OP-RUN
   1 \par 1E69\tab \tab JR\tab 1E84,ENDC
   1 \par 1E66\tab ERASE-RUN\tab CALL\tab 1D6E,ERASE
   1 \par 1E66 Calls to the command routines
   1 \par 1E65\tab \tab RET\tab \tab is a header.
   1 \par 1E61\tab \tab BIT\tab 0,(RECFLG)\tab Return with zero flag reset if this
   1 \par 1E60\tab \tab RET\tab NZ\tab Return if it is wrong.
   1 \par 1E5D\tab \tab CALL\tab 1341,CHKS-MD-R\tab Calculate new checksum.
   1 \par 1E5A\tab \tab CALL\tab 18A3,GET-M-HD\tab Fetch record descriptor.
   1 \par 1E59\tab \tab ADD\tab HL,DE
   1 \par 1E56\tab \tab LD\tab DE,+0043
   1 \par 1E55\tab \tab POP\tab HL
   1 \par 1E53\tab G-RDES\tab PUSH\tab IX\tab Make HL point to RECFLG.
   1 \par 1E53 Obtain record descriptor
   1 \par 1E52\tab \tab RET\tab \tab Finished.
   1 \par 1E4F\tab \tab CALL\tab 1341,CMKS-HD-R\tab Restore DESCHK checksum.
   1 \par 1E4E\tab \tab ADD\tab HL,DE
   1 \par 1E4B\tab \tab LD\tab DE,+0043
   1 \par 1E4A\tab \tab POP\tab HL
   1 \par 1E48\tab \tab PUSH\tab IX\tab Make HL point to RECFLG.
   1 \par 1E45\tab \tab LD\tab (RECLEN-hi),A
   1 \par 1E42\tab \tab LD\tab (RECLEN-lo),A
   1 \par 1E3F\tab \tab LD\tab (RECFLG),A
   1 \par 1E3E\tab IN-CHK\tab XOR\tab A\tab Clear RECFLG and RECLEN.
   1 \par 1E3E Signal 'free sector'
   1 \par 1E3D\tab \tab RET\tab \tab Finished.
   1 \par 1E3A\tab \tab CALL\tab 10C4,DEL-M-BUF\tab Reclaim channel and map.
   1 \par 1E37\tab \tab CALL\tab 17F7,SEL-DRIVE
   1 \par 1E36\tab \tab XOR\tab A\tab Switch off drive motor.
   1 \par 1E34\tab \tab DJNZ\tab 1E2F,CHK-W-MAP\tab Loop for the whole map.
   1 \par 1E33\tab \tab INC\tab HL\tab Next location.
   1 \par 1E31\tab \tab JR \tab NZ,1DFB,ERASE-MK2 \tab (i.e. there are other records to be
   1 \par 1E30\tab \tab OR\tab A\tab Jump back if the byte is not zero
   1 \par 1E2F\tab CHK-W-MAP\tab LD \tab A,(HL) \tab Fetch a byte.
   1 \par 1E2F\tab CHK-W-MAP\tab 1E3E\tab IN-CHK\tab 1E53\tab G-RDES\tab 1E66\tab ERASE-RUN
   1 \par 1E2D\tab \tab LD\tab B,+20\tab Length of pseudo-map.
   1 \par 1E2C\tab \tab ADD\tab HL,DE
   1 \par 1E29\tab \tab LD\tab DE,+0052
   1 \par 1E28\tab \tab POP\tab HL
   1 \par 1E26\tab T-OTHER\tab PUSH\tab IX\tab Make HL point to the pseudo-map.
   1 \par 1E25\tab \tab LD\tab (HL),A
   1 \par 1E24\tab \tab AND\tab (HL)
   1 \par 1E23\tab \tab CPL
   1 \par 1E22\tab \tab LD\tab A,B\tab Reset the appropriate bit.
   1 \par 1E21\tab \tab POP\tab HL\tab address.
   1 \par 1E20\tab \tab POP\tab BC\tab Restore pseudo-map bit position and
   1 \par 1E1D\tab \tab CALL\tab 12FE,RES-B-MAP\tab \tab Reset map bit.
   1 \par 1E1B\tab \tab OUT\tab (+EF),A
   1 \par 1E19\tab \tab LD\tab A,+EE\tab Stop writing.
   1 \par 1E16\tab \tab CALL\tab 1878,OUT-M-BUF\tab \tab Write the 'free record' descriptor.
   1 \par 1E15\tab \tab ADD\tab HL,DE
   1 \par 1E12\tab \tab LD\tab DE,+0037
   1 \par 1E11\tab \tab POP\tab HL\tab preamble.
   1 \par 1E0F\tab \tab PUSH\tab IX\tab Make HL point to the data block
   1 \par 1E0C\tab \tab CALL\tab 18FA,DELAY-BC
   1 \par 1E09\tab \tab LD\tab BC,0168\tab Wait to insert part of the first gap.
   1 \par 1E07\tab \tab OUT\tab (+EF),A
   1 \par 1E05\tab \tab LD\tab A,+E6\tab Start writing.
   1 \par 1E04\tab \tab PUSH\tab BC
   1 \par 1E03\tab \tab PUSH\tab HL\tab \tab Save map bit address and position.
   1 \par 1E01\tab \tab JR\tab Z,1E26,T-OTHER\tab record to be erased.
   1 \par 1DFE\tab \tab CALL\tab 1306,TEST-PMAP\tab \tab Jump if this is not the header of a
   1 \par 1DFB\tab ERASE-MK2\tab CALL\tab 12C4,GET-M-HD2\tab \tab Fetch a header.
   1 \par 1DF8\tab ERASE-MK\tab CALL\tab 1E3E,IN-CHK\tab \tab Set 'free record' attributes.
   1 \par 1DF6\tab \tab JR\tab NZ,1D9C,ERASE-LP\tab Continue until all records have been
   1 \par 1DF5\tab \tab CP\tab E\tab Compare with number of records found.
   1 \par 1DF2\tab \tab LD\tab A,(CHREC)\tab Fetch number of records that composes
   1 \par 1DF0\tab \tab JR\tab NZ,1DE5,LP-P-MAP\tab Loop until the whole map has been
   1 \par 1DEF\tab \tab DEC\tab C\tab Decrement map length.
   1 \par 1DED\tab NOINC-C\tab 1DF8\tab ERASE-MK\tab 1DFB\tab ERASE-MK2\tab 1E26\tab T-OTHER
   1 \par 1DED NOINC-C\tab DJNZ\tab 1DE9,LP-B-MAP\tab Loop for all 8 bits.
   1 \par 1DEC\tab \tab INC\tab E\tab Otherwise increment counter.
   1 \par 1DEA\tab \tab JR\tab NC,1DED,NOINC-C
   1 \par 1DE9 LP-B-MAP\tab RRA\tab \tab Jump if this bit is reset.
   1 \par 1DE7\tab \tab LD\tab B,+08\tab Counts 8 bits.
   1 \par 1DE6\tab \tab INC\tab HL\tab Advance the pointer.
   1 \par 1DE3\tab \tab LD\tab C,+20\tab Length of the pseudo-map.
   1 \par 1DE1\tab \tab LD\tab E,+00\tab Clear E register.
   1 \par 1DE0\tab \tab ADD\tab HL,DE
   1 \par 1DDD\tab \tab LD\tab DE,+0052
   1 \par 1DDC\tab \tab POP\tab HL
   1 \par 1DDA TST-NUM\tab PUSH\tab IX\tab Make HL point to the 'pseudo-map'.
   1 \par 1DD7\tab \tab LD\tab (CHREC),A\tab number of sectors that composes the\tab 
   1 \par 1DD6\tab \tab INC\tab A\tab and store it into CHMREC, giving the
   1 \par 1DD3\tab \tab LD\tab A,(RECNUM)\tab Otherwise increment record number
   1 \par 1DD1\tab \tab JR\tab Z,1DDA,TST-NUN
   1 \par 1DCD\tab \tab BIT\tab 1,(RECFLG)\tab Jump if this is not the EOF block.
   1 \par 1DCC\tab \tab LD\tab (HL),A
   1 \par 1DCB\tab \tab OR\tab (HL)\tab Set the pseudo-map bit.
   1 \par 1DCA\tab \tab LD\tab A,B\tab Fetch bit position.
   1 \par 1DC7\tab \tab CALL\tab 1306,TEST-PMAP\tab Get position of pseudo-map bit.
   1 \par 1DC5\tab \tab JR\tab NZ,1DDA,TST-NUM\tab Jump if it does not equal.
   1 \par 1DC2\tab \tab CALL\tab 131E,CHK-NAME\tab Compare against CHNAME.
   1 \par 1DBF\tab \tab LD\tab BC,+000A\tab Counts ten characters in a name.
   1 \par 1DBE\tab \tab ADD\tab HL,DE
   1 \par 1DBB\tab \tab LD\tab DE,+0047
   1 \par 1DBA\tab \tab POP\tab HL
   1 \par 1DB8\tab ERASE-2\tab PUSH\tab IX\tab MAke HL point to RECNAM.
   1 \par 1DB8\tab ERASE-2\tab 1DDA\tab TST-NUM\tab 1DE5\tab LP-P-MAP\tab 1DE9\tab LP-B-MAP
   1 \par 1DB6\tab \tab JR\tab 1DDA,TST-NUM\tab Jump forward.
   1 \par 1DB3\tab \tab CALL\tab 12FE,RES-B-MAP\tab Otherwise reset map bit to indicate
   1 \par 1DB1\tab \tab JR\tab NZ,1DB8,ERASE-2
   1 \par 1DAC\tab \tab OR\tab (RECLEN-hi)
   1 \par 1DA9\tab \tab LD\tab A,(RECFLG)\tab Jump it this record is not 'tree'.
   1 \par 1DA7\tab \tab JR\tab NZ,1DDA,TST-NUM\tab Jump with any error.
   1 \par 1DA4\tab \tab CALL\tab 1E53,G-RDES\tab Fetch record descriptor.
   1 \par 1DA1\tab \tab CALL\tab 12C4,GET-M-HD2\tab Fetch a header.
   1 \par 1D9F\tab \tab JR\tab Z,1DF8,ERASE-MK\tab Make the ERASE when it reaches 0.
   1 \par 1D9C\tab ERASE-LP\tab CALL\tab 1312,DEC-SECT\tab Decrease SECTOR.
   1 \par 1D98\tab \tab LD\tab (SECTOR),BC\tab of the tape'.
   1 \par 1D95\tab \tab LD\tab BC,+04FB\tab SECTOR is initialised to 'five passes
   1 \par 1D92\tab \tab CD\tab (CHREC),A
   1 \par 1D8E\tab \tab LDIR\tab \tab Clear all locations.
   1 \par 1D8D\tab \tab LD\tab (HL),A
   1 \par 1D8C\tab \tab XOR\tab A\tab Clear the first location.
   1 \par 1D89\tab \tab LD\tab BC,+001F\tab Gap length - 1.
   1 \par 1D88\tab \tab INC\tab DE\tab Point to next location.
   1 \par 1D87\tab \tab POP\tab DE
   1 \par 1D86\tab \tab PUSH\tab HL\tab Copy this address into DE.
   1 \par 1D85\tab \tab ADD\tab HL,DE
   1 \par 1D82\tab \tab LD\tab DE,+0052
   1 \par 1D81\tab \tab POP\tab HL
   1 \par 1D7F\tab ERASE-1\tab PUSH\tab IX\tab Point to the data buffer.
   1 \par 1D7E\tab \tab DEFB\tab +0E
   1 \par 1D7D\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1D7B\tab \tab JR\tab NZ,107F,ERASE-1
   1 \par 1D79\tab \tab AND\tab +01\tab tab is present.
   1 \par 1D77\tab \tab IN\tab A,(+EF)\tab Continue only if the write-nrotect
   1 \par 1D74\tab \tab CALL\tab 17F7,SEL-DRIVE\tab Turn on drive motor.
   1 \par 1D71\tab \tab LD\tab A,(CHDRIV)\tab Fetch drive number.
   1 \par 1D6E\tab ERASE\tab CALL\tab 0FE8,SET-T-MCH\tab Set a temporary "m" channel.
   1 \par 1D6E ERASE command
   1 \par 1D6D\tab \tab RET\tab \tab Finished.
   1 \par 1D6B\tab \tab POP\tab IX\tab Restore channel base address.
   1 \par 1D69\tab \tab DEFW\tab +0010\tab character.
   1 \par 1D68\tab \tab RST\tab 10,CALBAS\tab Call restart 'PRINT-A' to print the
   1 \par 1D66\tab PRCHAR\tab PUSH\tab IX\tab Save channel base address.
   1 \par 1D66\tab PRCHAR\tab 1D6E\tab ERASE\tab 1D7F\tab ERASE-1\tab 1D9C\tab ERASE-LP
   1 \par 1D66 PRCHAR
   1 \par 1D65\tab \tab RET
   1 \par 1D64\tab \tab POP\tab BC
   1 \par 1D63\tab \tab POP\tab HL\tab Restore registers.
   1 \par 1D61\tab \tab DEFW\tab +0D4D
   1 \par 1D5F\tab \tab PUSH\tab HL\tab Save the pointer.
   1 \par 1D5C\tab \tab CALL\tab 1D66,PRCHAR
   1 \par 1D5A\tab \tab LD\tab A,+0D\tab Print a carriage return.
   1 \par 1D59 PRNAME
   1 \par 1D58\tab \tab DJNZ\tab 1D53,PRNM-LP\tab Loop until the whole name has been
   1 \par 1D57\tab \tab INC\tab HL\tab Increment pointer.
   1 \par 1D54\tab \tab CALL\tab 1D66,PRCHAR\tab Print it.
   1 \par 1D53\tab PRNM-LP\tab LD\tab A,(HL)\tab Fetch a character.
   1 \par 1D51\tab \tab LD\tab B,+0A\tab Counts 10 characters.
   1 \par 1D50\tab PRNAME\tab PUSH\tab BC\tab Save BC register.
   1 \par 1D4F\tab \tab RET\tab \tab Finished.
   1 \par 1D4D\tab \tab JR\tab NZ,1D42,FR-SC-LP
   1 \par 1D4C\tab \tab DEC\tab C\tab Repeat for all bytes in the map.
   1 \par 1D4A\tab FR-S-RES\tab DJNZ\tab 1D46,FR-S-LPB\tab Repeat for all 8 bits.
   1 \par 1D49\tab \tab INC\tab E\tab Otherwise increment counter.
   1 \par 1D47\tab \tab JR\tab C,14DA,FR-S-RES
   1 \par 1D46\tab FR-S-LPB\tab RRA\tab \tab Jump if this bit is set,
   1 \par 1D46\tab FR-S-LPB\tab 1D4A\tab FR-S-RES\tab 1D50\tab PRNAME\tab 1D53\tab PRNM-LP
   1 \par 1D44\tab \tab LD\tab B,+08\tab Loop for 8 bits.
   1 \par 1D43\tab \tab INC\tab HL\tab Advance the pointer.
   1 \par 1D42\tab FR-SC-LP\tab LD\tab A,(HL)\tab Fetch a byte from the map.
   1 \par 1D40\tab \tab LD\tab C,+20\tab Length of map.
   1 \par 1D3E\tab \tab LD\tab E,+00\tab Start with E cleared.
   1 \par 1D3B\tab \tab LD\tab H,(CHMAP-hi)
   1 \par 1D38\tab FREESECT\tab LD\tab L,(CHMAP-lo)\tab Fetch address of map.
   1 \par 1D38 FREESECT
   1 \par 1D37\tab \tab RET\tab \tab Finished.
   1 \par 1D34\tab \tab CALL\tab 10C4,DEL-M-BUF\tab Reclaim the channel.
   1 \par 1D32\tab \tab POP\tab IX\tab Restore channel start address.
   1 \par 1D2F\tab \tab CALL\tab 1D66,PRCHAR
   1 \par 1D2D\tab \tab LD\tab A,+0D\tab Print the final carriage return.
   1 \par 1D2B\tab \tab DEFW\tab +2DE3\tab kilobytes left.
   1 \par 1D2A\tab \tab RST\tab 10,CALBAS\tab Call PRINT-FP to print the number of
   1 \par 1D27\tab \tab CALL\tab 1D66,PRCHAR
   1 \par 1D25\tab \tab LD\tab A,+0D\tab Print a carriage return.
   1 \par 1D23\tab \tab DEFW\tab +2D28\tab the calculator stack.
   1 \par 1D22\tab \tab RST\tab 10,CALBAS\tab Call STACK-A to store this value on
   1 \par 1D20\tab \tab SRL\tab A\tab Divide by two, giving the kilobytes
   1 \par 1D1F\tab \tab LD\tab A,E\tab into A.
   1 \par 1D1C\tab NONAMES\tab CALL\tab 1D38,FREESECT\tab Calculate number of 'free' sectors
   1 \par 1D1A\tab \tab DJNZ\tab 1D17,OT-NAMS
   1 \par 1D17\tab OT-NAMS\tab CALL\tab 1D53,PRNAME\tab Print all filenames.
   1 \par 1D17\tab OT-NAMS\tab 1D1C\tab NONAMES\tab 1D38\tab FREESECT\tab 1D42\tab FR-SC-LP
   1 \par 1D15\tab \tab JR\tab Z,1D1C,NONAMES
   1 \par 1D14\tab \tab OR\tab A\tab stored.
   1 \par 1D13\tab \tab LD\tab A,B\tab Jump forward if no names have been
   1 \par 1D11\tab \tab LD\tab B,(CHREC)\tab Fetch number of stored names.
   1 \par 1D0F\tab \tab ADD\tab HL,DE
   1 \par 1D0C\tab \tab LD\tab DE,+0052
   1 \par 1D0B\tab \tab POP\tab HL
   1 \par 1D09\tab \tab PUSH\tab IX\tab Make HL point to the data buffer.
   1 \par 1D06\tab \tab CALL\tab 1D66,PRCHAR
   1 \par 1D04\tab \tab LD\tab A,+0D\tab Print a carriage return.
   1 \par 1D01\tab \tab CALL\tab 1D50,PRNAME\tab Print cartridge name.
   1 \par 1D00\tab \tab ADD\tab HL,DE
   1 \par 1CFD\tab \tab LD\tab DE,+002C
   1 \par 1CFC\tab \tab POP\tab HL
   1 \par 1CFA\tab \tab PUSH\tab IX\tab Make HL point to HDNAME.
   1 \par 1CF7\tab \tab CALL\tab 17F7,SEL-DRIVE
   1 \par 1CF6\tab \tab XOR\tab A\tab Switch off drive motor.
   1 \par 1CF4\tab BF-FILLED\tab PUSH\tab IX\tab Save channel base address.
   1 \par 1CF1\tab \tab JP\tab NZ,1C6E,CAT-LP\tab Repeat for all 255 sectors.
   1 \par 1CEE\tab F-N-SCT\tab CALL\tab 1312,BEC-SECT\tab Decrease SECTOR.
   1 \par 1CEC\tab \tab JR\tab Z,1CF4,BF-FILLED
   1 \par 1CEA\tab \tab CP\tab +32\tab Jump if 50 names have been collected
   1 \par 1CE7\tab \tab LD\tab (CHREC),A\tab Store new number.
   1 \par 1CE6\tab \tab INC\tab A\tab Include current name in the count.
   1 \par 1CE3\tab \tab LD\tab A,(CHREC)\tab Fetch number of names in the buffer.
   1 \par 1CE1\tab \tab POP\tab IX\tab Restore channel start address.
   1 \par 1CDF\tab \tab DJNZ\tab 1CB8,MOVE-NA\tab Loop until the whole name has been
   1 \par 1CDE\tab \tab INC\tab HL
   1 \par 1CDC\tab \tab INC\tab IX\tab Point to next location.
   1 \par 1CDB\tab \tab LD\tab (HL),A\tab Store in the buffer.
   1 \par 1CD8\tab MOVE-NA\tab LD\tab A,(IX+RECNAM)\tab Fetch a character from the name.
   1 \par 1CD6\tab \tab LD\tab B,+0A\tab Ten characters in a name.
   1 \par 1CD4\tab INS-NAME\tab PUSH\tab IX\tab Save channel start address.
   1 \par 1CD4\tab INS-NAME\tab 1CD8\tab MOVE-NA\tab 1CEE\tab F-N-SCT\tab 1CF4\tab BF-FILLED
   1 \par 1CD3\tab \tab POP\tab HL
   1 \par 1CD2\tab \tab POP\tab DE
   1 \par 1CD1\tab \tab POP\tab BC\tab Restore registers.
   1 \par 1CCF\tab \tab LDIR\tab \tab Move down the required names (leaving
   1 \par 1CCE\tab \tab EX\tab DE,HL
   1 \par 1CCD\tab \tab ADD\tab HL,DE
   1 \par 1CCC\tab \tab EX\tab DE,HL\tab Calculate into DE the address 'HL+10'.
   1 \par 1CCB\tab \tab ADD\tab HL,BC\tab of the last name.
   1 \par 1CCA\tab \tab DEC\tab HL\tab Make HL point to the last character
   1 \par 1CC9\tab \tab POP\tab HL\tab Restore address where the current
   1 \par 1CC8\tab \tab LD\tab C,L\tab to be moved.
   1 \par 1CC7\tab \tab LD\tab B,H\tab Move into BC the length of the block
   1 \par 1CC6\tab \tab ADD\tab HL,BC
   1 \par 1CC5\tab \tab ADD\tab HL,BC\tab (i.e. number of names * 10).
   1 \par 1CC4\tab \tab ADD\tab HL,BC\tab number of bytes to be moved down
   1 \par 1CC3\tab \tab ADD\tab HL,BC\tab Multiply this by 5, to get in HL the
   1 \par 1CC2\tab \tab LD\tab L,C
   1 \par 1CC1\tab \tab LD\tab H,B\tab Move result into HL (B holds 0).
   1 \par 1CBF\tab \tab SLA\tab C\tab Multiply by two the number of names
   1 \par 1CBE\tab \tab PUSH\tab HL
   1 \par 1CBD\tab \tab PUSH\tab BC
   1 \par 1CBC\tab \tab PUSH\tab DE
   1 \par 1CBB\tab ORD-NAM\tab PUSH\tab HL\tab Save registers.
   1 \par 1CB9\tab \tab JR\tab 1C9A,SE-NAME\tab Loop back.
   1 \par 1CB8\tab \tab DEC\tab C\tab Decrease number of names to be
   1 \par 1CB7\tab \tab ADD\tab HL,DE\tab Otherwise point to next name.
   1 \par 1CB5\tab \tab JR\tab NC,1CBB,ORD-NAM\tab Jump if the name is surely not in the
   1 \par 1CB3\tab \tab JR\tab Z,1CEE,F-N-SCT\tab Continue with next sector if the name
   1 \par 1CB2\tab \tab POP\tab HL
   1 \par 1CB1\tab \tab POP\tab IX
   1 \par 1CAF\tab T-NA-2\tab POP\tab BC\tab Restore registers.
   1 \par 1CAD\tab \tab DJNZ\tab 1CA4,T-NA-1\tab Loop until all the names have been
   1 \par 1CAB\tab \tab INC\tab IX
   1 \par 1CAA\tab \tab INC\tab HL\tab Point to next character,
   1 \par 1CA8\tab \tab JR\tab NZ,1CAF,T-NA-2\tab Jump if they do not match.
   1 \par 1CA5\tab \tab CF\tab (RECNAM)\tab Compare against RECNAM.
   1 \par 1CA4\tab T-NA-1\tab LD\tab A,(HL)\tab Fetch a character from buffer.
   1 \par 1CA2\tab \tab LD\tab B,+0A\tab Counts characters in a name.
   1 \par 1CA1\tab \tab PUSH\tab BC
   1 \par 1C9F\tab \tab PUSH\tab IX
   1 \par 1C9E\tab \tab PUSH\tab HL\tab Save registers.
   1 \par 1C9C\tab \tab JR\tab Z,1CD4,INS-NAME
   1 \par 1C9B\tab \tab OR\tab A\tab have been examined.
   1 \par 1C9A\tab SE-NAME\tab LD\tab A,C\tab Jump forward when all existing names
   1 \par 1C9A\tab SE-NAME\tab 1CA4\tab T-NA-1\tab 1CAF\tab T-NA-2\tab 1CBB\tab ORD-NAM
   1 \par 1C97\tab \tab LD\tab C,(CHREC)\tab Start with 'file count' cleared.
   1 \par 1C95\tab \tab LD\tab B,+00\tab B is initiallly cleared.
   1 \par 1C92\tab \tab LD\tab DE,+000A\tab Length of filename.
   1 \par 1C91\tab \tab ADD\tab HL,DE
   1 \par 1C8E\tab \tab LD\tab DE,+0052
   1 \par 1C8D\tab \tab POP\tab HL
   1 \par 1C8B\tab \tab PUSH\tab IX\tab Make HL point to the data buffer.
   1 \par 1C89\tab \tab JR\tab Z,1CEE,F-N-SCT\tab CHR$ 0.
   1 \par 1C88\tab \tab OR\tab A\tab Continue with next sector if this is
   1 \par 1C85\tab IN-NAME\tab LD\tab A,(RECNAM)\tab Fetch first character of file name.
   1 \par 1C83\tab \tab JR\tab 1CEE,F-N-SCT\tab Continue with next sector.
   1 \par 1C80\tab \tab CALL\tab 12FE,RES-B-MAP\tab Reset map bit if it is a 'free'
   1 \par 1C7E\tab \tab JR\tab NZ,1C85,IN-NAME\tab Jump if not a 'free' sector.
   1 \par 1C7C\tab \tab AND\tab +02\tab are reset (see comment after 1C43).
   1 \par 1C79\tab \tab OR\tab (RECLEN-hi)\tab bit 1 of both RECFLG and RECLEN-hi
   1 \par 1C76\tab \tab LD\tab A,(RECFLG)\tab The sector is 'free for use' when
   1 \par 1C74\tab \tab JR\tab NZ,1C6E,CAT-LP\tab Repeat until data is correct.
   1 \par 1C71\tab \tab CALL\tab 1E53,G-RDES\tab Fetch record descriptor.
   1 \par 1C6E\tab CAT-LP\tab CALL\tab 12C4,GET-M-HD2\tab Fetch a header.
   1 \par 1C6A\tab \tab LD\tab (SECTOR),BC
   1 \par 1C67\tab \tab LD\tab BC,+00FF\tab Pass through 255 sectors.
   1 \par 1C64\tab \tab CALL\tab 17F7,SEL-DRIVE\tab Turn on drive motor.
   1 \par 1C61\tab \tab LD\tab A,(CHDRIV)\tab Fetch drive number.
   1 \par 1C5E\tab \tab CALL\tab 0FE8,SET-T-MCH\tab Set a temporary "m" channel.
   1 \par 1C5C\tab \tab DEFW\tab +1601\tab specified stream.
   1 \par 1C5B\tab \tab RST\tab 10,CALBAS\tab Call CHAN-OPEN to select the
   1 \par 1C58\tab CAT\tab LD\tab A,(S-STR1)\tab Fetch stream number.
   1 \par 1C58 CAT command
   1 \par 1C56\tab \tab JR\tab 1C46,MARK-FREE\tab Jump back.
   1 \par 1C53\tab MK-BLK\tab CALL\tab 1275,SEND-BLK\tab Write data block in the next 'free'
   1 \par 1C53\tab MK-BLK\tab 1C58\tab CAT\tab 1C6E\tab CAT-LP\tab 1C85\tab IN-NAME
   1 \par 1C52\tab \tab RET\tab \tab Finished.
   1 \par 1C4F\tab \tab CALL\tab 10C4,DEL-M-BUF\tab Reclaim "m" channel and map.
   1 \par 1C4C\tab \tab CALL\tab 17F7,SEL-DRIVE
   1 \par 1C49\tab \tab JR\tab NZ,1C53,MK-BLK\tab are made set.
   1 \par 1C48\tab \tab XOR\tab A\tab Turn off drive motors.
   1 \par 1C46\tab MARK-FREE\tab CALL\tab 1264,CHK-FULL\tab Jump until all bits in the map
   1 \par 1C43\tab \tab CALL\tab 1E3E,IN-CHK\tab Initialise RECFLG, BECLEN, and DESCHK.
   1 \par 1C41\tab \tab JR\tab NZ,1C1B,CHK-SCT\tab Check all sectors.
   1 \par 1C3E\tab CHK-NSECT\tab CALL\tab 1312,DEC-SECT\tab Decrease SECTOR.
   1 \par 1C3B\tab \tab CALL\tab 12FE,RES-B-MAP\tab Reset map bit with usable sectorS.
   1 \par 1C39\tab \tab JR\tab NZ,1C3E,CHK-NSECT\tab Jump with faulty sectors.
   1 \par 1C36\tab \tab CALL\tab 1346,CHKS-BUFF\tab Calculate DCHK checksum.
   1 \par 1C35\tab \tab ADD\tab HL,DE\tab Start of data buffer.
   1 \par 1C32\tab \tab LD\tab DE,+000F\tab Make HL point to the data buffer.
   1 \par 1C30\tab \tab JR\tab NZ,1C3E,CHK-NSECT\tab Jump with faulty sectors.
   1 \par 1C2D\tab \tab CALL\tab 1341,CHKS-HD-R\tab Calculate DESCHK checksum.
   1 \par 1C2A\tab \tab CALL\tab 18A9,GET-M-BF\tab Fetch data block.
   1 \par 1C29\tab \tab ADD\tab HL,DE
   1 \par 1C26\tab \tab LD\tab DE,+0043
   1 \par 1C25\tab \tab POP\tab HL\tab workspace (i.e. RECFLG).
   1 \par 1C23\tab \tab PUSH\tab IX\tab Make HL point to start of data block
   1 \par 1C21\tab \tab JR\tab Z,1C3E,CHK-NSECT\tab examined sectors.
   1 \par 1C1E\tab \tab CALL\tab 12DF,CHECK-MAP\tab Check map bit and jump with
   1 \par 1C1B\tab CHK-SCT\tab CALL\tab 12C4,GET-H-HD2\tab Fetch a header.
   1 \par 1C17\tab \tab LD\tab (SECTOR),BC
   1 \par 1C14\tab \tab LD\tab BC,+00FF\tab Pass through 255 sectors,
   1 \par 1C11\tab \tab CALL\tab 17F7,SEL-DRIVE\tab Start motor.
   1 \par 1C0E\tab \tab LD\tab A,(CHDRIV)\tab Fetch drive number.
   1 \par 1C0C\tab \tab OUT\tab (+EF),A
   1 \par 1C0A\tab TEST-SCT\tab LD\tab A,+EE\tab Stop writing.
   1 \par 1C0A\tab TEST-SCT\tab 1C1B\tab CHK-SCT\tab 1C3E\tab CHK-NSECT\tab 1C46\tab MARK-FREE
   1 \par 1C08\tab \tab JR\tab 18D6,WR-F-TEST\tab Continue with next sector.
   1 \par 1C05\tab \tab CALL\tab 18E9,TEST-BRK\tab Give an error if BREAK has been
   1 \par 1C02\tab \tab CALL\tab 1BFA,DELAY-BC
   1 \par 1BFF\tab \tab LD\tab BC,+033F\tab Part of the second gap is created.
   1 \par 1BFC\tab \tab LD\tab A,B\tab Repeat until the counter reaches 0.
   1 \par 1BFC\tab \tab CALL\tab 1878,OUT-M-BUF\tab Write the data block.
   1 \par 1BFB\tab \tab ADD\tab HL,DE
   1 \par 1BFA\tab DELAY-BC\tab 18FB\tab DELAY-BC1\tab 1902\tab UNKN-1\tab 191C\tab UNKN-2
   1 \par 1BF8\tab \tab LD\tab DE,+0037
   1 \par 1BF7\tab \tab POP\tab HL
   1 \par 1BF5\tab \tab PUSH\tab IX\tab Make HL point to data block preamble.
   1 \par 1BF2\tab \tab CALL\tab 18FA,DELAY-BC
   1 \par 1BEF\tab \tab LD\tab BC,+01B2\tab Wait to create part of the first gap.
   1 \par 1BEC\tab \tab CALL 1872,OUT-M-HD\tab \tab Write the header onto the cartridge.
   1 \par 1BEB\tab \tab ADD\tab HL,DE\tab preamble.
   1 \par 1BE8\tab \tab LD\tab DE,+FFF4\tab Make HL point to the header block
   1 \par 1BE5\tab \tab CALL\tab 1341,CHKS-HD-R\tab Calculate HDCHK checksum.
   1 \par 1BE4\tab \tab ADD\tab HL,DE
   1 \par 1BE1\tab \tab LD\tab DE,+0028
   1 \par 1BE0\tab \tab POP\tab HL\tab header workspace, i.e. HDFLAG.
   1 \par 1BDE\tab \tab PUSH\tab IX\tab Make HL point to the start of the
   1 \par 1BDB\tab \tab LD\tab (HDNUMB),C\tab Take HDNUMB from SECTOR.
   1 \par 1BD9\tab \tab JR\tab Z,1C0A,TEST-SCT\tab Jump when SECTOR has reached zero.
   1 \par 1BD6 WR-F-TEST\tab CALL\tab 1312,DEC-SECT\tab Decrease SECTOR.
   1 \par 1BD3\tab \tab CALL\tab 1346,CHKS-BUFF
   1 \par 1BD2\tab \tab ADD\tab HL,DE
   1 \par 1BCF\tab \tab LD\tab DE,+000F\tab Make HL point to the data buffer.
   1 \par 1BCC\tab \tab CALL\tab 1341,CHKS-HD-R\tab Calculate DESCHK checksum.
   1 \par 1BCB\tab \tab ADD\tab HL,DE
   1 \par 1BC8\tab \tab LD\tab HL,+0043
   1 \par 1BC7\tab \tab POP\tab DE\tab workspace (i.e. RECFLG).
   1 \par 1BC5\tab \tab PUSH\tab IX\tab Point to start of data block
   1 \par 1BC3\tab \tab DJNZ\tab 1BC1,FILL-B-F2
   1 \par 1BC2\tab \tab INC\tab HL
   1 \par 1BC1\tab FILL-B-F2\tab LD\tab (HL),A\tab Fill next 256 bytes.
   1 \par 1BBF\tab \tab BJNZ\tab 1BBD,FILL-B-F
   1 \par 1BBE\tab \tab INC\tab HL
   1 \par 1BBD\tab FILL-B-F\tab LD\tab (HL),A\tab Fill 256 bytes.
   1 \par 1BBB\tab \tab LD\tab A,+FC\tab The byte to be stored.
   1 \par 1BB9\tab \tab LD\tab B,+00\tab Counts 256 bytes.
   1 \par 1BB8\tab \tab ADD\tab HL,DE
   1 \par 1BB5\tab \tab LD\tab DE,+0052
   1 \par 1BB4\tab \tab POP\tab HL\tab data buffer.
   1 \par 1BB2\tab \tab PUSH\tab IX\tab Make HL point to the start of the
   1 \par 1BAE\tab \tab SET\tab 1,(RECFLG)\tab Mark as 'EOF' block.
   1 \par 1BAA\tab \tab RES\tab 0,(RECFLG)\tab Mark the data block.
   1 \par 1BA6\tab \tab SET\tab 0,(HDFLAG)\tab Mark the header block.
   1 \par 1BA3\tab \tab LD\tab (RECNAM),A\tab as first character of the record name.
   1 \par 1BA2\tab \tab XOR\tab A\tab Use 'invisible' name by storing zero
   1 \par 1BA0\tab \tab LDIR\tab \tab Copy cartridge name into HDNAME.
   1 \par 1B9D\tab \tab LD\tab BC,+000A\tab Name length.
   1 \par 1B9C\tab \tab ADD\tab HL,DE\tab (i.e. cartridge name).
   1 \par 1B99\tab \tab LD\tab HL,+FFE2\tab Now make HL point to CHNAME
   1 \par 1B98\tab \tab EX\tab DE,HL
   1 \par 1B97\tab \tab ADD\tab HL,DE
   1 \par 1B94\tab \tab LD\tab DE,+002C
   1 \par 1B93\tab \tab POP\tab HL
   1 \par 1B91\tab \tab PUSH\tab IX\tab Make DE point to HDNAHE.
   1 \par 1B8D\tab \tab LD\tab (SECTOR),BC
   1 \par 1B8A\tab \tab LD\tab BC,+00FF\tab Pass through 255 sectors.
   1 \par 1B88\tab \tab OUT\tab (+EF),A
   1 \par 1B86\tab FORMAT-1\tab LD\tab A,+E6\tab Start writing.
   1 \par 1B86\tab FORMAT-1\tab 1BBD\tab FILL-B-F\tab 1BC1\tab FILL-B-F2\tab 1BD6\tab WR-F-TEST
   1 \par 1B85\tab \tab DEFB\tab +0E
   1 \par 1B84\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1B82\tab \tab JR\tab NZ,1B86,FORMAT-1
   1 \par 1B80\tab \tab AND\tab +01\tab present.
   1 \par 1B7E\tab \tab IN\tab A,(+EF)\tab Continue only if the tab is
   1 \par 1B7D\tab \tab DI\tab \tab Disable interrupts.
   1 \par 1B7A\tab \tab CALL\tab 18FA,DELAY-BC\tab protect tab.
   1 \par 1B77\tab \tab LD\tab BC,+32C8\tab Wait before checking the write-
   1 \par 1B74\tab \tab CALL\tab 182A,SW-MOTOR\tab Turn on the motor.
   1 \par 1B71\tab \tab LD\tab A,(CHDRIV)\tab Fetch drive number.
   1 \par 1B6E\tab FORMAT\tab CALL\tab 0FE8,SET-T-MCH\tab Create channel and map.
   1 \par 1B6E FORMAT "m" command
   1 \par 1B6D\tab \tab RET\tab \tab Finished.
   1 \par 1B6C\tab OP-F-5\tab POP\tab HL\tab Restore stream 'stream data'.
   1 \par 1B68\tab \tab RES\tab 2,(RECFLG)\tab 'PRINT-type file' (opened for writing)
   1 \par 1B64\tab \tab RES\tab 1,(RECFLG)\tab 'No EOF'.
   1 \par 1B62\tab \tab JR\tab NZ,1B3A,OP-F-1\tab Consider all 255 sectors.
   1 \par 1B5F\tab OP-F-4\tab CALL\tab 1312,DEC-SECT\tab Decrease SECTOR.
   1 \par 1B5C\tab OP-F-3\tab CALL\tab 12FE,RES-B-MAP\tab Reset map bit to signal 'free\tab sector'
   1 \par 1B5C\tab OP-F-3\tab 1B5F\tab OP-F-4\tab 1B6C\tab OP-F-5\tab 1B6E\tab FORMAT
   1 \par 1B5A\tab \tab JR\tab 1B6C,OP-F-5\tab Jump forward.
   1 \par 1B57\tab OP-F-2\tab CALL\tab 117D,GET-R-2\tab Fetch first record of file.
   1 \par 1B55\tab \tab JR\tab Z,1B6C,OF-F-5\tab Jump it it is equal to the old one.
   1 \par 1B52\tab \tab CALL\tab 1346,CHKS-BUFF\tab Calculate new DCHK checksum.
   1 \par 1B51\tab \tab ADD\tab HL,DE
   1 \par 1B4E\tab \tab LD\tab DE,+0052
   1 \par 1B4D\tab \tab POP\tab HL
   1 \par 1B4B\tab \tab PUSH\tab IX\tab Make HL point to the data buffer.
   1 \par 1B49\tab \tab JR\tab NZ,1B57,OP-F-2
   1 \par 1B48\tab \tab OR\tab A
   1 \par 1B45\tab \tab LD\tab A,(RECNUM)\tab Jump if this is not the 1st record.
   1 \par 1B41\tab \tab RES\tab 0,(CHFLAG)\tab Signal 'read file' if the file is
   1 \par 1B3F\tab \tab JR\tab Z,1B5C,OP-F-3\tab Jump with 'free' sectors.
   1 \par 1B3D\tab \tab JR\tab C,1B5F,OP-F-4\tab Jump with any error.
   1 \par 1B3A\tab OP-F-1\tab CALL\tab 11A5,G-HD-RC\tab Get header and data block.
   1 \par 1B36\tab \tab LD\tab (SECTOR),BC
   1 \par 1B33\tab \tab LD\tab BC,+00FF\tab Count 255 sectors.
   1 \par 1B30\tab \tab CALL\tab 17F7,SEL-DRIVE\tab Turn on drive motor.
   1 \par 1B2D\tab \tab LD\tab A,(CHDRIV)\tab Fetch drive number.
   1 \par 1B2C\tab \tab PUSH HL\tab Save 'stream displacement'
   1 \par 1B29\tab OP-TEMP-M\tab CALL\tab 0FE8,SET-T-MCH\tab Create a temporary "m" channel.
   1 \par 1B29 Open a temporary "m" channel
   1 \par 1B28\tab \tab RET\tab \tab Finished.
   1 \par 1B27\tab \tab LD\tab (HL),D
   1 \par 1B26\tab \tab INC\tab HL
   1 \par 1B25\tab \tab LD\tab (HL),E \tab Store stream data into STRMS area.
   1 \par 1B24\tab \tab POP\tab HL\tab Restore stream address.
   1 \par 1B23\tab STORE-DSP\tab EX \tab DE,HL\tab DE holds new stream data.
   1 \par 1B23\tab STORE-DSP\tab 1B29\tab OP-TEMP-M\tab 1B3A\tab OP-F-1\tab 1B57\tab OP-F-2
   1 \par 1B22\tab \tab DEFB\tab +16
   1 \par 1B21\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1B1F\tab \tab JR\tab Z,1B23,STORE-DSP
   1 \par 1B1B\tab \tab BIT\tab 2,(RECFLG)\tab Jump with PRINT-type 'read' files.
   1 \par 1B19\tab \tab JR\tab NZ,1B23,STORE-DSP
   1 \par 1B15\tab \tab BIT\tab 0,(CHFLAG)\tab Jump with 'write' files.
   1 \par 1B12\tab \tab CALL\tab 17F7,SEL-DRIVE
   1 \par 1B11\tab \tab XOR\tab A\tab Switch off drive motors.
   1 \par 1B0D\tab MAKE-PERN\tab RES\tab 7,(IX+4) \tab Make the channel permanent.
   1 \par 1B0C\tab \tab DEFB\tab +0E
   1 \par 1B0B\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1B09\tab \tab JR\tab NZ,1B0D,MAKE-PERM
   1 \par 1B07\tab \tab AND\tab +01\tab present.
   1 \par 1B05\tab \tab IN\tab A,(+EF)\tab Jump if the write-protect tab is
   1 \par 1B03\tab \tab JR\tab Z,1B0D,MAKE-PERM
   1 \par 1AFF\tab \tab BIT\tab 0,(CHFLAG)\tab Jump if this is a 'read' file.
   1 \par 1AFC\tab \tab CALL\tab 1B29,OP-TEMP-M\tab Open a temporary "m" channel.
   1 \par 1AFB\tab \tab PUSH\tab HL\tab Save address of data for the required
   1 \par 1AFA\tab \tab ADD\tab HL,DE\tab Index into STRMS area.
   1 \par 1AF8\tab \tab LD\tab D,+00
   1 \par 1AF7\tab \tab LD\tab E,A\tab Use (stream*2) as offset.
   1 \par 1AF4\tab \tab LD\tab HL,+5Cl6\tab Address of data for stream 0.
   1 \par 1AF3\tab \tab ADD\tab A,A\tab Multiply by two.
   1 \par 1AF0\tab OP-M-STRM\tab LD\tab A,(S-STR1)\tab Fetch stream number.
   1 \par 1AF0 Open a permanent "m" channel
   1 \par 1AEF\tab \tab RET\tab \tab Finished.
   1 \par 1AED\tab \tab LDIR\tab \tab Clear the buffer.
   1 \par 1AEA\tab \tab LD\tab BC,+01FF\tab Buffer length - 1.
   1 \par 1AE9\tab \tab INC\tab DE\tab 'Destination' is next byte.
   1 \par 1AE8\tab \tab LD\tab E,L
   1 \par 1AE7\tab \tab LD\tab D,H\tab Copy this address into DE.
   1 \par 1AE6\tab \tab ADD\tab HL,DE
   1 \par 1AE3\tab \tab LD\tab DE,+0052
   1 \par 1AE2\tab \tab POP\tab HL\tab "m" buffer.
   1 \par 1AE0\tab CLR-BUFF\tab PUSH\tab IX\tab Make HL point to the start of the
   1 \par 1AE0 Clear buffer contents
   1 \par 1ADF\tab \tab RET\tab \tab Finished.
   1 \par 1ADE\tab \tab LD\tab (HL),A
   1 \par 1ADD\tab \tab OR\tab (HL)
   1 \par 1ADC\tab \tab LD\tab A,B
   1 \par 1AD9\tab \tab CALL\tab 12DF,CHECK-MAP\tab Finally set the appropriate map bit.
   1 \par 1AD7\tab \tab OUT\tab (+EF),A
   1 \par 1AD5\tab \tab LD\tab A,+EE\tab Stop writing.
   1 \par 1AD2\tab \tab CALL\tab 1878,OUT-M-BUF\tab Write data block onto cartridge.
   1 \par 1AD1\tab \tab POP\tab HL\tab Restore address of data block preamble
   1 \par 1ACE\tab \tab CALL\tab 18FA,DELAY-BC
   1 \par 1ACB\tab \tab LD\tab BC,+0168\tab Wait until the first gap is finished.
   1 \par 1AC9\tab \tab OUT\tab (+EF),A
   1 \par 1AC7\tab WR-S-3\tab LD\tab A,+E6\tab Start writing.
   1 \par 1AC7\tab WR-S-3\tab 1AE0\tab CLR-BUFF\tab 1AF0\tab OP-M-STRM\tab 1B0D\tab MAKE-PERM
   1 \par 1AC6\tab \tab DEFB\tab +0E
   1 \par 1AC5\tab RS-SH\tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1AC3\tab \tab JR\tab NZ,1AC7,WR-S-3
   1 \par 1AC1\tab \tab AND\tab +01\tab is present.
   1 \par 1ABF\tab WR-S-2\tab IN\tab A,(+EF)\tab Continue if the write-protect tab
   1 \par 1ABE\tab \tab DEFB\tab +11
   1 \par 1ABD\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1ABB\tab \tab JR\tab NZ,1AAD,WR-S-l\tab Loop until 240 sectors have been
   1 \par 1AB8\tab \tab CALL\tab 1312,DEC-SECT\tab Otherwise decrease SECTOR.
   1 \par 1AB6\tab \tab JR\tab Z,1ABF,WR-S-2\tab Jump if so.
   1 \par 1AB3\tab \tab CP\tab (CHREC)\tab See whether it is the expected one.
   1 \par 1AB0\tab \tab LD\tab A,(HDNUMB)\tab Fetch current sector number.
   1 \par 1AAD\tab WR-S-l\tab CALL\tab 12C4,GET-M-HD2\tab Get a header.
   1 \par 1AAA\tab \tab CALL\tab 1346,CHKS-BUFF\tab Calculate DCHK checksum.
   1 \par 1AA6\tab \tab LD\tab DE,+000F\tab Now point to the buffer.
   1 \par 1AA3\tab \tab CALL\tab 1341,CHKS-HD-R\tab Calculate DESCHK checksum.
   1 \par 1AA2\tab \tab ADD\tab HL,DE
   1 \par 1A9F\tab \tab LD\tab DE,+000C\tab Now point to RECFLG.
   1 \par 1A9E\tab \tab PUSH\tab HL\tab Save this address.
   1 \par 1A9D\tab \tab ADD\tab HL,DE
   1 \par 1A9A\tab \tab LD\tab DE,+0037
   1 \par 1A99\tab \tab POP\tab HL\tab preamble.
   1 \par 1A97\tab \tab PUSH\tab IX\tab Make HL point to the data block
   1 \par 1A94\tab \tab CD\tab (SECTOR),HL
   1 \par 1A91\tab WR-SECTOR\tab LD\tab HL,+00F0\tab Pass through 240 sectors.
   1 \par 1A91\tab WR-SECTOR\tab 1AAD\tab WR-S-1\tab 1ABF\tab WR-S-2\tab 1AC5\tab RS-SH
   1 \par 1A91 Write sector
   1 \par 1A8F\tab \tab JR\tab 1A63,USE-C-RC\tab Continue back.
   1 \par 1A8C\tab \tab CALL\tab 12C4,GET-M-HD2\tab Fetch the first header.
   1 \par 1A89\tab \tab LD\tab (SECTOR),HL
   1 \par 1A86\tab RD-NEXT\tab LD\tab HL,+00F0\tab Initialise SECTOR to 240.
   1 \par 1A86 Read next sector
   1 \par 1A85\tab \tab RET\tab \tab the error.
   1 \par 1A84\tab \tab SCF\tab \tab Return with carry flag set to signal
   1 \par 1A81\tab DEL-B-CT\tab CALL\tab 1AE0,CLR-BUFF\tab Otherwise clear buffer contents.
   1 \par 1A80\tab \tab RET\tab Z
   1 \par 1A7C\tab \tab BIT\tab 2,(RECFLG)\tab this is a PRINT-type file.
   1 \par 1A7B\tab \tab OR\tab A\tab Return with carry flag reset if
   1 \par 1A79\tab \tab JR\tab NZ,1A81,DEL-B-CT\tab Jump if it does not match with old
   1 \par 1A76\tab \tab CALL\tab 1346,CHKS-BUFF\tab Calculate checksum of buffer.
   1 \par 1A75\tab \tab ADD\tab HL,DE
   1 \par 1A72\tab \tab LD\tab DE,+000F\tab Make HL point to start of buffer.
   1 \par 1A70\tab \tab JR\tab NZ,1A81,DEL-B-CT\tab Jump if it does not match with old
   1 \par 1A6D\tab \tab CALL\tab 1341,CHKS-HD-R\tab Calculate current checksum.
   1 \par 1A6A\tab \tab CALL\tab 18A9,GET-M-BUF\tab Read data block.
   1 \par 1A69\tab \tab ADD\tab HL,DE
   1 \par 1A66\tab \tab LD\tab DE,+0043
   1 \par 1A65\tab \tab POP\tab HL\tab of data block.
   1 \par 1A63\tab USE-C-RC\tab PUSH\tab IX\tab Make HL point to RECFLG (i.e. sTart
   1 \par 1A62\tab \tab DEFB\tab +11
   1 \par 1A61\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1A5E\tab \tab JR\tab NZ,1A51,NO-G00D\tab Jump until 240 sectors have been
   1 \par 1A5C\tab \tab CALL\tab 1312,DEC-SECT\tab Otherwise decrease SECTOR.
   1 \par 1A5A\tab \tab JR\tab Z,1A63,USE-C-RC\tab Jump if found the required sector.
   1 \par 1A57\tab \tab CP\tab (CHREC)\tab Compare with given sector number.
   1 \par 1A54\tab \tab LD\tab A,(HDNUM)\tab Fetch current sector number.
   1 \par 1A51\tab NO-GOOD\tab CALL\tab 12C4,GET-M-HD2\tab Get a header.
   1 \par 1A51\tab NO-GOOD\tab 1A63\tab USE-C-RC\tab 1A81\tab DEL-B-CT\tab 1A86\tab RD-NEXT
   1 \par 1A4E\tab \tab LD\tab (SECTOR),HL
   1 \par 1A4B\tab RD-SECTOR\tab LD\tab HL,+00F0\tab Counts through 240 sectors.
   1 \par 1A4B Read sector
   1 \par 1A48\tab \tab JP\tab 0CA9,BORD-REST\tab Again the carry flag will be
   1 \par 1A47\tab \tab EI\tab \tab Enable interrupts.
   1 \par 1A46\tab CF-ERROR\tab SCF\tab \tab Signal 'error'
   1 \par 1A43\tab \tab JP\tab 0CA9,BORD-REST\tab But it is corrupted into BORD-REST.
   1 \par 1A42\tab \tab AND\tab A\tab Reset carry to signal 'successful'.
   1 \par 1A41\tab \tab EI\tab \tab Enable interrupts.
   1 \par 1A3F\tab \tab JR\tab NZ,1A46,GP-ERROR\tab Jump with any error.
   1 \par 1A3C\tab \tab CALL\tab 0E18,GET-NBLK\tab Wait for header and data block.
   1 \par 1A3A\tab \tab JR\tab NC,1A46,GP-ERROR\tab Jump if 'time-out' occurs.
   1 \par 1A37\tab \tab CALL\tab 0F1E,WT-SCOUT\tab Wait for a 'scout' leader.
   1 \par 1A36\tab \tab DI\tab \tab Disable interrupts.
   1 \par 1A34\tab \tab OUT\tab (+FE),A\tab Change border colour.
   1 \par 1A31\tab GET-PACK\tab LD\tab A,(IOBORD)\tab Fetch border colour.
   1 \par 1A31 Get packet from network
   1 \par 1A30\tab \tab RET\tab \tab Finished.
   1 \par 1A2E\tab \tab DEFW\tab +19E8
   1 \par 1A2D\tab \tab RST\tab 10,CALBAS\tab Call RECLAIM-2 to delete the channel.
   1 \par 1A2A\tab \tab LD\tab BC,+0114\tab Length of "n" channel.
   1 \par 1A29\tab \tab POP\tab HL
   1 \par 1A27\tab \tab PUSH\tab IX\tab Move channel start address to HL.
   1 \par 1A24\tab CLOSE-NET\tab CALL\tab 0EF5,SEND-NEOF\tab Send the EOF block if required.
   1 \par 1A24\tab CLOSE-NET\tab 1A31\tab GET-PACK\tab 1A46\tab GP-ERROR\tab 1A4B\tab RD-SECTOR
   1 \par 1A24 Close network channel
   1 \par 1A23\tab \tab DEFB\tab +16
   1 \par 1A22\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1A1F\tab \tab CALL\tab 10C4,DEL-M-BUF\tab \tab Otherwise reclaim the channel, and
   1 \par 1A1E\tab \tab RET\tab Z\tab file.
   1 \par 1A1A\tab \tab BIT\tab 2,(RECFLG)\tab Return only if this is a PRINT-type
   1 \par 1A17\tab RD-RANDOM\tab CALL\tab 1177,GET-RECD\tab Load CHREC record.
   1 \par 1A17 Read random
   1 \par 1A14\tab INCREC\tab INC\tab (CHREC)\tab Increment record number and continue
   1 \par 1A13\tab \tab RST\tab 28,ROMERR\tab Report the error.
   1 \par 1A0F\tab \tab LD\tab (ERR-NR),+07\tab Otherwise signal 'end of file'.
   1 \par 1A0D\tab \tab JR\tab Z,1A14,INCREC\tab the EOF one.
   1 \par 1A09\tab READ-SEQ\tab BIT\tab 1,(RECFLG)\tab Jump if the current record is not
   1 \par 1A09 Read sequential
   1 \par 1A08\tab \tab RET\tab \tab   flag reset if any key has been
   1 \par 1A06\tab \tab SUB\tab +1F\tab   Return with sign negative and zero
   1 \par 1A04\tab \tab AND\tab +1F\tab   Only 5 less significant bits.
   1 \par 1A02\tab \tab IN\tab A,(+FE)\tab   Read the keyboard.
   1 \par 1A01\tab KBD-TEST\tab XOR\tab A\tab   Clear A, allowing for the whole
   1 \par 1A01\tab KBD-TEST\tab 1A09\tab READ-SEQ\tab 1A14\tab INCREC\tab 1A17\tab RD-RANDOM
   1 \par 1A01 Keyboard test
   1 \par 19\tab NCCUR\tab Position of the currently received byte (in the buffer).
   1 \par 19FF\tab \tab JR\tab 196F,OUT-CODE\tab Jump back.
   1 \par 19FD\tab \tab LD\tab A,+03\tab Select stream 3.
   1 \par 19FC\tab PRT-OUT\tab PUSH\tab AF\tab Save character to be printed.
   1 \par 19FC Printer output
   1 \par 19FB\tab \tab RET\tab \tab Finished.
   1 \par 19F9\tab \tab DEFW\tab +0010\tab character.
   1 \par 19F8\tab \tab RST\tab 10,CALBAS\tab Call 'PRINT-A' restart to print the
   1 \par 19F5\tab \tab DEFW\tab +1601\tab select the stream.
   1 \par 19F4\tab \tab RST\tab 10,CALBAS\tab Call CHAN-OPEN in the main ROM to
   1 \par 19F2\tab \tab LD\tab (HL),+FF\tab Set scroll counter.
   1 \par 19EF\tab OUT-CODE\tab LU\tab HL,+5C8C\tab This is SCR-CT.
   1 \par 19ED\tab \tab LD\tab A,+FE\tab Use stream '-2' (Screen).
   1 \par 19EC\tab CONS-OUT\tab PUSH\tab AF\tab Save character to be printed.
   1 \par 19EC Console output
   1 \par 19EB\tab \tab RET\tab \tab Finished.
   1 \par 19E8\tab \tab LD\tab A,(LAST-K)\tab Fetch character code.
   1 \par 19E6\tab \tab JR\tab Z,19DE,WTKEY\tab pressed.
   1 \par 19E2\tab \tab BIT\tab 5,(FLAGS)\tab Repeat the scan if no key has been
   1 \par 19E0\tab \tab DEFW\tab +02BF\tab in the main ROM.
   1 \par 19DF\tab \tab RST\tab 10,CALBAS\tab Call the keboard scan routine
   1 \par 19DE\tab WTKEY\tab HALT\tab \tab Wait 1/50th of second.
   1 \par 19DE\tab WTKEY\tab 19EC\tab CONS-OUT\tab 19EF\tab OUT-CODE\tab 19FC\tab PRT-OUT
   1 \par 19DA\tab \tab RES\tab 5,(FLAGS)\tab Signal 'ready for a new key'.
   1 \par 19D9\tab CONS-IN\tab EI\tab \tab Enable interrupts.
   1 \par 19D9 Console input
   1 \par 19D7\tab \tab DEFW\tab +19A4,HOOK-32\tab Hook code\tab +32.
   1 \par 19D5\tab \tab DEFW\tab +19A8,HOOK-31\tab Hook code\tab +31.
   1 \par 19D3\tab \tab DEFW\tab +0DB2,SEND-PACK\tab Hook code\tab +30.
   1 \par 19D1\tab \tab DEFW\tab +1A31,GET-PACK\tab Hook code\tab +2F.
   1 \par 19CF\tab \tab DEFW\tab +1A24,CLOSE-NET\tab Hook code\tab +2E.
   1 \par 19CD\tab \tab DEFW\tab +0EA9,OP-TEMP-N\tab Hook code\tab +2D.
   1 \par 19CB\tab \tab DEFW\tab +10C4,DEL-M-BUF\tab Hook code\tab +2C.
   1 \par 19C9\tab \tab DEFW\tab +1B29,OP-TEMP-M\tab Hook code\tab +2B.
   1 \par 19C7\tab \tab DEFW\tab +1A91,WR-SECTOR\tab Hook code\tab +2A.
   1 \par 19C5\tab \tab DEFW\tab +1A86,RD-NEXT\tab Hook code\tab +29.
   1 \par 19C3\tab \tab DEFW\tab +1A4B,RD-SECTOR\tab Hook code\tab +28.
   1 \par 19C1\tab \tab DEFW\tab +1A17,RD-RANDOM\tab Hook code\tab +27.
   1 \par 19Al\tab \tab PUSH\tab HL
   1 \par 19AF\tab \tab DEFW\tab +0C5A,BCHAN-OUT\tab Hook code\tab +1E.
   1 \par 19AD\tab \tab DEFW\tab +0B81,BCHAN-IN\tab Hook code\tab +1D.
   1 \par 19AB\tab \tab DEFW\tab +19EC,CONS-OUT\tab Hook code\tab +1C.
   1 \par 19A9\tab \tab DEFW\tab +19D9,CONS-IN\tab Hook code\tab +1B.
   1 \par 19A9 Hook code addresses
   1 \par 19A8\tab HOOK-3l\tab RET\tab \tab Jump \tab indirectly to UNPAGE.
   1 \par 19A8 Hook code +31
   1 \par 19A7\tab \tab JP\tab (HL)\tab Jump to the routine.
   1 \par 19A4\tab HOOK-32\tab LD\tab HL,(HD-11)\tab Fetch address of the routine.
   1 \par 19A4 Hook code +32
   1 \par 19A2\tab \tab EX\tab DE,HL\tab Move address to HL.
   1 \par 199E\tab \tab LD\tab HL,+0700\tab Return address is UNPAGE.
   1 \par 199D\tab \tab POP\tab AF\tab Restore initial value of A.
   1 \par 199C\tab \tab LD\tab D,(HL)\tab Fetch high byte.
   1 \par 199B\tab \tab INC\tab HL
   1 \par 199A\tab \tab LD\tab E,(HL)\tab Fetch low byte of the address.
   1 \par 1999\tab \tab ADD\tab HL,DE\tab Index into this table.
   1 \par 1996\tab \tab LD\tab HL,+19A9\tab Start of 'hook code addresses' table.
   1 \par 1995\tab \tab LD\tab E,A
   1 \par 1993\tab \tab LD\tab D,+00\tab Pass offset into DE.
   1 \par 1992\tab \tab ADD\tab A,A\tab Multiply code by two.
   1 \par 1991\tab \tab PUSH\tab HL\tab Save this value.
   1 \par 1990\tab \tab EX\tab (SP),HL\tab Store new return address; the initial
   1 \par 198F\tab \tab INC\tab HL\tab Advance return address past the
   1 \par 198F\tab \tab DEFW\tab +11FF,WR-RECD\tab Hook code\tab +26.
   1 \par 198D\tab \tab DEFW\tab +1A09,READ-SEQ\tab Hook code\tab +25.
   1 \par 198B\tab \tab SET\tab 2,(FLAGS)
   1 \par 198B\tab \tab DEFW\tab +1D6E,ERASE\tab Hook code\tab +24.
   1 \par 1989\tab \tab DEFW\tab +12A9,CLOSE-M2\tab Hook code\tab +23.
   1 \par 1987\tab \tab DEFW\tab +1B29,OP-TEMP-M\tab Hook code\tab +22.
   1 \par 1987\tab CLR-ERR\tab LD\tab (ERR-NR),+FF\tab The 'error' is cleared.
   1 \par 1987\tab CLR-ERR\tab 19A4\tab HOOK-32\tab 19A8\tab HOOK-31\tab 19D9\tab CONS-IN
   1 \par 1986\tab \tab DEFB\tab +12
   1 \par 1985\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1985\tab \tab DEFW\tab +17F7,SEL-DRIVE\tab Hook code\tab +21.
   1 \par 1983\tab \tab JR\tab C,1987,CLR-ERR
   1 \par 1983\tab \tab DEFW\tab +1A01,KBD-TEST\tab Hook code\tab +20.
   1 \par 1981\tab \tab DEFW\tab +19FC,PRT-OUT\tab Hook code\tab +1F.
   1 \par 1981\tab HOOK-CODE\tab CP\tab +18\tab Continue with 'hook' codes.
   1 \par 1981 HOOK-CODE
   1 \par 1980\tab \tab RET
   1 \par 197E\tab \tab JR\tab NZ,1976,UNKN-9
   1 \par 197D\tab \tab OR\tab C
   1 \par 197C\tab \tab LD\tab A,B
   1 \par 197B\tab \tab DEC\tab BC
   1 \par 197A\tab \tab INC\tab HL
   1 \par 1979\tab \tab LD\tab (HL),A
   1 \par 1977\tab \tab XOR\tab +55
   1 \par 1976\tab UNKN-9\tab LD\tab A,(HL)
   1 \par 1973\tab \tab LD\tab BC,+0200
   1 \par 1972\tab \tab ADD\tab HL,DE
   1 \par 196F\tab \tab LD\tab DE,+0052
   1 \par 196E\tab \tab POP\tab HL
   1 \par 196C UNKN-8
   1 \par 196B\tab \tab RET
   1 \par 196A\tab \tab POP\tab HL
   1 \par 1969\tab \tab OR\tab A
   1 \par 1968\tab UNKN-7\tab LD\tab A,E
   1 \par 1968\tab UNKN-7\tab 196C\tab UNKN-8\tab 1976\tab UNKN-9\tab 1981\tab HOOK-CODE
   1 \par 1967\tab \tab LD\tab (HL),A
   1 \par 1966\tab \tab INC\tab E
   1 \par 1964\tab \tab JR\tab Z,1968,UNKN-7
   1 \par 1963\tab \tab CP\tab (HL)
   1 \par 1962\tab \tab LD\tab A,B
   1 \par 1961\tab UNKN-6\tab INC\tab HL
   1 \par 1960\tab \tab LD\tab (HL),A
   1 \par 195F\tab \tab INC\tab E
   1 \par 195D\tab \tab JR\tab Z,1961,UNKN-6
   1 \par 195C\tab \tab CP\tab (HL)
   1 \par 195B\tab \tab LD\tab A,C
   1 \par 195A\tab \tab POP\tab BC
   1 \par 1959\tab UNKN-5\tab INC\tab HL
   1 \par 1958\tab \tab LD\tab (HL),A
   1 \par 1957\tab \tab INC\tab E
   1 \par 1955\tab \tab JR\tab Z,1959,UNKN-5
   1 \par 1954\tab \tab CP\tab (HL)
   1 \par 1953\tab \tab LD\tab A,B
   1 \par 1952\tab UNKN-4\tab INC\tab HL
   1 \par 1951\tab \tab LD\tab (HL),A
   1 \par 1950\tab \tab INC\tab E
   1 \par 194E\tab \tab JR\tab Z,1952,UNKN-4
   1 \par 194D\tab \tab CP\tab (HL)
   1 \par 194C\tab \tab LD\tab A,C
   1 \par 194A\tab \tab LD\tab E,+00
   1 \par 1949\tab \tab POP\tab BC
   1 \par 1948\tab \tab POP\tab HL
   1 \par 1947\tab \tab PUSH\tab BC
   1 \par 1946\tab \tab PUSH\tab HL
   1 \par 1945\tab \tab EXX
   1 \par 1944\tab \tab PUSH\tab HL
   1 \par 1942\tab \tab ADC\tab HL,DE
   1 \par 1941\tab \tab EXX
   1 \par 1940\tab \tab ADD\tab HL,DE
   1 \par 193F\tab \tab EXX
   1 \par 193D\tab \tab RL\tab D
   1 \par 193B\tab \tab RL\tab E
   1 \par 193A\tab \tab LD\tab E,A
   1 \par 1939\tab \tab EXX
   1 \par 1937\tab \tab SLA\tab D
   1 \par 1935\tab \tab LD\tab E,+00
   1 \par 1934\tab \tab LD\tab A,D
   1 \par 1933\tab \tab EXX
   1 \par 1932\tab \tab LD\tab D,E
   1 \par 1930\tab \tab JR\tab NZ,191C,UNKN-2
   1 \par 192F\tab \tab OR\tab C
   1 \par 192E\tab \tab LD\tab A,B
   1 \par 192D\tab \tab DEC\tab BC
   1 \par 192B\tab \tab ADC\tab HL,DE
   1 \par 192A\tab \tab EXX
   1 \par 1929\tab UNKN-3\tab ADD\tab HL,DE
   1 \par 1929\tab UNKN-3\tab 1952\tab UNKN-4\tab 1959\tab UNKN-5\tab 1961\tab UNKN-6
   1 \par 1928\tab \tab EXX
   1 \par 1924\tab \tab JR\tab NZ,1929,UNKN-3
   1 \par 1923\tab \tab INC\tab D
   1 \par 1921\tab \tab JR\tab NC,1929,UNKN-3
   1 \par 1920\tab \tab LD\tab E,A
   1 \par 191F\tab \tab ADD\tab A,E
   1 \par 191E\tab \tab INC\tab BC
   1 \par 191D\tab \tab LD\tab A,(BC)
   1 \par 191C\tab UNKN-2\tab EXX
   1 \par 1919\tab \tab LD\tab DE,+0000
   1 \par 1916\tab \tab LD\tab HL,+0000
   1 \par 1913\tab \tab LD\tab BC,+0200
   1 \par 1912\tab \tab EXX
   1 \par 190F\tab \tab LD\tab DE,+0000
   1 \par 190C\tab \tab LD\tab HL,+0000
   1 \par 190B\tab \tab LD\tab C,L
   1 \par 190A\tab \tab LD\tab B,H
   1 \par 1909\tab \tab ADD\tab HL,BC
   1 \par 1906\tab \tab LD\tab BC,+0052
   1 \par 1905\tab \tab POP\tab HL
   1 \par 1903\tab \tab PUSH\tab IX
   1 \par 1902\tab UNKN-1\tab PUSH\tab HL
   1 \par 1902 UNKN-1
   1 \par 1901\tab \tab RET\tab \tab Finished.
   1 \par 1900\tab \tab POP\tab AF\tab Restore accumulator.
   1 \par 18\tab NCHCS\tab Checksum of block NCIRIS...NCDCS.
   1 \par 18FE\tab \tab JR\tab NZ,18FB,DELAY-BC1
   1 \par 18FD\tab \tab OR\tab C
   1 \par 18FB\tab DELAY-BC1\tab DEC\tab BC\tab Decrease counter.
   1 \par 18FA\tab DELAY-BC\tab PUSH\tab AF\tab Save accumulator.
   1 \par 18FA DELAY-BC
   1 \par 18F9\tab \tab RST\tab 28,ROMERR\tab Report the error.
   1 \par 18F5\tab \tab LD\tab (ERR-NR),+14\tab Store error code.
   1 \par 18F4\tab \tab RET\tab C\tab Return if CAPS SHIFT not being pressed
   1 \par 18F3\tab \tab RRA\tab \tab Only bit 0.
   1 \par 18F1\tab \tab IN\tab A,(+FE)
   1 \par 18EF\tab \tab LD\tab A,+FE\tab Read port +FEFE.
   1 \par 18EE\tab \tab RET\tab C\tab Return if SPACE not being pressed.
   1 \par 18ED\tab \tab RRA\tab \tab Only bit 0.
   1 \par 18EB\tab \tab IN\tab A,(+FE)
   1 \par 18E9\tab TEST-BRK\tab LD\tab A,+7F\tab Read port +7FFE.
   1 \par 18E9 TEST-BRK
   1 \par 18E8\tab \tab RET
   1 \par 18E7\tab \tab POP\tab HL\tab Restore block start address.
   1 \par 18E5\tab \tab OUT\tab (+EF),A
   1 \par 18E3\tab \tab LD\tab A,+EE\tab Finished.
   1 \par 18E1\tab \tab JR\tab NZ,18DE,IN-M-BLK\tab been read.
   1 \par 18E0\tab \tab DEC\tab A\tab Repeat until the whole block has
   1 \par 18DE\tab IN-M-BLK\tab INIR\tab \tab Read first block.
   1 \par 18DC\tab \tab LD\tab C,+E7\tab Input port.
   1 \par 18DB\tab \tab LD\tab A,C\tab A holds the high counter.
   1 \par 18D8\tab \tab CALL\tab 18E9,TEST-BRK\tab Give an error if BREAK pressed.
   1 \par 18D6\tab \tab JR\tab NZ,18D2,DR-READY\tab Repeat until SYNC is found low.
   1 \par 18D4\tab \tab AND\tab +02\tab reading with the start of the block.
   1 \par 18D2\tab DR-READY\tab IN\tab A,(+EF)\tab Read SYNC line to synchronize the
   1 \par 18D1\tab \tab PUSH\tab HL
   1 \par 18D0\tab \tab POP\tab HL\tab Restore 'start address'.
   1 \par 18CE\tab \tab OUT\tab (+EF),A
   1 \par 18CC\tab \tab LD\tab A,+EE\tab Start reading.
   1 \par 18CB\tab \tab POP\tab BC\tab Restore BC.
   1 \par 18C9\tab \tab DJNZ\tab 18C0,CHK-LP-2
   1 \par 18C7\tab \tab JR\tab NZ,18BE,CHK-AG-2
   1 \par 18C5\tab \tab AND\tab +04
   1 \par 18C3\tab \tab IN\tab A,(+EF)
   1 \par 18C0\tab CHK-LP-2\tab CALL\tab 18E9,TEST-BRK
   1 \par 18C0\tab CHK-LP-2\tab 18D2\tab DR-READY\tab 18DE\tab IN-M-BLK\tab 18E9\tab TEST-ERR
   1 \par 18BE\tab CHK-AG-2\tab LD\tab B,+06
   1 \par 18BC\tab \tab DJNZ\tab 18B3,CHKLOOP
   1 \par 18BA\tab \tab JR\tab Z,18B1,CHK-AGAIN\tab period.
   1 \par 18B8\tab \tab AND\tab +04\tab it must be found 'low' after a 'high'
   1 \par 18B6\tab \tab IN\tab A,(+EF)\tab The GAP line is read repeatedly;
   1 \par 18B3\tab CHKLOOP\tab CALL\tab 18E9,TEST-BRK\tab Give an error if BREAK pressed.
   1 \par 18B1\tab CHK-AGAIN\tab LD\tab B,+08\tab Loop 8 times.
   1 \par 18B0\tab \tab PUSH\tab BC
   1 \par 18AF\tab \tab INC\tab C\tab Increment high byte of 'length'.
   1 \par 18AE\tab \tab LD\tab C,D\tab a reversed form.
   1 \par 18AD\tab GET-M-BLK\tab LD\tab B,E\tab Copy 'length' into BC in
   1 \par 18AD\tab GET-M-BLK\tab 18B1\tab CHK-AGAIN\tab 18B3\tab CHKLOOP\tab 18BE\tab CHK-AG-2
   1 \par 18AA\tab \tab LD\tab DE,+0210\tab Block length.
   1 \par 18A9\tab GET-M-BUF\tab PUSH\tab HL\tab Save start address.
   1 \par 18A7\tab \tab JR\tab 18AD,GET-M-BLK\tab Jump forward.
   1 \par 18A4\tab \tab LD\tab DE,+000F\tab Block length.
   1 \par 18A3\tab GET-M-HD\tab PUSH\tab HL\tab Save start address.
   1 \par 18A3 Receive block from Microdrive Head
   1 \par 18A2\tab \tab RET\tab \tab Finished.
   1 \par 18A1\tab \tab POP\tab HL\tab Restore block start address.
   1 \par 189E\tab \tab CALL\tab 0CA9,BORD-REST\tab Restore border colour.
   1 \par 189C\tab \tab OUT\tab (+EF),A
   1 \par 189A\tab \tab LD\tab A,+E6\tab Stop writing.
   1 \par 1898\tab \tab JR\tab NZ,1895,OUT-M-BYT\tab written.
   1 \par 1897\tab \tab DEC\tab A\tab Repeat until the whole block has been
   1 \par 1895\tab OUT-M-BYT\tab OTIR\tab \tab Write first block.
   1 \par 1894\tab \tab NOP
   1 \par 1893\tab \tab NOP
   1 \par 1892\tab \tab NOP\tab \tab Wait 12 T cycles.
   1 \par 1890\tab \tab LD\tab C,+E7\tab Output port.
   1 \par 188F\tab \tab LD\tab B,E\tab Low counter.
   1 \par 188E\tab \tab LD\tab A,D\tab into A.
   1 \par 188D\tab \tab INC\tab D\tab Increment high counter and copy it
   1 \par 188B\tab \tab OUT\tab (+EF),A
   1 \par 1889\tab \tab LD\tab A,+E2\tab Start writing.
   1 \par 1887\tab \tab OUT\tab (+FE),A\tab Change border colour.
   1 \par 1884\tab NOT-PROT\tab LD\tab A,(IOBORD)\tab Fetch border colour.
   1 \par 1884\tab NOT-PROT\tab 1895\tab OUT-M-BYT\tab 18A3\tab GET-M-HD\tab 18A9\tab GET-M-BUF
   1 \par 1883\tab \tab DEFB\tab +0E
   1 \par 1882\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1880\tab \tab JR\tab NZ,1884,NOT-PROT\tab Jump if tab is present.
   1 \par 187E\tab \tab AND\tab +01\tab Only bit 0.
   1 \par 187C\tab OUT-N-ELK\tab IN\tab A,(+EF)\tab Check write-protect tab.
   1 \par 1879\tab \tab LD\tab DE,+021F\tab Block length.
   1 \par 1878\tab OUT-M-BUF\tab PUSH\tab HL\tab Save block start address.
   1 \par 1876\tab \tab JR\tab 187C,0UT-M-BLK\tab Jump forward.
   1 \par 1873\tab \tab LD\tab DE,+001E\tab Block length.
   1 \par 1872\tab OUT-M-HD\tab PUSH\tab HL\tab Save block start address.
   1 \par 1872 Send data block to Microdrive Head
   1 \par 1871\tab \tab RET\tab \tab Finished.
   1 \par 1870\tab \tab POP\tab BC
   1 \par 186F\tab \tab POP\tab AF\tab Restore registers.
   1 \par 186C\tab \tab CALL\tab 18FA,DELAY-BC
   1 \par 1869\tab \tab LD\tab BG,+0087\tab Inserts a delay of 3553 T cycles.
   1 \par 1868\tab \tab PUSH\tab AF\tab Save accumulator.
   1 \par 1867\tab DEL-S-1\tab PUSH\tab BC\tab Save BC register pair.
   1 \par 1867\tab DEL-S-1\tab 1872\tab OUT-M-HD\tab 1878\tab OUT-M-BUF\tab 187C\tab OUT-M-BLK
   1 \par 1867 1 millisecond delay
   1 \par 1866\tab \tab RET\tab \tab Finished.
   1 \par 1865\tab \tab POP\tab DE\tab Restore DE register pair.
   1 \par 1863\tab \tab OUT\tab (+EF),A
   1 \par 1861\tab \tab LD\tab A,+EE
   1 \par 185F\tab \tab OUT\tab (+F7),A
   1 \par 185E\tab \tab LD\tab A,D\tab End of drive selection.
   1 \par 185C\tab NXT-NOTOR\tab DJNZ\tab 1835,ALL-MOTRS\tab Loop for 8 microdrives.
   1 \par 1859\tab \tab CALL\tab 1867,DEL-S-1\tab Wait about 1 ms,
   1 \par 1857\tab \tab OUT\tab (+EF),A
   1 \par 1855\tab \tab LD\tab A,+ED
   1 \par 1852\tab \tab CALL\tab 1867,DEL-S-1\tab Wait about 1 ms.
   1 \par 1850\tab \tab OUT\tab (+F7),A
   1 \par 184F\tab \tab LD\tab A,E
   1 \par 184D\tab \tab OUT\tab (+EF),A
   1 \par 184B\tab OFF-MOTOR\tab LD  \tab A,+EF  \tab The drive motor Is turned off.
   1 \par 1849\tab \tab JR  \tab 185C,NXT-MOTOR  \tab Continue with next microdrive.
   1 \par 1846\tab \tab CALL\tab 1867,DEL-S-1\tab Wait about 1 ms.
   1 \par 1844\tab \tab OUT \tab (+EF),A
   1 \par 1842\tab \tab LD  \tab A,+EC
   1 \par 183F\tab \tab CALL\tab 1867,DEL-S-1\tab Wait about 1 ms.
   1 \par 183D\tab \tab OUT \tab (+EF),A
   1 \par 183B\tab \tab LD  \tab A,+EE
   1 \par 1839\tab \tab OUT\tab (+F7),A
   1 \par 1838\tab \tab LD  \tab A,D  \tab Otherwise switch on the motor.
   1 \par 1836\tab \tab JR  \tab NZ,184B,OFF-MOTOR\tab not the required one.
   1 \par 1835\tab ALL-NOTRS\tab DEC\tab C\tab Switch off this microdrive if it is
   1 \par 1833\tab \tab LD \tab B,+08 \tab Loop for 8 microdrives.
   1 \par 1832\tab \tab LD\tab C,A\tab Move counter to C.
   1 \par 1830\tab \tab ADD\tab A,+09\tab \tab A = 9 - drive number.
   1 \par 182E\tab \tab NEG\tab \tab \tab A = 0 - drive number.
   1 \par 182B\tab \tab LB\tab DE,+0100
   1 \par 182A\tab SW-MOTOR\tab PUSH\tab DE\tab \tab Save DE register pair.
   1 \par 182A\tab SW-MOTOR\tab 1835\tab ALL-MOTRS\tab 184B\tab OFF-MOTOR\tab 185C\tab NXT-MOTOR
   1 \par 1829\tab \tab DEFB\tab +10
   1 \par 1828\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1825\tab \tab CALL\tab 17F7,SEL-DRIVE\tab Send 'switch off' signals and enable
   1 \par 1823\tab \tab JR\tab NZ,1811,REPTEST\tab Repeat if not.
   1 \par 1822\tab \tab OR\tab L
   1 \par 1821\tab \tab LD\tab A,H\tab Has the counter reached zero?
   1 \par 1820\tab NOPRES\tab DEC\tab HL\tab Becrease counter.
   1 \par 181F\tab \tab RET\tab \tab Finished.
   1 \par 181E\tab \tab POP\tab HL\tab Restore HL.
   1 \par 181C\tab \tab DJNZ\tab 1813,CHK-PRES\tab Repeat 6 times.
   1 \par 181A\tab \tab JR\tab NZ,1820,NOPRES
   1 \par 1818\tab \tab AND\tab +04
   1 \par 1816\tab \tab IN\tab A,(+EF)\tab Repeat until 'GAP' signal is found low
   1 \par 180E\tab \tab LD\tab HL,+1388\tab Repeat 5000 times the following test:
   1 \par 180C\tab \tab JR\tab NZ,1809,TON-DELAY\tab Repeat if not.
   1 \par 180B\tab \tab OR\tab L
   1 \par 180A\tab \tab LD\tab A,H\tab Has the counter reached zero?
   1 \par 1809\tab TON-DELAY\tab DEC\tab HL\tab Decrease counter.
   1 \par 1809\tab TON-DELAY\tab 1811\tab REPTEST\tab 1813\tab CHK-PRES\tab 1820\tab NOPRES
   1 \par 1806\tab \tab LD\tab HL,+1388\tab First wait about 40 ms.
   1 \par 1803\tab \tab CALL\tab 182A,SW-MOTOR\tab Switch motors as required.
   1 \par 1802\tab TURN-ON\tab DI\tab \tab Disable interrupts.
   1 \par 1801\tab \tab RET\tab \tab Finished.
   1 \par 1800\tab \tab POP\tab HL\tab Restore HL.
   1 \par 17\tab NCDCS\tab Checksum of the 255-byte buffer.
   1 \par 17FF\tab \tab EI\tab \tab Enable interrupts.
   1 \par 17FC\tab \tab CALL\tab 182A,SW-MOTOR\tab Otherwise switch off all motors.
   1 \par 17FA\tab \tab JR\tab NZ,1802,TURN-ON\tab on.
   1 \par 17F8\tab \tab CP\tab +00\tab Jump if a drive motor is to be turned
   1 \par 17F7\tab SEL-DRIVE\tab PUSH\tab HL\tab Save HL register pair.
   1 \par 17F7 Select drive motor
   1 \par 17F5\tab \tab JR  \tab 17C2,EX-CHANS  \tab Loop for the whole CHANS area.
   1 \par 17F3\tab \tab ADD \tab IX,DE \tab Point to next channel.
   1 \par 17ED\tab PT-N-CHAN\tab LD  \tab E,(IX+9)  \tab Fetch channel length.
   1 \par 17EB\tab \tab JR  \tab 17B9,RCL-T-CH  \tab Loop again.
   1 \par 17E9\tab \tab DEFW\tab +19E8
   1 \par 17E8\tab \tab RST \tab 10,CALBAS \tab Call RECLAIM-2 to reclaim channel.
   1 \par 17E7\tab \tab POP \tab HL
   1 \par 17E5\tab \tab PUSH\tab IX\tab Make HL point to start of channel.
   1 \par 17E2\tab \tab LD  \tab BC,+0114  \tab Length of "n" channel.
   1 \par 17E0\tab \tab JR  \tab NZ,17ED,PT-N-CHAN
   1 \par 17DE\tab CHK-TEMPN\tab CP\tab +CE  \tab Jump if not a temporary "n" channel.
   1 \par 17DE\tab CHK-TEMPN\tab 17ED\tab PT-N-CHAN\tab 17F7\tab SEL-DRIVE\tab 1802\tab TURN-ON
   1 \par 17DC\tab \tab JR\tab 17B9,RCL-T-CH  \tab Loop again.
   1 \par 17D9\tab \tab CALL\tab 10C4,DEL-M-BUF\tab Reclaim "m" channel.
   1 \par 17D7\tab \tab JR\tab NZ,17DE,CHK-TEMPN
   1 \par 17D5\tab \tab CP\tab +CD\tab Jump if not a temporary "m" channel.
   1 \par 17D2\tab CHK-TEMPM\tab LD\tab A,(IX+4)\tab Fetch channel specifier.
   1 \par 17D1\tab \tab RET\tab \tab Never executed.
   1 \par 17CE\tab \tab JP\tab 17F7,SEL-DRIVE\tab drive motors.
   1 \par 17CD\tab \tab XOR\tab A\tab Return via SEL_DRIVE to turn off
   1 \par 17CB\tab \tab OUT\tab (+EF),A
   1 \par 17C9\tab \tab LD\tab A,+EE\tab Send a signal to the interface.
   1 \par 17C7\tab \tab JR\tab NZ,17D2,CHK-TEMPM
   1 \par 17C5\tab \tab CP\tab +80\tab finished.
   1 \par 17C2\tab EX-CHANS\tab LD\tab A,(IX+3)\tab Jump if the CHANS area is not
   1 \par 17C0\tab \tab ADD\tab IX,DE
   1 \par 17BD\tab \tab LD\tab DE,+0014\tab channel.
   1 \par 17B9\tab RCL-T-CH\tab LD\tab IX,(CHANS)\tab Make IX point to first 'non-standard'
   1 \par 17B9 Reclaim temporary channels
   1 \par 17B8\tab \tab RET\tab \tab Finished.
   1 \par 17B4\tab \tab RES\tab 1,(FLAGS3)\tab Clear 'CLEAR/CLOSE' flag.
   1 \par 17B3\tab \tab POP\tab HL\tab 'stream data'.
   1 \par 17B2\tab \tab POP\tab HL\tab Remove 'channel length' and
   1 \par 17AE\tab \tab LD\tab (X-PTR-hi),+00\tab Clear X-PTR.
   1 \par 17AC\tab \tab JR\tab C,1789,UPD-STRM
   1 \par 17AA\tab \tab CP\tab +10\tab Loop for all 16 streams.
   1 \par 17A9\tab \tab INC\tab A\tab Increment stream number.
   1 \par 17A8\tab \tab INC\tab HL
   1 \par 17A7\tab \tab INC\tab HL
   1 \par 17A4\tab UPD-NXT-S\tab LD\tab HL,(X-PTR)\tab Make HL point to next stream data.
   1 \par 17A4\tab UPD-NXT-S\tab 17B9\tab RCL-T-CH\tab 17C2\tab EX-CHANS\tab 17D2\tab CHK-TEMPM
   1 \par 17A3\tab \tab LD\tab (HL),D
   1 \par 17A2\tab \tab INC\tab HL
   1 \par 17A1\tab \tab LD\tab (HL),E\tab Store new stream data.
   1 \par 179E\tab \tab LD\tab HL,(X-PTR)\tab Restore stream data address.
   1 \par 179D\tab \tab EX\tab DE,HL
   1 \par 179B\tab \tab SBC\tab HL,BC\tab to be stored.
   1 \par 179A\tab \tab AND\tab A\tab Calculate into DE the new stream data
   1 \par 1799\tab \tab EX\tab DE,HL\tab HL holds the fetched Stream data.
   1 \par 1797\tab \tab JR\tab NC,17A4,UPD-NXT-S\tab (i.e. channel has not been moved).
   1 \par 1795\tab \tab SBC\tab HL,DE\tab lower than that of the closed stream
   1 \par 1794\tab \tab AND\tab A\tab Jump if the stream data found is
   1 \par 1793\tab \tab PUSH\tab BC
   1 \par 1792\tab \tab PUSH\tab HL
   1 \par 1791\tab \tab POP\tab HL\tab Stream data for closed channel.
   1 \par 1790\tab \tab POP\tab BC\tab Length of channel.
   1 \par 178D\tab \tab LD\tab (X-PTR),HL\tab Store address into X-PTR.
   1 \par 178C\tab \tab DEC\tab HL\tab Point to the first byte.
   1 \par 178B\tab \tab LD\tab D,(HL)
   1 \par 178A\tab \tab INC\tab HL
   1 \par 1789\tab UPD-STRM\tab LD\tab E,(HL)\tab Fetch stream data.
   1 \par 1786\tab \tab LD\tab HL,+5C16\tab Address of data for stream 0.
   1 \par 1785\tab \tab XOR\tab A\tab Start with stream 0.
   1 \par 1783\tab \tab DEFW\tab +19E8
   1 \par 1782\tab \tab RST\tab 10,CALBAS\tab Call RECLAIM-2 to delete the channel.
   1 \par 1781\tab \tab PUSH\tab BC\tab Save 'length' again.
   1 \par 1780\tab \tab POP\tab HL\tab Channel start address.
   1 \par 177F\tab RCLM-CH\tab POP\tab BC\tab Channel length.
   1 \par 1779\tab \tab JP\tab Z,12A9,CLOSE-M2\tab not using CLEAR#.
   1 \par 1775\tab \tab BIT\tab 1,(FLAGS3)\tab Send the EOF record on microdrive if
   1 \par 1774\tab \tab POP\tab DE\tab Stream data.
   1 \par 1772\tab \tab POP\tab IX\tab Start of channel.
   1 \par 1771\tab \tab POP\tab DE\tab Remove 'channel length'.
   1 \par 176F\tab \tab JR\tab NZ,177F,RCLM-CH
   1 \par 176D\tab CL-M-CH\tab CP\tab +4D\tab Jump if not "m" channel.
   1 \par 176B\tab \tab JR\tab 177F,RCLM-CH
   1 \par 1768\tab \tab CALL\tab 0EF5,SEND-NEOF\tab Send remaining contents of "n"
   1 \par 1766\tab \tab JR\tab NZ,177F,RCLM-CH
   1 \par 1762\tab \tab BIT\tab 1,(FLAGS3)\tab Jump if doing a CLEAR#.
   1 \par 1760\tab \tab JR\tab NZ,176D,CL-M-CH
   1 \par 175E\tab CL-N-CH\tab CP\tab +4E\tab Jump with "m" channel.
   1 \par 175E\tab CL-N-CH\tab 176D\tab CL-M-CN\tab 177F\tab RCLM-CH\tab 1789\tab UPD-STRM
   1 \par 175C\tab \tab JR\tab 177F,RCLM-CH\tab Jump to reclaim the channel.
   1 \par 1759\tab \tab CALL\tab 0C5A,BCHAN-OUT
   1 \par 1757\tab \tab LD\tab A,+0D\tab Send a carriage return over RS232.
   1 \par 1755\tab \tab JR\tab NZ,177F,RCLM-CH\tab (i.e. do not send any data).
   1 \par 1751\tab CL-RS-CH\tab BIT\tab 1,(FLAGS3)\tab Jump if doing a CLEAR#.
   1 \par 174F\tab \tab JR\tab NZ,175E,CL-N-CH
   1 \par 174D\tab \tab CP\tab +54\tab Jump with "n" and "m" channels.
   1 \par 174B\tab \tab JR\tab Z,1751,CL-RS-CH
   1 \par 1749\tab \tab CP\tab +42\tab Jump with "b" channel.
   1 \par 1748\tab \tab PUSH\tab DE\tab Save the 'length'.
   1 \par 1747\tab \tab LD\tab D,(HL)
   1 \par 1746\tab \tab INC\tab HL
   1 \par 1745\tab \tab LD\tab E,(HL)\tab Fetch channel length.
   1 \par 1744\tab \tab ADD\tab HL,DE
   1 \par 1741\tab \tab LD\tab DE,+0005\tab Points to channel length.
   1 \par 1740\tab \tab LD\tab A,(HL)\tab Fetch channel specifier.
   1 \par 173F\tab \tab INC\tab HL
   1 \par 173E\tab \tab INC\tab HL
   1 \par 173D\tab \tab INC\tab HL
   1 \par 173C\tab \tab INC\tab HL\tab Advance HL to the channel specifier.
   1 \par 1739\tab \tab LD\tab (CURCHL),HL\tab Make the channel 'current'.
   1 \par 1738\tab \tab EX\tab DE,HL\tab Move start of channel to HL.
   1 \par 1737\tab \tab PUSH\tab DE\tab channel start address.
   1 \par 1736\tab \tab PUSH\tab BC\tab Save stream data, and
   1 \par 1735\tab \tab RET\tab NC
   1 \par 1734\tab \tab POP\tab BC
   1 \par 1732\tab \tab SBC\tab HL,DE\tab a 'new' one.
   1 \par 1731\tab \tab SCF\tab \tab Return if the channel is not
   1 \par 1730\tab \tab POP\tab DE\tab Restore channel start address.
   1 \par 172F\tab \tab ADD\tab HL,DE
   1 \par 1729\tab \tab LD\tab HL,(CHANS)\tab Make HL point to the first of the
   1 \par 1727\tab \tab DEFW\tab +16EB\tab 'CLOSE' routine is made to update
   1 \par 1726\tab \tab RST\tab 20,CALBAS\tab A call in the middle of the main ROM
   1 \par 1725\tab \tab EX\tab (SP),HL\tab HL now holds the address of the
   1 \par 1724\tab \tab ADD\tab HL,BC\tab be closed.
   1 \par 1723\tab \tab DEC\tab HL\tab channel attached to the stream to
   1 \par 1720\tab \tab LD\tab HL,(CHANS)\tab Make HL point to the start of the
   1 \par 171F\tab \tab PUSH\tab HL
   1 \par 171E\tab \tab PUSH\tab BC
   1 \par 171D\tab \tab RET\tab Z
   1 \par 171C\tab \tab OR\tab B\tab CLOSEd (i.e. stream data = 0).
   1 \par 171B\tab \tab LD\tab A,C\tab Return if the stream is already
   1 \par 1719\tab \tab DEFW\tab +1727
   1 \par 1718\tab CLOSE\tab RST\tab 10,CALBAS\tab Call STR-DATA1.
   1 \par 1718 CLOSE command
   1 \par 1715\tab \tab JP\tab 05C1,END1\tab Finished.
   1 \par 1712\tab \tab CALL\tab 1718,CLOSE\tab Close the stream.
   1 \par 170E\tab \tab RES\tab 1,(FLAGS3)\tab Signal 'unsent bytes in the buffer
   1 \par 170C\tab \tab SUB\tab +03\tab And now +00..+0F.
   1 \par 170A\tab \tab SRL\tab A\tab Range of stream number is +03..+12.
   1 \par 1709\tab \tab RST\tab 30,NEWVARS\tab Create new variables if required.
   1 \par 1708\tab CLOSE-CL\tab INC\tab HL\tab The 'INC HL' at +1708 in main ROM.
   1 \par 1708 CLOSE STREAM
   1 \par 16\tab NCOBL\tab Number of bytes held in the buffer during 'output' (holds 0 if
   1 \par 16BA...1707\tab Unused locations (all set to +FF).
   1 \par 16B9\tab \tab RET\tab \tab Finished.
   1 \par 16B8\tab \tab EX\tab DE,HL\tab address.
   1 \par 16B7\tab \tab ADD\tab HL,BC\tab bytes, so returning the new filename
   1 \par 16B6\tab \tab EX\tab DE,HL\tab Add to DE the number of 'inserted'
   1 \par 16B5\tab \tab RET\tab C
   1 \par 16B3\tab \tab SBC\tab HL,DE
   1 \par 16B0\tab \tab LD \tab HL,(STKEND) \tab or if it is after STKEND.
   1 \par 16AF\tab \tab RET\tab NC\tab before the channel,
   1 \par 16AD\tab \tab SBC\tab HL,DE\tab No action is made if the filename is
   1 \par 16AC\tab TST-PLACE\tab SCF\tab \tab Allow for a further byte.
   1 \par 16AC\tab TST-PLACE\tab 1708\tab CLOSE-CH\tab 1718\tab CLOSE\tab 1751\tab CL-RS-CH
   1 \par 16AB\tab \tab RET\tab \tab Finished.
   1 \par 16A6\tab \tab LD\tab (N-STR1+2),DE
   1 \par 16A3\tab \tab CALL\tab 16AC,TST-PLACE\tab \tab filename.
   1 \par 169F\tab \tab LD\tab DE,(N-STR1+2)\tab Restore start address of the first
   1 \par 169E\tab \tab POP\tab HL\tab Restore channel start address.
   1 \par 169A\tab \tab LD\tab (N-STR2+2),DE
   1 \par 1697\tab \tab CALL\tab 16AC,TST-PLACE\tab \tab filename.
   1 \par 1693\tab \tab LD\tab DE,(N-STR2+2)\tab Restore start address of the second
   1 \par 1692\tab \tab PUSH\tab HL
   1 \par 1691\tab REST-N-AD\tab PUSH\tab HL\tab Save 'start of channel' twice.
   1 \par 1691 Restore address of filename
   1 \par 1690\tab \tab DEER\tab +11
   1 \par 168F\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 168D\tab \tab JR\tab NZ,1673,UNTILFIVE\tab And continue until five passes of the
   1 \par 168A\tab F-ERROR\tab CALL\tab 1312,DEC-SECT\tab Decrease SECTOR.
   1 \par 1689\tab \tab RET\tab Z
   1 \par 1686\tab \tab CALL\tab 1346,CHKS-BUFF\tab \tab Return only with correct checksum.
   1 \par 1685\tab \tab ADD\tab HL,DE
   1 \par 1682\tab \tab LD\tab DE,+0052
   1 \par 1681\tab \tab POP\tab HL\tab 512-byte buffer.
   1 \par 167F\tab \tab PUSH\tab IX\tab Make HL point to the start of the
   1 \par 167D\tab \tab JR\tab NZ,168A,F-ERROR\tab Jump also with already fetched
   1 \par 167A\tab \tab CALL\tab 12DA,CHK-MAP-2\tab \tab Check map bit.
   1 \par 1678\tab \tab JR\tab Z,168A,F-ERROR\tab unused sectors.
   1 \par 1676\tab \tab JR\tab C,168A,F-ERROR\tab Jump with any error, or with
   1 \par 1673\tab UNTILFIVE\tab CALL\tab 11A5,G-HD-RC\tab \tab Fetch header and record.
   1 \par 166F\tab \tab LD\tab (SECTOR),BC
   1 \par 166C\tab F-REC2\tab 1673\tab UNTILFIVE\tab 168A\tab F-ERROR\tab 1691\tab REST-N-AD
   1 \par 166C\tab E-REC2\tab LD\tab BC,+04FB\tab Count five passes of the tape.
   1 \par 1669\tab \tab CALL\tab 17E7,SEL-DRIVE\tab \tab Start drive motor.
   1 \par 1666\tab F-REC1\tab LD\tab A,(CHDRIV)\tab Fetch drive number.
   1 \par 1666 Fetch record from Microdrive.
   1 \par 1665\tab \tab DEFB\tab +15
   1 \par 1664\tab VE-FAIL\tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1663\tab \tab RET\tab \tab Finished.
   1 \par 1661\tab \tab JR\tab NZ,1658,VE-M-E
   1 \par 1660\tab \tab OR\tab C
   1 \par 165F\tab \tab LD\tab A,B\tab verified.
   1 \par 165E\tab \tab DEC\tab BC \tab Repeat until the block has been
   1 \par 165D\tab \tab INC\tab DE
   1 \par 165C\tab \tab INC\tab HL\tab Point to next locations.
   1 \par 165A\tab \tab JR\tab NZ,1664,VE-FAIL\tab Jump if they do not match.
   1 \par 1659\tab \tab CP\tab (HL)\tab Compare against loaded one.
   1 \par 1658\tab VE-M-E\tab LD\tab A,(DE)\tab Fetch an existing byte.
   1 \par 1657\tab \tab RET\tab \tab Finished.
   1 \par 1655\tab \tab LDIR\tab \tab LOAD the data.
   1 \par 1653\tab \tab JR\tab NZ,1658,VE-M-E
   1 \par 1651\tab \tab BIT\tab 7,A
   1 \par 164E\tab \tab LD\tab A,(FLAGS3)\tab Jump if VERIFYing.
   1 \par 164B\tab \tab LD\tab B,(RECLEN-hi)
   1 \par 1648\tab LD-VE-M\tab LD\tab C,(RECLEN-lo)\tab Fetch record length.
   1 \par 1648\tab LD-VE-M\tab 1658\tab VE-M-E\tab 1664\tab VE-FAIL\tab 1666\tab F-REC1
   1 \par 1648 LD-VE-M
   1 \par 1647\tab \tab JP\tab (HL)\tab Make an indirect return.
   1 \par 1644\tab \tab LD\tab HL,(SECTOR)\tab Fetch return address.
   1 \par 1642\tab \tab DJNZ\tab 163D,RE-MAP-LP\tab \tab Continue the loop.
   1 \par 1641\tab \tab DEC\tab HL\tab Previous location.
   1 \par 1640\tab \tab LD\tab (HL),E\tab Store second byte.
   1 \par 163F\tab \tab DEC\tab HL\tab Previous location.
   1 \par 163E\tab \tab LD\tab (HL),D\tab Store first byte in the map.
   1 \par 163D\tab RE-MAP-LP\tab POP\tab DE\tab Fetch two bytes.
   1 \par 163B\tab \tab LD\tab B,+10\tab Counts 'map/2' bytes.
   1 \par 1637\tab \tab LD\tab DE,+001F\tab Advance to the last map location.
   1 \par 1634\tab \tab LD\tab H,(CHMAP-hi)
   1 \par 1631\tab \tab LD\tab L,(CHMAP-lo)\tab Fetch map address.
   1 \par 162E\tab \tab LD\tab (SECTOR),HL\tab Store it in a currently unused
   1 \par 162D\tab RE-MAP\tab POP\tab HL\tab Fetch return address.
   1 \par 162D Restore Microdrive Map contents
   1 \par 162C\tab \tab JP \tab (HL) \tab Make an indirect return.
   1 \par 1629\tab \tab LD \tab HL,(SECTOR) \tab Fetch return address.
   1 \par 1627\tab \tab DJNZ\tab 1620,SA-MAP-LP\tab \tab Continue the loop.
   1 \par 1626\tab \tab PUSH\tab DE\tab \tab Save the two collected bytes into
   1 \par 1625\tab \tab INC\tab HL\tab Point to next location.
   1 \par 1624\tab \tab LD \tab (HL),C \tab Then clear map byte.
   1 \par 1623\tab \tab LD \tab D,(HL) \tab Fetch another map byte.
   1 \par 1622\tab \tab INC\tab HL\tab Point to next location.
   1 \par 1621\tab \tab LD \tab (HL),C \tab Then clear map byte.
   1 \par 1620\tab SA-MAP-LP\tab LD \tab E,(HL) \tab Fetch a byte from the map.
   1 \par 161D\tab \tab LD\tab BC,+1000\tab B counts 16 passes (map length/2)
   1 \par 161A\tab \tab LD\tab H,(CHMAP-hi)
   1 \par 1617\tab \tab LD\tab L,(CHMAP-lo)\tab Fetch map start address.
   1 \par 1614\tab \tab LD\tab (SECTOR),HL\tab unused variable.
   1 \par 1613\tab SA-MAP\tab POP\tab HL\tab Store return address in a currently
   1 \par 1613\tab SA-MAP\tab 1620\tab SA-MAP-LP\tab 162D\tab RE-MAP\tab 163D\tab RE-MAP-LP
   1 \par 1613 Save Microdrive Map contents
   1 \par 1612\tab \tab RET\tab \tab Finished.
   1 \par 160F\tab \tab CALL\tab 162D,RE-MAP\tab Restore map contents.
   1 \par 160D\tab \tab JR\tab NZ,15DF,USE-REC
   1 \par 160A\tab \tab LD\tab (ED-0B),A\tab records have been collected.
   1 \par 1609\tab \tab DEC\tab A\tab Decrease it and repeat until all
   1 \par 1606\tab \tab LD\tab A,(HD-0B)\tab Fetch number of records stored at
   1 \par 1603\tab \tab CALL\tab 1648,LD-VE-M\tab Load or verify this record.
   1 \par 1602\tab \tab EXX\tab \tab Restore initial register values.
   1 \par 1601\tab \tab LD\tab (HL),A
   1 \par 1600\tab \tab OR\tab B\tab from being fetched again.
   1 \par 15\tab NCTYPE\tab Packet type: 00 normal packet, 01 'end of file' packet.
   1 \par 15FF\tab \tab LD\tab A,(HL)\tab Set map bit to prevent the record
   1 \par 15FD\tab \tab JR\tab NZ,15DF,USE-REC\tab Repeat if this record has already
   1 \par 15FA\tab \tab CALL\tab 12DA,CHK-MAP-2\tab Check bit state for the current
   1 \par 15F9\tab LOOK-MAP\tab EXX\tab \tab Use alternate registers.
   1 \par 15F8\tab \tab ADD\tab HL,BC
   1 \par 15F5\tab \tab LD\tab BC,+0052
   1 \par 15F4\tab \tab POP\tab HL\tab of the 512-byte buffer.
   1 \par 15F2\tab \tab PUSH\tab IX\tab Make HL point to the start
   1 \par 15F1\tab \tab EX\tab DE,HL\tab Move it to DE.
   1 \par 15F0\tab \tab ADD\tab HL,DE\tab Calculate 'start' to use with this
   1 \par 15ED\tab \tab LD\tab HL,(HD-0D)\tab Fetch 'start'.
   1 \par 15EB\tab \tab LD\tab E,+F7\tab Exclude nine bytes of initial header.
   1 \par 15EA\tab \tab LD\tab D,A\tab Use it as high byte.
   1 \par 15E9\tab \tab DEC\tab A\tab A=RECNUM*2-1.
   1 \par 15E8\tab \tab RLA\tab \tab Now A = RECNUM*2.
   1 \par 15E6\tab \tab JR\tab Z,15DF,USE-REC
   1 \par 15E5\tab \tab OR\tab A
   1 \par 15E2\tab \tab LD\tab A,(RECNUM)\tab Repeat if RECNUM is still zero.
   1 \par 15DF\tab USE-REC\tab CALL\tab 166C,F-REC2\tab Fetch a record.
   1 \par 15DD\tab \tab JR\tab 15F9,LOOK-MAP\tab Jump forward.
   1 \par 15D9\tab \tab LD\tab DE,(HD-0D)\tab Fetch 'start' saved at 15A9.
   1 \par 15D8\tab \tab ADD\tab HL,DE
   1 \par 15D5\tab \tab LD\tab DE,+005B
   1 \par 15D4\tab \tab POP\tab HL\tab 'header information'.
   1 \par 15D2\tab \tab PUSH\tab IX\tab Make HL point after the nine bytes of
   1 \par 15CF\tab \tab LD\tab (RECLEN-hi),H
   1 \par 15CC\tab \tab LD\tab (RECLEN-lo),L\tab Store actual data block length.
   1 \par 15CA\tab \tab SBC\tab HL,DE
   1 \par 15C9\tab \tab OR\tab A
   1 \par 15C6\tab \tab LD\tab H,(RECLEN-hi)
   1 \par 15C3\tab \tab LD\tab L,(RECLEN-lo)\tab the 'block length'.
   1 \par 15C0\tab \tab LD\tab DE,+0009\tab Subtract the 'header length' from
   1 \par 15BD\tab \tab CALL\tab 1613,SA-MAP\tab Save the map into the stack.
   1 \par 15BA\tab \tab LD\tab (HD-0B),A
   1 \par 15B9\tab \tab LD\tab A,H\tab Save this value into HD-0B.
   1 \par 15B8\tab \tab INC\tab H\tab Include the 'EOF' record.
   1 \par 15B6\tab \tab SRL\tab H\tab The number of records that composes
   1 \par 15B5\tab \tab ADD\tab HL,DE
   1 \par 15B2\tab \tab LD\tab HL,+0008\tab Increase 'length' by 8.
   1 \par 15AF\tab \tab LD\tab D,(IX+84)\tab 'header information' held in the
   1 \par 15AC\tab \tab LD\tab E,(IX+83)\tab Get 'new' length directly from the
   1 \par 15A9\tab LV-MCH\tab LD\tab (HD-0D),HL\tab Store 'start'.
   1 \par 15A9 Load or verify block from Microdrive
   1 \par 15A8\tab \tab RET\tab \tab Finished.
   1 \par 15A6\tab \tab LDIR\tab \tab Copy header into HD variables.
   1 \par 15A3\tab \tab LD\tab BC,+0009\tab Length of 'header information'.
   1 \par 15A0\tab \tab LD\tab DE,+5CE6\tab Address of HD-00 variable.
   1 \par 159F\tab \tab ADD\tab HL,DE
   1 \par 159C\tab \tab LD\tab DE,+0052
   1 \par 159B\tab \tab POP\tab HL\tab buffer.
   1 \par 1599\tab F-HD-3\tab PUSH\tab IX\tab Point to the start of the 512-byte
   1 \par 1599\tab F-HD-3\tab 15A9\tab LV-MCH\tab 15DF\tab USE-REC\tab 15F9\tab LOOK-MAP
   1 \par 1598\tab \tab DEFB\tab +16
   1 \par 1597\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1595\tab \tab JR\tab NZ,1599,F-HD-3\tab 'PRINT-type' tile.
   1 \par 1591\tab F-HD-2\tab BIT\tab 2,(RECFLG)\tab Continue only if it is not a
   1 \par 1590\tab \tab DEFB\tab +11
   1 \par 158F\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 158D\tab \tab JR\tab Z,1591,F-HD-2
   1 \par 1589\tab \tab BIT\tab 0,(CHFLAG)\tab Continue only if the file is found.
   1 \par 1586\tab \tab CALL\tab 1B29,OP-TEMP-M\tab Open a temporary "m" channel.
   1 \par 1583\tab \tab LD\tab (5CE4),HL
   1 \par 1580\tab F-M-HEAD\tab LD\tab HL,(5CE1)\tab Move 'start' of data into +5CE4.
   1 \par 1580 Get header information from Microdrive
   1 \par 157D\tab \tab JP\tab 10C4,DEL-M-BUF\tab Exit via the delete-channel
   1 \par 157A\tab \tab CALL\tab 17F7,SEL-DRIVE
   1 \par 1579\tab END-SA-DR\tab XOR\tab A\tab Turn off Microdrive motor.
   1 \par 1577\tab \tab JR\tab 14FC,NEW-NAME\tab Make another copy.
   1 \par 1574\tab \tab LD\tab (CHREC),A
   1 \par 1572\tab \tab LD\tab A,+00\tab Clear CHREC.
   1 \par 156E\tab \tab RES\tab 1,(RECFLG)\tab Signal 'not EOF'.
   1 \par 156B\tab \tab LD\tab (COPIES),A\tab Store new value.
   1 \par 1569\tab \tab JR\tab Z,1579,END-SA-DR
   1 \par 1568\tab \tab DEC\tab A\tab reached zero.
   1 \par 1565\tab \tab LD\tab A,(COPIES)\tab Decrease COPIES and exit if it has
   1 \par 1562\tab \tab CALL\tab 120D,WRITE-PRC\tab Write the last data block.
   1 \par 155E\tab SA-DRI-4\tab SET\tab 1,(RECFLG)\tab Mark as 'EOF' record.
   1 \par 155E\tab SA-DRI-4\tab 1579\tab END-SA-DR\tab 1580\tab F-M-HEAD\tab 1591\tab F-HD-2
   1 \par 155C\tab \tab JR\tab 1538,SA-DRI-3
   1 \par 1559\tab \tab INC\tab (CHBYTE-hi)
   1 \par 1557\tab \tab JR\tab NZ,SA-DRI-3\tab loop.
   1 \par 1554\tab \tab INC\tab (CHBYTE-lo)\tab Increment CHBYTE and go back into the
   1 \par 1552\tab SA-DRI-WR\tab LDI\tab \tab Move a byte to the buffer.
   1 \par 1551\tab \tab POP\tab HL\tab Restore pointer.
   1 \par 1550\tab \tab EX\tab DE,HL
   1 \par 154E\tab \tab ADD\tab HL,DE
   1 \par 154C\tab \tab LD\tab DE,+0052
   1 \par 154B\tab \tab POP\tab HL\tab buffer.
   1 \par 1549\tab \tab PUSH\tab IX\tab Make DE point to the start of the
   1 \par 1548\tab \tab POP\tab BC\tab Restore counter.
   1 \par 1545\tab \tab CALL\tab 123D,WRITE-PRC\tab \tab Write this data block onto cartridge.
   1 \par 1544\tab \tab PUSH\tab BC
   1 \par 1543\tab \tab PUSH\tab HL\tab Save registers.
   1 \par 1541\tab \tab JR\tab NZ,1552,SA-DRI-WR
   1 \par 153D\tab \tab LD\tab A,(CHBYTE-hi)\tab Jump until the buffer space has been
   1 \par 153A\tab \tab JR\tab Z,155E,SA-DRI-4
   1 \par 1539\tab \tab OR\tab C
   1 \par 1538\tab SA-DRI-3\tab LD\tab A,B\tab Jump when it reaches zero.
   1 \par 1534\tab \tab LD\tab BC,(HD-0B)\tab Fetch 'length' of data.
   1 \par 1531\tab \tab LD\tab HL,(5CE4)\tab Fetch 'start' of block from
   1 \par 1530\tab SA-BRI-2\tab POP\tab DE\tab Restore address of 'first free byte'
   1 \par 152F\tab \tab DEFB\tab +0F
   1 \par 152E\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 152D\tab \tab JR\tab NC,1530,SA-DRI-2
   1 \par 152B\tab \tab CP\tab H\tab 'free' sectors.
   1 \par 152A\tab \tab LD\tab A,E\tab Jump if there are sufficient
   1 \par 1529\tab \tab POP\tab HL\tab Restore H.
   1 \par 1526\tab \tab CALL\tab 1D38,FREESECT\tab Calculate into E the number of 'free'
   1 \par 1525\tab \tab PUSH\tab HL\tab Save H register.
   1 \par 1524\tab \tab INC\tab H\tab Allow for a further EOF sector.
   1 \par 1522\tab \tab SRL\tab H\tab H holds INT(length/5l2), i.e. number
   1 \par 1521\tab \tab ADD\tab HL,BC
   1 \par 151E\tab \tab CP\tab +02\tab filled.
   1 \par 151D\tab \tab LD\tab BC,(HD-0B)
   1 \par 151A\tab \tab LD\tab HL,+0009\tab Add 9 to 'data length'.
   1 \par 1519\tab \tab PUSH\tab DbE\tab Save address of 'first free byte'.
   1 \par 1517\tab \tab LDIR\tab \tab Store header informations.
   1 \par 1514\tab \tab LD\tab (CHBYTE-lo),C\tab Current position is '9'.
   1 \par 1511\tab \tab LD\tab BC,+0009\tab Length of HD variables.
   1 \par 150E\tab \tab LD\tab HL,+5CE6\tab Address of HD-00.
   1 \par 150D\tab \tab EX\tab DE,HL
   1 \par 150C\tab \tab ADD\tab HL,DE
   1 \par 1509\tab \tab LD\tab DE,+0052
   1 \par 1508\tab \tab POP\tab HL
   1 \par 1506\tab \tab PUSH\tab IX\tab Make HL point to the buffer.
   1 \par 1503\tab \tab CALL\tab 17E7,SEL-DRIVE\tab Start motor.
   1 \par 1500\tab \tab LD\tab A,(CHDRIV)\tab Fetch drive number.
   1 \par 14\tab CHNAME\tab 10-byte filename with trailing spaces.
   1 \par 14FC\tab NEW-NAME\tab SET\tab 2,(RECFLG)\tab Signal 'not a PRINT file'.
   1 \par 14FC\tab NEW-NAME\tab 1530\tab SA-DRI-2\tab 1538\tab SA-DRI-3\tab 1552\tab SA-DRI-WR
   1 \par 14FB\tab \tab DEFB\tab +0C
   1 \par 14FA\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 14F5\tab \tab JR\tab NZ,14FC,NEW-NAME\tab not already exist in the cartridge.
   1 \par 14F1\tab \tab BIT\tab 0,(CHFLAG)\tab Continue only if this file does
   1 \par 14EE\tab \tab CALL\tab 1B29,OP-TEMP-M\tab Open a temporary "m" channel.
   1 \par 14EB\tab \tab LD\tab (5CE4),HL\tab Store it into (N-STR2+2).
   1 \par 14E8\tab START-SA\tab LD\tab HL,(HD-0D)\tab Fetch 'start' of data.
   1 \par 14E7\tab \tab DEFB\tab +0E\tab routine.
   1 \par 14E6\tab \tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 14E4\tab \tab JR\tab NZ,14E8,START-SA
   1 \par 14E2\tab \tab AND\tab +01\tab tab was not removed.
   1 \par 14E0\tab \tab IN\tab A,(+EF)\tab Continue only if the write-protect
   1 \par 14DD\tab \tab CALL\tab 17F7,SEL-DRIVE\tab Turn on drive motor.
   1 \par 14DA\tab SA-DRIVE\tab LD\tab A,(D-STR1)\tab Fetch drive number.
   1 \par 14DA Save data block into Mlcrodrive
   1 \par 14D9\tab \tab RET\tab \tab Finished.
   1 \par 14D7\tab \tab DJNZ\tab 14CE,ALL-BYT-2\tab Continue for all bytes in the
   1 \par 14D6\tab \tab INC\tab DE
   1 \par 14D5\tab \tab INC\tab HL\tab Advance pointers.
   1 \par 14D4\tab \tab EX\tab DE,HL\tab Exchange pointers again.
   1 \par 14D3\tab \tab LD\tab (DE),A\tab Store into D-STR2.
   1 \par 14D2\tab \tab LD\tab (HL),C\tab Store into D-STR1.
   1 \par 14D1\tab \tab EX\tab DE,HL\tab Exchange pointers.
   1 \par 14D0\tab \tab LD\tab C,(HL)\tab Fetch byte from D-STR2.
   1 \par 14CF\tab ALL-BYT-2\tab LD\tab A,(DE)\tab Fetch byte from D-STR1.
   1 \par 14CD\tab \tab LD\tab B,+08\tab Length of both areas.
   1 \par 14CA\tab \tab LD\tab HL,+5CDE\tab Start of 2nd area.
   1 \par 14C7\tab EX-DSTR2\tab LD\tab DE,+5CD6\tab Start of 1st area.
   1 \par 14C7\tab EX-DSTR2\tab 14CF\tab ALL-BYT-2\tab 14DA\tab SA-DRIVE\tab 14E8\tab START-SA
   1 \par 14C7 Exchange DSTR1 and STR2 contents
   1 \par 14C6\tab \tab RET\tab \tab Finished.
   1 \par 14C3\tab \tab CALL\tab 0EF5,SEND-NEOF\tab Close the "n" channel.
   1 \par 14BF\tab \tab LD\tab (CURCHL),IX\tab Make the "n" channel the 'current' one
   1 \par 14BB\tab \tab LD\tab IX,(N-STR1)\tab Fetch channel start addreus.
   1 \par 14BA\tab \tab RET\tab NZ
   1 \par 14B8\tab CL-CHK-N\tab CP\tab +4E\tab Return with "b" and "t" channels.
   1 \par 14B7\tab \tab RET\tab \tab Finished.
   1 \par 14B4\tab \tab CALL\tab 12A9,CLOSE-M2\tab Close the "m" channel.
   1 \par 14B0\tab \tab LD\tab IX,(N-STR1)\tab Fetch channel start address.
   1 \par 14AE\tab \tab JR\tab NZ,14B8,CL-CHK-N
   1 \par 14AC\tab \tab CP\tab +4D\tab Jump if not "m" channel.
   1 \par 14A9\tab \tab LD\tab A,(L-STR1)\tab Fetch channel specifier.
   1 \par 14A8\tab \tab RET\tab NZ
   1 \par 14A7\tab \tab INC\tab A\tab Return if a stream has been used
   1 \par 14A4\tab CL-CHAN\tab LD\tab A,(S-STR1)\tab Fetch stream number.
   1 \par 14A4 Close 'MOVE' channel
   1 \par 14A3\tab \tab RET\tab \tab Finished.
   1 \par 149F\tab \tab SET\tab 7,(IX+4)\tab Make the channel 'temporary'.
   1 \par 149D\tab \tab POP\tab IX
   1 \par 149C\tab \tab PUSH\tab DE\tab Make IX point to start of channel.
   1 \par 1498\tab \tab LD\tab (N-STR1),DE\tab Store channel start address.
   1 \par 1495\tab USE-R\tab CALL\tab 0B13,OP-RS-CH\tab Open a permanent "b" or "t" channel.
   1 \par 1494\tab \tab DEFB\tab +00
   1 \par 1493\tab \tab RST\tab 28,SH-ERR\tab Call the error handling routine.
   1 \par 1491\tab \tab JR\tab Z,1495,USE-R
   1 \par 148F\tab \tab CP\tab +42\tab Jump with "b" channel.
   1 \par 148D\tab \tab JR\tab Z,1495,USE-R
   1 \par 148B\tab CHECK-R\tab CP\tab +54\tab Jump with "t" channel.
   1 \par 148B\tab CHECK-R\tab 1495\tab USE-R\tab 14A4\tab CL-CHAN\tab 14B8\tab CL-CHK-N
   1 \par 148A\tab \tab RET\tab \tab Finished.
   1 \par 1486\tab \tab LD\tab (N-STR1),IX\tab Store channel start address,
   1 \par 1483\tab \tab CALL\tab 0EA9,OP-TEMP-N\tab Open a temporary "n" channel.
   1 \par 1481\tab \tab JR\tab NZ,148B,CHECK-R
   1 \par 147F\tab CHECK-N\tab CP\tab +4E\tab Jump if not an "n" channel.
   1 \par 147E\tab \tab DEFB\tab +16
   1 \par 147D\tab \tab RST\tab 28,SH-ERR\tab Call the error handling routine.
   1 \par 147C\tab \tab RET\tab Z\tab MOVE command.
   1 \par 1478\tab \tab BIT\tab 2,(RECFLG)\tab Allow only PRINT-type files with the
   1 \par 1474\tab \tab LD\tab (N-STR1),IX\tab Store channel start address.
   1 \par 1471\tab \tab CALL\tab 17F7,SEL-DRIVE
   1 \par 1470\tab \tab XOR\tab A\tab Switch off drive motor.
   1 \par 146D\tab \tab CALL\tab 1B29,OP-TEMP-M\tab Open a temporary "m" channel.
   1 \par 146B\tab \tab JR\tab NZ,147F,CHECK-N
   1 \par 1469\tab \tab CP\tab +4D\tab Jump if not "m".
   1 \par 1466\tab OP-CHAN\tab LB\tab A,(L-STR1)\tab Fetch channel specifier
   1 \par 1465\tab \tab RET\tab \tab Finished.
   1 \par 1462\tab \tab LD\tab (N-STR1),HL\tab Store it.
   1 \par 145F\tab \tab LD\tab HL,(CURCHL)\tab Fetch channel start address.
   1 \par 145D\tab \tab DEFW\tab +1601
   1 \par 145C\tab \tab RST\tab 10,CAL8AS\tab Call 'CHAN-OPEN' to select the stream.
   1 \par 145B\tab \tab DEC\tab A\tab A holds the stream number.
   1 \par 1459\tab \tab JR\tab Z,1466,OP-CHAN\tab nonexistent), jump to open a
   1 \par 1458\tab \tab INC\tab A\tab If stream no. is +FF (i.e.
   1 \par 1455\tab OP-STRM\tab LD\tab A,(S-STR1)\tab Fetch stream number.
   1 \par 1455 Use stream or temporary channel
   1 \par 1454\tab \tab RET\tab \tab Finished.
   1 \par 1451\tab \tab CALL\tab 17B9,RCL-T-CH\tab Reclaim temporary channels and switch
   1 \par 144E\tab \tab CALL\tab 14A4,CL-CHAN\tab Close the first channel.
   1 \par 144B\tab \tab LD\tab (N-STR1),HL
   1 \par 144A\tab \tab ADD\tab HL,DE\tab first channel.
   1 \par 1446\tab \tab LD\tab DE,(N-STR1)\tab Calculate the new start address of
   1 \par 1444\tab \tab SBC\tab HL,DE\tab reclaimed after the deletion of the
   1 \par 1443\tab \tab OR\tab A\tab Calculate the amount of bytes
   1 \par 1440\tab \tab LD\tab HL,(CHANS)\tab Fetch current CHANS address.
   1 \par 143F\tab \tab POP\tab DE\tab Restore initial address of CHANS.
   1 \par 143C\tab \tab CALL\tab 14C7,EX-DSTR2\tab Exchange D-STR areas again.
   1 \par 1439\tab \tab CALL\tab 14A4,CL-CHAN\tab Close the second channel.
   1 \par 1436\tab \tab CALL\tab 14C7,EX-DSTR2\tab Exchange D-STR areas,
   1 \par 1435\tab \tab PUSH\tab HL
   1 \par 1432\tab \tab LD\tab HL,(CHANS)\tab Store current CHANS address.
   1 \par 142E\tab MOVE-EOF\tab RES\tab 4,(FLAGS3)\tab Signal that the MOVE command is
   1 \par 142E\tab MOVE-EOF\tab 1455\tab OP-STRM\tab 1466\tab OP-CHAN\tab 147F\tab CHECK-N
   1 \par 142C\tab \tab JR\tab 1414,M-AGAIN\tab Repeat the whole procedure.
   1 \par 142A\tab \tab DEFW\tab +0010\tab send the byte through the 2nd channel
   1 \par 1429\tab \tab RST\tab 10,CALBAS\tab Use main ROM 'PRINT-A' restart to
   1 \par 1426\tab \tab LD\tab (CURCHL),HL
   1 \par 1423\tab MOVE-OUT\tab LD\tab HL,(N-STR2)\tab Make 'current' the 2nd channel.
   1 \par 1421\tab \tab JR\tab 142E,MOVE-EOF\tab Jump when EOF has been reached.
   1 \par 141F\tab \tab JR\tab Z,141A,I-AGAIN\tab Repeat if no data has been read.
   1 \par 141D\tab \tab JR\tab C,1423,MOVE-OUT\tab Jump with acceptable codes.
   1 \par 141B\tab \tab DEFW\tab +15E6\tab read a byte.
   1 \par 141A\tab I-AGAIN\tab RST\tab 10,CAL8AS\tab Call INPUT-A in the main ROM to
   1 \par 1417\tab \tab LD\tab (CURCHL),HL
   1 \par 1414\tab M-AGAIN\tab LD\tab HL,(N-STR1)\tab Make 'current' the 1st channel
   1 \par 1411\tab \tab LD\tab (N-STR1),HL\tab Store it.
   1 \par 1410\tab \tab ADD\tab HL,DE\tab Calculate 'current' start.
   1 \par 140C\tab \tab LD\tab DE,(N-STR1)\tab Fetch start of first channel.
   1 \par 140A\tab \tab SBC\tab HL,DE\tab HL holds the length of the space
   1 \par 1409\tab \tab OR\tab A\tab Clear carry for a true subtraction.
   1 \par 1406\tab \tab LD\tab HL,(CHANS)\tab Current start of CHANS.
   1 \par 1405\tab \tab POP\tab DE\tab Initial start of CHANS.
   1 \par 1402\tab \tab CALL\tab 14C7,EX-DSTR2\tab Exchange D-STR areas again.
   1 \par 13\tab NCNUMB\tab Current block bumber 0..65535.
   1 \par 13\tab CHREC\tab Record number 0..255. Also used as temporary store of sector
   1 \par 13FF\tab \tab CALL\tab 1455,OP-STRM\tab Open second channel.
   1 \par 13FC\tab \tab CALL\tab 14C7,EX-DSTR2\tab Exchange D-STR areas.
   1 \par 13FB\tab \tab PUSH\tab BC
   1 \par 13F8\tab \tab LD\tab HL,(CHANS)\tab Store current value 0f CHANS.
   1 \par 13F5\tab \tab CALL\tab 1455,OP-STRM\tab Open the first channel.
   1 \par 13F1\tab MOVE\tab SET\tab 4,(FLAGS3)\tab See comment above.
   1 \par 13F1\tab MOVE\tab 1414\tab M-AGAIN\tab 141A\tab I-AGAIN\tab 1423\tab MOVE-OUT
   1 \par 13F1 MOVE command
   1 \par 13EE\tab \tab DEFB\tab +00,+FF,+FF
   1 \par 13EB\tab \tab DEFB\tab +00,+00,+00
   1 \par 13E8\tab \tab DEFB\tab +00,+00,+00
   1 \par 13E5\tab \tab DEFB\tab +00,+00,+00
   1 \par 13E5 Preamble data
   1 \par 13E4\tab \tab DEFB\tab +FF\tab \tab Default for CHFLAG ('write' channel).
   1 \par 13DA\tab \tab DEFM\tab " (10 spc) "\tab Default for CHNAME.
   1 \par 13D9\tab \tab DEFB\tab +00\tab \tab Default for CHREC.
   1 \par 13D7\tab \tab DEFW\tab +0000\tab \tab Default for CHBYTE.
   1 \par 13D5\tab \tab DEFW\tab +0253\tab \tab Channel length.
   1 \par 13D3\tab \tab DEFW\tab +1122\tab \tab Shadow ROM 'input' routine.
   1 \par 13D1\tab \tab DEFW\tab +11D8\tab \tab Shadow ROM 'output' routine.
   1 \par 13D0\tab \tab DEFB\tab +CD\tab \tab "M"+80H (channel specifier).
   1 \par 13CE\tab \tab DEFW\tab +0008\tab \tab Main ROM 'input' routine.
   1 \par 13CC\tab \tab DEFW\tab +0008\tab \tab Main ROM 'output' routine.
   1 \par 13CC "M" channel data
   1 \par 13CA\tab \tab JR\tab 139D,LCHAN\tab Loop again.
   1 \par 13C8\tab \tab ADD\tab IX,DE\tab Point to next channel.
   1 \par 13C5\tab \tab LD\tab D,(IX+10)
   1 \par 13C2\tab \tab LD\tab E,(IX+9)\tab Fetch channel length.
   1 \par 13C1\tab LPEND\tab POP\tab HL\tab Restore 'start' of deleted map.
   1 \par 13BE\tab \tab LD\tab (CMMAP-hi),H
   1 \par 13BB\tab \tab LD\tab (CHMAP-lo),L\tab store it.
   1 \par 13B9\tab \tab SBC\tab HL,BC\tab Calculate actual start address and
   1 \par 13B8\tab \tab OR\tab A\tab Clear carry.
   1 \par 13B7\tab \tab EX\tab DE,HL\tab HL = old map address.
   1 \par 13B5\tab \tab JR\tab NC,13C1,LPEND
   1 \par 13B3\tab \tab SBC\tab HL,DE\tab Jump if this map has not been moved.
   1 \par 13B0\tab \tab LD\tab D,(CHMAP-hi)
   1 \par 13AD\tab \tab LD\tab E,(CHMAP-lo)\tab Fetch address of map.
   1 \par 13AB\tab \tab JR\tab NZ,13C1,LPEND
   1 \par 13A9\tab \tab CP\tab +4D\tab Jump if this is not an "m" channel.
   1 \par 13A7\tab \tab AND\tab +7F\tab No distinction between 'temporary'
   1 \par 13A4\tab \tab LD\tab A,(IX+4)\tab Fetch channel specifier.
   1 \par 13A3\tab \tab PUSH\tab HL\tab Save 'start' of map.
   1 \par 13A2\tab \tab RET\tab Z
   1 \par 13A0\tab \tab CP\tab +80
   1 \par 139D\tab LCHAN\tab LD\tab A,(IX+0)\tab Return if the CHANS area is finished.
   1 \par 139B\tab \tab ADD\tab IX,DE
   1 \par 1398\tab \tab LD\tab DE,+0014\tab 'standard' one.
   1 \par 1394\tab \tab LD\tab IX,(CHANS)\tab Point to the first channel other than
   1 \par 1391\tab REST-MAP\tab LD\tab BC,+0020\tab Length of map.
   1 \par 1391 Restore map addresses
   1 \par 1390\tab \tab RET\tab \tab Finished.
   1 \par 138F\tab \tab POP\tab HL\tab Restore displacement.
   1 \par 138C\tab \tab LD\tab (X-PTR-lo),A\tab Clear X-PTR.
   1 \par 138A\tab \tab JR\tab NZ,1365,NXT-STRM\tab been examined.
   1 \par 1389\tab \tab DEC\tab A\tab Jump back until all 16 streams have
   1 \par 1388\tab \tab INC\tab HL
   1 \par 1387\tab \tab INC\tab HL\tab Advance to data for next stream.
   1 \par 1384\tab UPD-POINT\tab LD\tab HL,(X-PTR)\tab Fetch pointer of current stream data.
   1 \par 1384\tab UPD-POINT\tab 1391\tab REST-MAP\tab 139D\tab LCHAN\tab 13C1\tab LPEND
   1 \par 1383\tab \tab LD\tab (HL),D
   1 \par 1382\tab \tab INC\tab HL
   1 \par 1381\tab \tab LD\tab (HL),E\tab the current stream.
   1 \par 137E\tab STO-DISP\tab LD\tab HL,(X-PTR)\tab Store the new displacement for
   1 \par 137D\tab \tab EX\tab DE,HL\tab Move it into DE.
   1 \par 137B\tab \tab SBC\tab HL,BC\tab Obtain new displacement.
   1 \par 137A\tab \tab OR\tab A\tab Clear carry.
   1 \par 1379\tab \tab EX\tab DE,HL\tab HL holds the current displacement.
   1 \par 1377\tab NOTRIGHT\tab JR\tab NC,1384,UPD-POINT\tab Jump if the stream data does not need
   1 \par 1375\tab \tab JR\tab 137E,STO-DISP\tab displacement = 0.
   1 \par 1372\tab \tab LD\tab DE,+0000\tab Close the stream by storing a
   1 \par 1370\tab \tab JR\tab NZ,1377,NOTRIGHT\tab closed.
   1 \par 136E\tab \tab SBC\tab HL,DE\tab Jump if this is not the stream to be
   1 \par 136D\tab \tab OR\tab A\tab Clear carry.
   1 \par 136C\tab \tab PUSH\tab HL\tab closed.
   1 \par 136B\tab \tab POP\tab HL\tab Restore displacement of stream to be
   1 \par 136A\tab \tab LD\tab D,(HL)
   1 \par 1369\tab \tab INC\tab HL\tab current stream.
   1 \par 1368\tab \tab LD\tab E,(HL)\tab Fetch stream displacement for the
   1 \par 1365\tab NXT-STRM\tab LD\tab (X-PTR),HL\tab Save current address into X-PTR.
   1 \par 1362\tab \tab LD\tab HL,+5C16\tab Start with STRMS-0 address.
   1 \par 1360\tab \tab LD\tab A,+10\tab Counts 16 streams.
   1 \par 135F\tab REST-STRM\tab PUSH\tab HL\tab Save stream displacement.
   1 \par 135F\tab REST-STRM\tab 1365\tab NXT-STRM\tab 1377\tab NOTRIGHT\tab 137E\tab STO-DISP
   1 \par 135F Restore stream data
   1 \par 135E\tab \tab RET\tab \tab Finished.
   1 \par 135D\tab \tab POP\tab HL\tab Restore start address.
   1 \par 135C\tab \tab LD\tab (HL),A\tab Store new checksum.
   1 \par 135B\tab \tab CP\tab (HL)\tab Compare with previous checksum.
   1 \par 135A\tab \tab LD\tab A,E\tab Move checksum into A.
   1 \par 1358\tab \tab JR\tab NZ,134C,NXT-BYTE
   1 \par 1357\tab \tab OR\tab C
   1 \par 1356\tab \tab LD\tab A,B\tab Repeat until the counter reaches 0.
   1 \par 1355\tab \tab DEC\tab BC\tab Decrement counter.
   1 \par 1354\tab STCHK\tab LD\tab E,A\tab Update sum.
   1 \par 1353\tab \tab DEC\tab A\tab Otherwise balance the ADD above.
   1 \par 1351\tab \tab JR\tab Z,1354,STCHK\tab Jump when A reaches zero.
   1 \par 134F\tab \tab ADC\tab A,+01\tab Include also the carry.
   1 \par 134E\tab \tab INC\tab HL\tab Point to next location.
   1 \par 134D\tab \tab ADD\tab A,(HL)\tab previous sum.
   1 \par 134C\tab NXT-BYTE\tab LD\tab A,E\tab Add the current byte to the
   1 \par 134A\tab \tab LD\tab E,+00\tab Start with E cleared.
   1 \par 1349\tab CHKS-ALL\tab PUSH\tab HL\tab Save the start address.
   1 \par 1346\tab CHKS-BUFF\tab LD\tab BC,+0200\tab The block length.
   1 \par 1346\tab CHKS-BUFF\tab 1349\tab CHKS-ALL\tab 134C\tab NXT-BYTE\tab 1354\tab STCHK
   1 \par 1344\tab \tab JR\tab 1349,CHKS-ALL\tab Skip next instruction.
   1 \par 1341\tab CHKS-HD-R\tab LD\tab BC,+000E\tab The block length.
   1 \par 1341 Calculate/compare checksums
   1 \par 1340\tab \tab RET\tab \tab Finished.
   1 \par 133E\tab CKNAM-END\tab POP\tab IX\tab Restore channel start address.
   1 \par 133C\tab \tab DJNZ\tab 1333,ALCCHR-2\tab been examined.
   1 \par 133A\tab \tab INC\tab IX\tab Continue until the whole CHNAME has
   1 \par 1338\tab \tab JR\tab NZ,133E,CKNAM-END\tab Signal 'unsuccessful' if not spaces.
   1 \par 1336\tab \tab CP\tab +20\tab characters of CHNAME are spaces.
   1 \par 1333\tab ALLCHR-2\tab LD\tab A,(IX+14)\tab Otherwise check that the following
   1 \par 1331\tab \tab JR\tab Z,133E,CKNAM-END\tab reached zero).
   1 \par 1330\tab \tab OR\tab A\tab Exit if successful (CHNAME length has
   1 \par 132F\tab \tab LD\tab A,B\tab CHNAME remaining length.
   1 \par 132D\tab \tab JR\tab NZ,1322,ALL-CHARS\tab Continue until the length of the name
   1 \par 132C\tab \tab DEC\tab C
   1 \par 132B\tab \tab DEC\tab B\tab Decrease 'lengths'.
   1 \par 1329\tab \tab INC\tab IX
   1 \par 1328\tab \tab INC\tab HL\tab Point to next character.
   1 \par 1326\tab \tab JR\tab NZ,133E,CKNAM-END\tab Jump if it does not match.
   1 \par 1323\tab \tab CP\tab (IX+14)\tab Compare it against CHNAME.
   1 \par 1322\tab ALL-CHARS\tab LD\tab A,(HL)\tab Fetch a byte from name.
   1 \par 1322\tab ALL-CHARS\tab 1333\tab ALLCHR-2\tab 133E\tab CHKNAM-END\tab 1341\tab CHKS-HD-R
   1 \par 1320\tab \tab LD\tab B,+0A\tab Length of CHNAME.
   1 \par 131E\tab CHK-NAME\tab PUSH\tab IX\tab Save start of channel.
   1 \par 131E CHECK-NAME
   1 \par 131D\tab \tab RET\tab \tab Finished.
   1 \par 131C\tab \tab OR\tab C\tab zero.
   1 \par 131B\tab \tab LD\tab A,B\tab Set zero flag if SECTOR has reached
   1 \par 1317\tab \tab LD\tab (SECTOR),BC
   1 \par 1316\tab \tab DEC\tab BC
   1 \par 1312\tab DEC-SECT\tab LD\tab BC,(SECTOR)\tab Decrease (SECTOR).
   1 \par 1312 Decrease sector counter
   1 \par 1310\tab \tab JR\tab 12E8,ENTRY-2\tab Continue into CHECK-MAP.
   1 \par 130D\tab \tab LD\tab E,(HDNUMB)\tab Fetch sector number.
   1 \par 130C\tab \tab ADD\tab HL,DE
   1 \par 1309\tab \tab LD\tab DE,+0052\tab the 'pseudo-map' area.
   1 \par 1308\tab \tab POP\tab HL\tab buffer. I.e. to the start of
   1 \par 1306\tab TEST-PMAP\tab PUSH\tab IX\tab Make HL point to the start of the
   1 \par 1306 Check 'pseudo-map' bit state
   1 \par 1305\tab \tab RET\tab \tab Finished.
   1 \par 1304\tab \tab LD \tab (HL),A \tab Store new map byte.
   1 \par 1303\tab \tab AND\tab (HL)\tab leave other bits unchanged.
   1 \par 1302\tab \tab CPL\tab \tab Reset only that bit and
   1 \par 1301\tab \tab LD \tab A,B \tab Pass bit to be reset to A.
   1 \par 12\tab NCSELF\tab Own station number 1..64.
   1 \par 12FF Reset bit in map area
   1 \par 12FE\tab RES-B-MAP\tab CALL\tab 12DF,CHECK-MAP\tab Set B and HL registers with position
   1 \par 12FE\tab RES-B-MAP\tab 1306\tab TEST-PMAP\tab 1312\tab DEC-SECT\tab 131E\tab CHK-NAME
   1 \par 12FD\tab \tab RET\tab \tab Finished.
   1 \par 12FC\tab \tab AND\tab (HL)\tab Set zero flag as required.
   1 \par 12FB\tab \tab LD\tab B,A\tab Exit with B holding that bit.
   1 \par 12F9\tab \tab DJNZ\tab 12F8,ROTATE
   1 \par 12F8\tab ROTATE\tab RLA\tab \tab Set a bit in the correct position.
   1 \par 12F7\tab \tab SCF\tab \tab Set carry flag.
   1 \par 12F6\tab \tab XOR\tab A\tab Clear A register.
   1 \par 12F5\tab \tab INC\tab B\tab Range is now 1..8.
   1 \par 12F4\tab \tab LD\tab B,A\tab Pass 'position' to B.
   1 \par 12F3\tab \tab ADD\tab HL,DE\tab Calculate map bit address.
   1 \par 12F1\tab \tab SRL\tab E
   1 \par 12EF\tab \tab SRL\tab E
   1 \par 12ED\tab \tab SRL\tab E\tab Shift out the 'position' from E.
   1 \par 12EB\tab \tab AND\tab +07\tab Only 3 less significant bits,
   1 \par 12EA\tab \tab LD\tab A,E\tab Move sector number to A.
   1 \par 12E9\tab \tab LD\tab D,A
   1 \par 12E8\tab ENTRY-2\tab XOR\tab A\tab Clear D register.
   1 \par 12E5\tab \tab LD\tab H,(CHMAP-hi)
   1 \par 12E2\tab ENTRY\tab LD\tab L,(CHMAP-lo)\tab Fetch map start address.
   1 \par 12E1\tab CHECK-MAP\tab LD\tab E,(HDNUMB)\tab Fetch sector number.
   1 \par 12DF\tab CHECK-MAP\tab 12E2\tab ENTRY\tab 12E8\tab ENTRY-2\tab 12F8\tab ROTATE
   1 \par 12DD\tab \tab JR\tab 12E2,ENTRY\tab Jump forward.
   1 \par 12DA\tab CHK-KAP-2\tab CD\tab E,(RECNUM)\tab Fetch sector number.
   1 \par 12DA Check map bit state
   1 \par 12D9\tab \tab RET\tab \tab Finished.
   1 \par 12D7\tab \tab JR\tab Z,12C4,GET-M-HD2\tab been loaded instead of a header.
   1 \par 12D3\tab \tab BIT\tab 0,(HDFLAG)\tab Repeat if a record descriptor has
   1 \par 12D1\tab \tab JR\tab NZ,12C4,GET-M-HD2\tab Repeat if it does not match with the
   1 \par 12CE\tab \tab CALL\tab 1341,CHKS-HD-R\tab Calculate checksum.
   1 \par 12CB\tab \tab CALL\tab 18A3,GET-M-HD\tab Fetch the header.
   1 \par 12CA\tab \tab ADD\tab HL,DE
   1 \par 12C7\tab \tab LD\tab DE,+0028
   1 \par 12C6\tab \tab POP\tab HL\tab from which the header will be loaded.
   1 \par 12C4\tab GET-M-HD2\tab PUSH\tab IX\tab Make HL point to MDFLAG, i.e. location
   1 \par 12C4 Fetch header from Microdrive
   1 \par 12C3\tab \tab RST\tab 28,ROMERR\tab Give the error report.
   1 \par 12C0\tab \tab LD\tab (ERR-NR),A\tab Store it.
   1 \par 12BF\tab \tab LD\tab A,(HL)\tab Fetch error code.
   1 \par 12BE\tab ERR-RS\tab POP\tab HL\tab Fetch return address (points to the
   1 \par 12BE ERR-RS
   1 \par 12BD\tab \tab RET\tab \tab Finished.
   1 \par 12BA\tab \tab CALL\tab 10C4,DEL-M-BUF\tab Reclaim the channel.
   1 \par 12B6\tab NOEMP\tab 12BE\tab ERR-RS\tab 12C4\tab GET-M-HD2\tab 12DA\tab CHK-MAP-2
   1 \par 12B3\tab \tab CALL\tab 11FF,WR-RECD\tab and write it onto drive.
   1 \par 12AF\tab \tab SET\tab 1,(RECFLG)\tab Otherwise signal 'EOF' record,
   1 \par 12AD\tab \tab JR\tab Z,12B6,NOEMP
   1 \par 12A9\tab CLOSE-M2\tab BIT\tab 0,(CHFLAG)\tab Jump forward when 'reading'.
   1 \par 12A7\tab \tab POP\tab IX\tab of the channel.
   1 \par 12A6\tab CLOSE-M\tab PUSH\tab HL\tab Make IX register point to the start
   1 \par 12A6 Close file
   1 \par 12A5\tab \tab RET\tab \tab Finished.
   1 \par 12A4\tab \tab LD\tab (HL),A
   1 \par 12A3\tab \tab OR\tab (HL)
   1 \par 12A2\tab \tab LD\tab A,B\tab Set the required map bit.
   1 \par 12A1\tab \tab POP\tab HL\tab Restore map bit address.
   1 \par 12A0\tab \tab POP\tab BC\tab Restore map bit position.
   1 \par 129E\tab \tab OUT\tab (+EF),A
   1 \par 129C\tab \tab LD\tab A,+EE\tab Send a signal when finished.
   1 \par 1299\tab \tab CALL\tab 1878,OUT-M-BUF\tab Write preamble and data block.
   1 \par 1296\tab \tab CALL\tab 18FA,DELAY-BC
   1 \par 1293\tab \tab LD\tab BC,+0168\tab Wait until the first gap is finished.
   1 \par 1291\tab \tab OUT\tab (+EF),A
   1 \par 128F\tab NO-PRT\tab LD\tab A,+E6\tab Start the writing process.
   1 \par 128E\tab \tab DEFB\tab +0E
   1 \par 128D\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 128B\tab \tab JR NZ,128F,NO-PRT
   1 \par 1289\tab \tab AND\tab +01\tab present.
   1 \par 1287\tab \tab IN\tab A,(+EF)\tab Jump if the write-protect tab is
   1 \par 1286\tab \tab PUSH\tab BC\tab Save map bit position.
   1 \par 1285\tab \tab EX\tab (SP),HL\tab Now (SP) holds the map bit address;
   1 \par 1283\tab \tab JR\tab NZ,127D,FAILED\tab Continue if the sector is not 'free
   1 \par 1280\tab \tab CALL\tab 12DF,CHECK-MAP\tab Check map bit for this header.
   1 \par 127D\tab FAILED\tab CALL\tab 12C4,GET-M-HD2\tab Fetch the first header.
   1 \par 127D\tab FAILED\tab 128F\tab NO-PRT\tab 12A6\tab CLOSE-M\tab 12A9\tab CLOSE-M2
   1 \par 127B\tab \tab ADD\tab HL,BE
   1 \par 1278\tab \tab LD\tab DE,+0037
   1 \par 1277\tab \tab POP\tab HL\tab preamble.
   1 \par 1275\tab SEND-BLK\tab PUSH\tab IX\tab Make HL point to the data block
   1 \par 1275 SEND-BLK
   1 \par 1274\tab \tab RET\tab \tab that the cartridge is full.
   1 \par 1273\tab \tab XOR\tab A\tab Return with zero flag set to signal
   1 \par 1273\tab \tab INC\tab HL\tab Point to the next byte,
   1 \par 1271\tab \tab DJNZ\tab 126C,NXT-B-MAP\tab Loop for all bytes.
   1 \par 126F\tab \tab RET\tab NZ\tab bits are set.
   1 \par 126D\tab \tab CP\tab +FF\tab Exit with zero flag reset if not all
   1 \par 126C\tab NXT-B-MAP\tab LD\tab A,(HL)\tab Fetch a byte.
   1 \par 1267\tab \tab LD\tab H,(CHMAP-hi)
   1 \par 1264\tab CHK-FULL\tab LD\tab L,(CHMAP-lo)\tab Fetch address of the map.
   1 \par 1264 CHK-FULL
   1 \par 1263\tab \tab RET\tab \tab Finished.
   1 \par 1260\tab \tab INC\tab (CHREC)\tab Finally increment record number.
   1 \par 125D\tab \tab LD\tab (CHBYTE-hi),D
   1 \par 125A\tab \tab LD\tab (CHBYTE-lo),E
   1 \par 1257\tab \tab LD\tab DE,+0000\tab Clear CHBYTE.
   1 \par 1254\tab \tab CALL\tab 1275,SEND-BLK\tab Send the record to Microdrive.
   1 \par 1251\tab \tab LD\tab DE,+0047
   1 \par 1250\tab \tab POP\tab HL
   1 \par 124E\tab \tab PUSH\tab IX\tab Three useless instructions.
   1 \par 124B\tab \tab CALL\tab 1346,CHKS-BUFF\tab Calculate DCHK checksum.
   1 \par 124A\tab \tab ADD\tab HL,DE\tab 512-byte buffer.
   1 \par 1247\tab \tab LD\tab DE,+000F\tab Hake HL point to the start of the
   1 \par 1244\tab \tab CALL\tab 1341,CHKS-HD-R\tab Calculate DESCHK checksum.
   1 \par 1243\tab \tab ADD\tab HL,DE
   1 \par 1240\tab \tab LD\tab DE,+0043
   1 \par 123F\tab \tab POP\tab HL\tab block workspace, i.e. RECFLG.
   1 \par 123D\tab \tab PUSH\tab IX\tab Make HL point to the start of the data
   1 \par 1237\tab \tab LD\tab A,(CHREC)\tab Copy CHREC into RECNUM.
   1 \par 1237\tab \tab CALL\tab 17F7,SEL-DRIVE
   1 \par 1236\tab NOEMP\tab XOR\tab A\tab Switch off motor.
   1 \par 1234\tab \tab LD\tab (RECLEN-hi),A
   1 \par 1231\tab \tab LD\tab A,(CHBYTE-hi)
   1 \par 122E\tab \tab CD\tab (RECLEN-lo),C
   1 \par 122B\tab \tab LD\tab C,(CHBYTE-lo)\tab Copy CHBYTE into RECLEN.
   1 \par 1229\tab \tab POP\tab IX\tab Restore start of channel.
   1 \par 1227\tab \tab DJNZ\tab 121F,CP-NAME
   1 \par 1225\tab \tab INC\tab IX
   1 \par 1222\tab \tab LD\tab (IX+71),A
   1 \par 121F\tab CP-NAME\tab LD\tab A,(IX+14)\tab Copy CHNAME into RECNAM.
   1 \par 121F\tab CP-NAME\tab 1264\tab CHK-FULL\tab 126C\tab NXT-B-MAP\tab 1275\tab SEND-BLK
   1 \par 121D\tab \tab LD\tab B,+0A\tab Counts ten characters.
   1 \par 121B\tab NOFULL\tab PUSH\tab IX\tab Save base address of channel.
   1 \par 121A\tab \tab DEFB\tab +0F
   1 \par 1219\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1216\tab \tab CALL\tab 17F7,SEL_DRIVE
   1 \par 1215\tab \tab XOR\tab A\tab Turn off drive motors.
   1 \par 1212\tab \tab CALL\tab 10C4,DEL-M-BUF\tab Otherwise reclaim the channel.
   1 \par 1210\tab \tab JR\tab NZ,121B,NOFULL\tab and jump if it is not.
   1 \par 120D\tab WRITE-PRC\tab CALL\tab 1264,CHK-FULL\tab Check if the cartridge is full,
   1 \par 120C\tab \tab RET\tab \tab Finished.
   1 \par 1209\tab \tab CALL\tab 17F7,SEL-DRIVE
   1 \par 1208\tab \tab XOR\tab A\tab Turn off the motor.
   1 \par 1205\tab \tab CALL\tab 120D,WRITE-PRC\tab Write the record.
   1 \par 1202\tab \tab CALL\tab 17F7,SEL-DRIVE\tab Turn on the motor.
   1 \par 11\tab NCIRIS\tab Destination station number 0..64.
   1 \par 11\tab CHBYTE\tab Position of the next byte to be received or stored in the
   1 \par 11FF\tab WR-RECD\tab LD\tab A,(CHDRIV)\tab Fetch drive number.
   1 \par 11FF Write record onto Microdrive
   1 \par 11FE\tab \tab RET\tab Z\tab (position 512 has not been reached).
   1 \par 11FC\tab \tab BIT\tab 1,D\tab Return if the buffer is not filled
   1 \par 11F9\tab \tab LD\tab (CHBYTE-hi),D
   1 \par 11F6\tab \tab LD\tab (CHBYTE-lo),E\tab Update byte counter,
   1 \par 11F5\tab \tab INC\tab DE\tab Points to first 'free byte' in the
   1 \par 11F3\tab \tab POP\tab IX\tab Restore start address of channel.
   1 \par 11F0\tab \tab LD\tab (IX+82),A\tab Store a byte in the buffer.
   1 \par 11EE\tab \tab ADD\tab IX,DE\tab Now IX points to 'first free byte
   1 \par 11EC\tab \tab PUSH\tab IX\tab Save start address of channel.
   1 \par 11E9\tab \tab LD\tab D,(CHBYTE-hi)
   1 \par 11E6\tab NOREAD\tab LD\tab E,(CHBYTE-lo)\tab Fetch byte counter.
   1 \par 11E6\tab NOREAD\tab 11FF\tab WR-RECD\tab 120D\tab WRITE-PRC\tab 121B\tab NOFULL
   1 \par 11E5\tab \tab DEFB\tab +0C
   1 \par 11E4\tab \tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 11E2\tab \tab JR \tab NZ,11E6,NOREAD \tab file.
   1 \par 11E1\tab \tab BIT\tab 0,(CHFLAG)\tab Continue only if this is a 'write'
   1 \par 11DC\tab \tab ADD\tab IX,DE\tab (i.e. DE-6, see 00BA).
   1 \par 11D8\tab MCHAN-OUT\tab LD \tab IX,+FFFA \tab Point to the start of the channel
   1 \par 11D8 "M" channel output
   1 \par 11D7\tab \tab RET\tab \tab been detected.
   1 \par 11D6\tab G-REC-ERR\tab SCF\tab \tab Exit with carry set if any error has
   1 \par 11D5\tab \tab RET
   1 \par 11D4\tab \tab OR\tab A\tab when successful.
   1 \par 11D2\tab \tab LD\tab A,+FF\tab Exit with zero and carry flags reset
   1 \par 11D0\tab \tab JR\tab NZ,11D6,G-REC-ERR\tab Exit if they do not match.
   1 \par 11CD\tab \tab CALL\tab 131E,CHK-NAME\tab Compare it against CHNAME.
   1 \par 11CA\tab \tab LD\tab BC,+000A\tab Name is ten characters in length.
   1 \par 11C9\tab \tab ADD\tab HL,DE
   1 \par 11C6\tab \tab LD\tab DE,+0047\tab Points to RECNAM.
   1 \par 11C5\tab \tab POP\tab HL\tab channel.
   1 \par 11C3\tab \tab PUSH\tab IX\tab Make HL point to the start of the
   1 \par 11C2\tab \tab RET\tab Z\tab Return with unused sectors.
   1 \par 11C0\tab \tab AND\tab +02\tab Take only bit 1.
   1 \par 11BD\tab \tab OR\tab (RECLEN-hi)\tab are both reset with 'unused sector'.
   1 \par 11BA\tab \tab LD\tab A,(RECFLG)\tab Bit 1 of RECFLG and of REGLEN-hi
   1 \par 11B8\tab \tab JR\tab NZ,11D6,G-REC-ERR\tab Exit if a header instead of a data
   1 \par 11B4\tab \tab BIT\tab 0,(RECFLG)\tab This is set to signal a header block.
   1 \par 11B2\tab \tab JR\tab NZ,11D6,G-REC-ERR\tab Exit if the checksum is wrong.
   1 \par 11AF\tab \tab CALL\tab 1341,CHKS-HD-R\tab Calculate record checksum.
   1 \par 11AC\tab \tab CALL\tab 18A9,GET-M-BF\tab \tab Fetch the record.
   1 \par 11AB\tab \tab ADD\tab HL,DE\tab start of record area.
   1 \par 11A8\tab \tab LD\tab DE,+001B\tab Make HL point to RECLCG, i.e.,
   1 \par 11A5\tab G-HD-RC\tab CALL\tab 12C4,GET-M-HD2\tab \tab Fetch the header.
   1 \par 11A5 Get header and data block
   1 \par 11A4\tab \tab DEFB\tab +11
   1 \par 11A3\tab RS-SH2\tab RST\tab 20,SH-ERE\tab Call the error handling routine.
   1 \par 11A3\tab RS-SH2\tab 11A5\tab G-HD-RC\tab 11D6\tab G-REC-ERR\tab 11D8\tab MCHAN-OUT
   1 \par 11A1\tab \tab JR\tab NZ,1184,GET-R-LP\tab Continue until five passes of the
   1 \par 119E\tab NXT-SCT\tab CALL\tab 1312,DEC-SECT\tab Decrease SECTOR.
   1 \par 119D\tab \tab RET\tab Z
   1 \par 119A\tab \tab CALL\tab 1346,CHKS-BUFF\tab Return if the checksum is correct.
   1 \par 1199\tab \tab ADD\tab HL,DE
   1 \par 1196\tab \tab LD\tab DE,+0052\tab Points to the start of the buffer.
   1 \par 1195\tab \tab POP\tab HL
   1 \par 1193\tab \tab PUSH\tab IX\tab Fetch base of "m" channel into HL.
   1 \par 1191\tab \tab JR\tab NZ,119E,NXT-SCT\tab Next sector also if this record is
   1 \par 118E\tab \tab CP\tab (CHREC)\tab Test against CHREC.
   1 \par 118B\tab \tab CD\tab A,(RECNUM)\tab Fetch record number.
   1 \par 1189\tab \tab JR\tab Z,119E,NXT-SCT\tab if it is unused.
   1 \par 1187\tab \tab JR\tab C,119E,NXT-SCT\tab Consider next sector with errors, or
   1 \par 1184\tab GET-R-LP\tab CALL\tab 11A5,G-HD-RC\tab \tab Get header and data block.
   1 \par 1180\tab \tab LD\tab (SECTOR),BC\tab least five passes of the tape).
   1 \par 117D\tab GET-R-2\tab LD\tab BC,+04FB\tab Initialise SECTOR to 1275 (i.e., at
   1 \par 117A\tab \tab CALL\tab 17F7,SEL-DRIVE\tab \tab Start drive motor.
   1 \par 1177\tab GET-RECD\tab LD\tab A,(CHDRIV)\tab Fetch drive number.
   1 \par 1177\tab GET-RECD\tab 117D\tab GET-R-2\tab 1184\tab GET-R-LP\tab 119E\tab NXT-SCT
   1 \par 1177 Get a record
   1 \par 1175\tab \tab JR\tab 1134,TEST-M-BF\tab Now read the byte.
   1 \par 1172\tab \tab CALL\tab 17F7,SEL-DRIVE
   1 \par 1171\tab \tab XOR\tab A\tab Turn off drive motor.
   1 \par 116E\tab \tab CALL\tab 1177,GET-RECD\tab \tab Fetch a new data block.
   1 \par 116B\tab \tab INC\tab (CHREC)\tab Increment record number.
   1 \par 1168\tab \tab LD\tab (CHBYTE-hi),D
   1 \par 1165\tab \tab LD\tab (CHBYTE-lo),E
   1 \par 1162\tab NEW-BUFF\tab LD\tab DE,+0000\tab The byte counter is cleared.
   1 \par 1161\tab \tab RET\tab \tab Finished.
   1 \par 115F\tab \tab ADD\tab A,+0D\tab Returned byte is +0D.
   1 \par 115E\tab \tab XOR\tab A\tab Otherwise zero and carry flags are
   1 \par 115C\tab \tab JR \tab Z,1162,NEW-BUFF \tab Jump if not the last block.
   1 \par 1158\tab CHK-M-EOF\tab BIT\tab 1,(RECFLG)\tab This is set to signal 'EOF'.
   1 \par 1157\tab \tab RET\tab \tab Finished.
   1 \par 1156\tab \tab SCF\tab \tab Signal 'acceptable code'.
   1 \par 1154\tab \tab POP\tab IX\tab Restore start of channel.
   1 \par 1151\tab \tab LD\tab A,(IX+82)\tab Fetch the byte.
   1 \par 114F\tab \tab Abb\tab IX,DE\tab IX now points to 'byte to be
   1 \par 114D\tab \tab PUSH\tab IX\tab Save start address of channel.
   1 \par 114C\tab \tab DEC\tab DE\tab Position of character to be read.
   1 \par 1149\tab \tab LD\tab (CHBYTE-hi),D
   1 \par 1146\tab \tab LD\tab (CHBYTE-lo),E\tab Store pew byte Counter.
   1 \par 1145\tab \tab INC\tab DE\tab Include byte to be read in the
   1 \par 1143\tab \tab JR\tab C,1158,CHK-M-EOF
   1 \par 1141\tab \tab SEC\tab HL,DE\tab Jump if all bytes have been read.
   1 \par 1140\tab \tab SCF\tab \tab Include byte to be read.
   1 \par 113D\tab \tab LD\tab H,(RECLEN-hi)
   1 \par 113A\tab \tab LD\tab L,(RECLEN-lo)\tab Fetch record length.
   1 \par 1137\tab \tab LD\tab D,(CHBYTE-hi)
   1 \par 1134\tab TEST-M-BF\tab LD\tab E,(CHBYTE-lo)\tab Fetch current byte counter.
   1 \par 1133\tab \tab DEFB\tab +0D
   1 \par 1132\tab RWF-ERR\tab RST\tab 20,SH-ERR\tab Call the error handling routine.
   1 \par 1132\tab RWF-ERR\tab 1134\tab TEST-M-BF\tab 1158\tab CHK-M-EOF\tab 1162\tab NEW-BUFF
   1 \par 1130\tab \tab JR\tab Z,1134,TEST-M-BF\tab Jump with 'read' file.
   1 \par 112C MCHAN-IN\tab BIT\tab 0,(CHFLAG)\tab This is reset to indicate a 'read'
   1 \par 112C "M" channel input service routine
   1 \par 1129\tab \tab JP\tab 0CBD,CALL-INP\tab Jump to the control routine.
   1 \par 1126\tab \tab LD\tab HL,+112C\tab Address of MCHAN-IN routine.
   1 \par 1122 "M" channel input
   1 \par 1121\tab \tab RET\tab \tab Finished.
   1 \par 111E\tab \tab CALL\tab 1391,REST-MAP\tab Update addresses of other maps.
   1 \par 111D\tab \tab POP\tab HL\tab deleted map.
   1 \par 111C\tab \tab POP\tab BC\tab Restore length and start of the
   1 \par 111A\tab \tab DEFW\tab +19E8
   1 \par 1119\tab \tab RST\tab 10,CALBAS\tab Call RECLAIM-2 to delete the map.
   1 \par 1118\tab \tab PUSH\tab BC\tab Save length of map. Note: this is
   1 \par 1117\tab \tab PUSH\tab HL\tab Save start of map.
   1 \par 1114\tab RCLM-HAP\tab LD\tab BC,+0020\tab Length of the map.
   1 \par 1112\tab \tab JR\tab 10F5,TEST-MCHL\tab Back again for next channel.
   1 \par 1110\tab \tab ADD\tab IX,DE\tab Points to next channel.
   1 \par 110D\tab \tab LD\tab B,(IX+10)
   1 \par 110A\tab NXTCHAN\tab LD\tab E,(IX+9)\tab Fetch length of this channel.
   1 \par 110A\tab NXTCHAN\tab 1114\tab RCLM-MAP\tab 1122\tab M-INPUT\tab 112C\tab MCHAN-IN
   1 \par 1109\tab \tab RET\tab Z\tab deleted channel, the map is not to
   1 \par 1108\tab \tab CP\tab B\tab If it is the same as that of the
   1 \par 1105\tab \tab LD\tab A,(CHDRIV)\tab Fetch drive number of this channel.
   1 \par 1103\tab \tab JR\tab NZ,113A,NXTCHAN
   1 \par 1101\tab \tab CP\tab +4D\tab Jump if this is not an "m" channel.
   1 \par 10FF\tab \tab AND\tab +7F\tab Clear bit 7 (no distinction is made
   1 \par 10FC\tab \tab LD\tab A,(IX+4)\tab Fetch channel specifier.
   1 \par 10FA\tab \tab JR\tab Z,1114,RCLM-MAP
   1 \par 10F8\tab \tab CP\tab +80
   1 \par 10F5\tab TEST-MCHL\tab LD\tab A,(IX+0)\tab Jump if the channel area is finished.
   1 \par 10F3\tab \tab ADD\tab IX,DE
   1 \par 10F0\tab \tab LD\tab DE,+0014\tab Skip initial 'standard' channels.
   1 \par 10EC\tab \tab LD\tab IX,(CHANS)\tab Start of channel area.
   1 \par 10EB\tab \tab LD\tab B,A\tab Drive number goes into B.
   1 \par 10EA\tab \tab POP\tab HL\tab address of map.
   1 \par 10E9\tab \tab POP\tab AF\tab Restore drive number, and start
   1 \par 10E6\tab \tab CALL\tab l35F,REST-STRM\tab Close required streams and update
   1 \par 10E2\tab \tab INC\tab HL
   1 \par 10E0\tab \tab SBC\tab HL,DE\tab possibly attached to a stream.
   1 \par 10DF\tab \tab OR\tab A\tab area for the deleted channel,
   1 \par 10DB\tab \tab LD\tab DE,(CHANS)\tab Calculate 'offset' used into STRMS
   1 \par 10DA\tab \tab POP\tab HL\tab the (reclaimed) channel.
   1 \par 10D8\tab \tab PUSH\tab IX\tab Make HL point again to the start of
   1 \par 10D6\tab \tab DEFW\tab +19E8\tab the channel area.
   1 \par 10D5\tab \tab RST\tab 10,CALBAS\tab RECLAIM-2 is called to delete
   1 \par 10D2\tab \tab LD\tab BC,+0253\tab Length of the channel.
   1 \par 10D1\tab \tab POP\tab HL\tab the channel.
   1 \par 10CE\tab \tab PUSH\tab AF\tab Save it for later.
   1 \par 10CD\tab \tab PUSH\tab IX\tab Make HL point to the start of
   1 \par 10CB\tab \tab LD\tab A,(CHDRIV)\tab Fetch drive number.
   1 \par 10CA\tab \tab PUSH\tab HL\tab Save it for later.
   1 \par 10C7\tab \tab LD\tab H,(CHMAP-hi)
   1 \par 10C4\tab DEL-M-BUF\tab LD\tab L,(CHMAP-lo)\tab Fetch address of map into HL.
   1 \par 10C4 Reclaim "m" channel
   1 \par 10C3\tab \tab RET\tab \tab Finished.
   1 \par 10C2\tab \tab INC\tab HL
   1 \par 10C0\tab \tab SBC\tab HL,DE
   1 \par 10BF\tab \tab OR\tab A\tab offset' into HL.
   1 \par 10BB\tab \tab LD\tab DE,(CHANS)\tab Calculate the required 'stream
   1 \par 10BA\tab \tab POP\tab HL\tab register pair.
   1 \par 10B8\tab \tab PUSH\tab IX\tab Move 'start' of channel into HL
   1 \par 10B6\tab \tab LDIR\tab \tab Set-up the data block preamble.
   1 \par 10B3\tab \tab LD\tab HL,+13E5\tab Start of 'preamble data'.
   1 \par 10B2\tab \tab EX\tab DE,HL\tab data block preamble.
   1 \par 10B1\tab \tab ADD\tab HL,DE\tab Make DE register pair point to the
   1 \par 10AE\tab \tab LD\tab BC,+000C\tab Preamble is again 12 bytes.
   1 \par 10AB\tab \tab LD\tab DE,+0037\tab Offset for data block preamble.
   1 \par 10AA\tab \tab POP\tab HL
   1 \par 10A8\tab \tab PUSH\tab IX\tab Pass again 'start' to HL.
   1 \par 10A6\tab \tab LDIR\tab \tab Set-up header preamble.
   1 \par 10A0\tab \tab LD\tab HL,+13E5\tab Start of 'preamble' data.
   1 \par 109F\tab \tab EX\tab DE,HL
   1 \par 109E\tab \tab ADD\tab HL,DE\tab header block preamble area.
   1 \par 109B\tab \tab LD\tab DE,+001C\tab Make DE register pair point to the
   1 \par 109A\tab \tab POP\tab HL
   1 \par 1098\tab \tab PUSH\tab IX\tab \tab Pass start of channel to HL.
   1 \par 1096\tab \tab DJNZ\tab 1094,FILL-MAP\tab \tab Continue for 32 bytes.
   1 \par 1095\tab \tab INC\tab HL\tab Advance the pointer.
   1 \par 1092\tab \tab LD\tab B,+20\tab Length of map.
   1 \par 1090\tab \tab LD\tab A,+FF\tab All bits high.
   1 \par 108E\tab \tab LD\tab (CHMAP-hi),H\tab of the Microdrive map.
   1 \par 108A\tab ST-MAP-AD\tab LD\tab (CHMAP-lo),L\tab Lastly store the start address
   1 \par 108A\tab ST-MAP-AD\tab 1094\tab FILL-MAP\tab 10C4\tab DEL-M-BUF\tab 10F5\tab TEST-MCHL
   1 \par 1087\tab \tab CALL\tab 1691,REST-N-AD\tab Restore 'start' of filename.
   1 \par 1085\tab \tab ADD\tab IX,BC
   1 \par 1082\tab \tab LD\tab BC,+0020\tab Restore 'start' of channel.
   1 \par 1081\tab \tab POP\tab HL\tab Restore start of map.
   1 \par 107F\tab \tab DEFW\tab +1655
   1 \par 107E\tab \tab RST\tab 10,CALBAS\tab Call MAKE-ROOM to make the space.
   1 \par 107B\tab \tab LD\tab BC,+0020\tab Length of the map is 32 bytes.
   1 \par 107A\tab \tab DEC\tab HL
   1 \par 1079\tab \tab PUSH\tab HL
   1 \par 1076\tab \tab LD\tab HL,(CHANS)\tab Otherwise the map is to be created.
   1 \par 1074\tab \tab JR\tab NZ,108A,ST-MAP-AD\tab Jump if the map already exists.
   1 \par 1073\tab \tab OR\tab L\tab does not exist.
   1 \par 1072\tab \tab LD\tab A,H\tab Address of map, or +0000 if the map
   1 \par 1071\tab \tab EXX\tab \tab Use alternate registers.
   1 \par 106F\tab TEST-MAP\tab POP\tab IX\tab Restore start address of channel.
   1 \par 106D\tab \tab JR\tab 106l,T-CH-NAME\tab Continue with next character.
   1 \par 106C\tab \tab DEC\tab BC\tab Decrease 'length'.
   1 \par 1069\tab \tab INC\tab HL\tab Point to next locations.
   1 \par 1066\tab \tab LD\tab (IX+14),A\tab Store it into CHNAME.
   1 \par 1065\tab \tab LD\tab A,(HL)
   1 \par 1063\tab \tab JR\tab Z,106F,TEST-MAP\tab Fetch character of name.
   1 \par 1062\tab \tab OR\tab C\tab reaches zero.
   1 \par 1061\tab T-CH-NAME\tab LD\tab A,B\tab The loop continues until 'length'
   1 \par 105F\tab \tab JR\tab NZ,106F,TEST-MAP\tab (N-STR1 = +FFFF).
   1 \par 105D\tab \tab BIT\tab 7,B\tab Jump if the name does not exist
   1 \par 1059\tab \tab LD\tab BC,(N-STR1)\tab Fetch length of filename.
   1 \par 1058\tab \tab EX\tab DE,HL\tab The start address of the filename goes
   1 \par 1055\tab \tab CALL 1691,REST-N-AD\tab Restore start of 'filename' possibly
   1 \par 1054\tab \tab POP\tab HL
   1 \par 1052\tab \tab PUSH\tab IX\tab Fetch start of channel into HL.
   1 \par 104F\tab \tab LD\tab BC,+0253\tab Length of channel.
   1 \par 104C\tab \tab LD\tab (CHDRIV),A\tab Initialise CHDRIV.
   1 \par 1049\tab \tab LD\tab A,(D-STR1)\tab Fetch drive number.
   1 \par 1047\tab \tab LDIR\tab \tab Store data into the channel.
   1 \par 1044\tab \tab LD\tab BC,+0019\tab Length of data.
   1 \par 1041\tab \tab LD\tab HL,+13CC\tab Start of "M" channel data.
   1 \par 1040\tab \tab PUSH\tab DE
   1 \par 103E\tab \tab POP\tab DE\tab Restore start address of the channel.
   1 \par 103D\tab \tab DEFW\tab +1655\tab space.
   1 \par 103C\tab \tab RST\tab 10,CALBAS\tab Call MAKE-ROOM to create the required
   1 \par 1039\tab \tab LD\tab BC,+0253\tab Length is '595' bytes.
   1 \par 1038\tab \tab PUSH\tab HL\tab Save it.
   1 \par 1037\tab \tab DEC\tab HL\tab channel,
   1 \par 1034\tab CHAN-SPC\tab LD\tab HL,(PROG)\tab Fetch the start address of the
   1 \par 1032\tab \tab JR\tab 0FF6,CHK-LOOP\tab Back again.
   1 \par 1030\tab \tab ADD\tab IX,DE\tab Point to the next channel.
   1 \par 102D\tab \tab LD \tab D,(lX+10) \tab register pair.
   1 \par 102A\tab NEXT-CHAN\tab LD \tab E,(IX+9)\tab Fetch length of channel into the DE
   1 \par 102A\tab NEXT-CHAN\tab 1034\tab CHAN-SPC\tab 1061\tab T-CH-NAME\tab 106F\tab TEST-MAP
   1 \par 1029\tab \tab DEFB\tab +0D\tab error if the file is already opened
   1 \par 1028\tab \tab RST\tab 20,SH-ERR\tab Give the 'Reading a 'write' file'
   1 \par 1026\tab \tab JR\tab Z,102A,NEXT-CHAN\tab Continue with 'read' files.
   1 \par 1022\tab \tab BIT\tab 3,(IX+24)\tab This is set with 'write' files.
   1 \par 1020\tab \tab JR\tab NZ,102A,NEXT-CHAN\tab Jump if not the same file.
   1 \par 101D\tab \tab CALL\tab 131E,CHK-NAME\tab Check name against 'CHNAME' of this
   1 \par 101A\tab \tab LD\tab HL.(N-STR1+2)\tab Start address of filename.
   1 \par 1016\tab \tab LD\tab BC,(N-STR1)\tab Length of filename.
   1 \par 1015\tab \tab LXX\tab \tab Swap registers again.
   1 \par 1012\tab \tab LD\tab H,(CHMAP-hi)
   1 \par 100F\tab \tab LD\tab L,(CHMAP-lo)\tab Move address of map area into H'L'
   1 \par 100E\tab \tab EXX\tab \tab Swap registers.
   1 \par 1009\tab \tab CP\tab (CHDRIV)\tab Jump if this channel uses a different
   1 \par 1006\tab \tab LD\tab A,(D-STR1)\tab Fetch drive number.
   1 \par 1004\tab \tab JR\tab NZ,102A,NEXT-CHAN
   1 \par 1002\tab \tab CP\tab +4D\tab Jump if this is not an "m" channel.
   1 \par 1000\tab \tab AND\tab +7F\tab Clear bit 7.
   1 \par 1. MICRODRIVE CHANNEL
   1 \par 0\tab +0008\tab Main ROM 'output' routine.
   1 \par 0Fl7\tab \tab IN\tab A,(+F7)\tab Check network state.
   1 \par 0FFD\tab \tab LD\tab A,(IX+4)\tab Fetch channel specifier.
   1 \par 0FFB\tab \tab JR\tab Z,1034,CHAN-SPC
   1 \par 0FF9\tab \tab CP\tab +80\tab finished.
   1 \par 0FF6\tab CHK-LOOP\tab LD\tab A,(IX+0)\tab Jump forward it the CHANS area is
   1 \par 0FF4\tab \tab ADD\tab IX,DE\tab Other than the 'standard' ones.
   1 \par 0FF1\tab \tab LD\tab DE,+0014\tab Points to the start of the channels
   1 \par 0FED\tab \tab LD\tab IX,(CHANS)\tab Start of channel area.
   1 \par 0FEC\tab \tab EXX\tab \tab Swap registers again.
   1 \par 0FE9\tab \tab LD\tab HL,+0000\tab Signal 'map to be created'.
   1 \par 0FE8\tab SET-T-MCH\tab EXX\tab \tab \tab Swap registers.
   1 \par 0FE8 Set a temporary "m" channel
   1 \par 0FE7\tab \tab RET\tab \tab Finished.
   1 \par 0FE5\tab \tab OUT\tab (+F7),A\tab Finally make the network inactive.
   1 \par 0FE3\tab \tab LD\tab A,+01
   1 \par 0FE0\tab \tab JP\tab NZ,0FCC,OUTPAK-L\tab Loop until all bytes have been sent.
   1 \par 0FDF\tab \tab POP\tab HL
   1 \par 0FDE\tab \tab PUSH\tab HL\tab Wait 22 T cycles.
   1 \par 0FDD\tab \tab DEC\tab E\tab Decrease 'block length'.
   1 \par 0FDC\tab \tab INC\tab HL\tab Point to next location in the block.
   1 \par 0FD9\tab \tab JP\tab NZ,0FB2,UNT-MARK\tab Loop for all bits.
   1 \par 0FD7\tab \tab LD\tab D,+00\tab Wait 7 T cycles.
   1 \par 0FD6\tab \tab DEC\tab B\tab becrease bit counter.
   1 \par 0FD5\tab \tab AND\tab A\tab But clear carry.
   1 \par 0FD4\tab \tab RRA\tab \tab Next bit.
   1 \par 0FD2\tab UNT-MARK\tab OUT\tab (+F7),A\tab Send the bit.
   1 \par 0FD0\tab \tab LD\tab B,+0A\tab '10' bits to be sent (start, data,
   1 \par 0FCF\tab \tab RLA\tab \tab Rotate bit into A.
   1 \par 0FCE\tab \tab SCF\tab \tab The start bit is high.
   1 \par 0FCD\tab \tab CPL\tab \tab Send the bits inverted.
   1 \par 0FCC\tab OUTPAK-L\tab LD\tab A,(HL)\tab Get the byte to be sent,
   1 \par 0FCC\tab OUTPAK-L\tab 0FD2\tab UNT-MARK\tab 0FE8\tab SET-T-MCH\tab 0FF6\tab CHK-LOOP
   1 \par 0FCA\tab DEL_O-1\tab DJNZ\tab 0FCA,DEL_O-1
   1 \par 0FC8\tab \tab LD\tab B,+04\tab Insert the required delay.
   1 \par 0FC6\tab \tab OUT\tab (+F7),A
   1 \par 0FC5\tab OUTPAK\tab XOR\tab A\tab Begin with a 'start' leader.
   1 \par 0FC5 OUTPAK
   1 \par 0FC4\tab \tab LD\tab E,A\tab A 'single byte' is to be sent.
   1 \par 0FC3\tab \tab LD\tab (HL),A
   1 \par 0FC0\tab \tab LD\tab HL,+5CCD\tab Store it into NTRESP.
   1 \par 0FBE\tab SEND-RESP\tab LD\tab A,+0l\tab This is the response byte.
   1 \par 0FBE Send response byte
   1 \par 0FBD\tab \tab RET\tab \tab 'successfully read'.
   1 \par 0FBC\tab \tab CP\tab A\tab Return with zero flag set to signal
   1 \par 0FBA\tab \tab DJNZ\tab 0F9E,INPAK-L\tab Get next byte.
   1 \par 0FB9\tab \tab INC\tab HL\tab Point to next location.
   1 \par 0FB8\tab \tab LD\tab (HL),E\tab Store the received byte.
   1 \par 0FB5\tab \tab JP\tab NC,0FAE,UNTIL-MK\tab Repeat for 8 bits.
   1 \par 0FB3\tab \tab RR\tab E\tab Shift the bit into E.
   1 \par 0FB2\tab \tab RRA\tab \tab flag.
   1 \par 0FB0\tab \tab IN\tab A,(+F7)\tab Get a bit into carry
   1 \par 0FAI\tab \tab LD\tab A,+CE\tab Make Wait and CTS having a low level,
   1 \par 0FAE\tab UNTIL-MK\tab LD\tab A,+00\tab Wait 7 T cycles.
   1 \par 0FAE\tab UNTIL-MK\tab 0FBE\tab SEND-RESP\tab 0FC5\tab OUTPAK\tab 0FCA\tab DEL-D-1
   1 \par 0FAC\tab \tab DEC\tab IX
   1 \par 0FAA\tab \tab INC\tab IX
   1 \par 0FA8\tab \tab DEC\tab IX
   1 \par 0FA6\tab \tab INC\tab IX\tab                                                        
   1 \par 0FA5\tab \tab NOP\tab \tab byte.
   1 \par 0FA4\tab \tab NOP\tab \tab Wait 48 T cycles at the start of each
   1 \par 0FA2\tab \tab OUT\tab (+EF),A\tab enable network comm.
   1 \par 0F9E\tab INPAK-L\tab LD\tab E,+80\tab Set a marker into bit 7.
   1 \par 0F9D\tab INPAK-2\tab LD\tab B,E\tab B holds the length of the block.
   1 \par 0F9C\tab \tab RET\tab \tab indicate 'network inactive'.
   1 \par 0F9B\tab \tab INC\tab B\tab Return with zero flag reset to
   1 \par 0F99\tab \tab BJNZ\tab 0F94,N-ACTIVE\tab Otherwise try again.
   1 \par 0F97\tab \tab JR\tab C,0F9D,INPAK-2\tab Jump if found active.
   1 \par 0F96\tab \tab RRA\tab \tab Only bit 3.
   1 \par 0F94\tab N-ACTIVE\tab IN\tab A,(+F7)\tab Read the network.
   1 \par 0F92\tab INPAK\tab LD\tab B,+FF\tab Set a counter.
   1 \par 0F92\tab INPAK\tab 0F94\tab N-ACTIVE\tab 0F9D\tab INPAK-2\tab 0F9E\tab INPAK-L
   1 \par 0F92 INPAK
   1 \par 0F91\tab \tab RET\tab \tab Finished.
   1 \par 0F8F\tab END-S-DEL\tab DJNZ\tab 0F8F,END-S-DEL
   1 \par 0F8D\tab \tab LD\tab B,+0E\tab Wait 184 T cycles.
   1 \par 0F8B\tab \tab OUT\tab (+F7),A
   1 \par 0F89\tab \tab LD\tab A,+01\tab Make network inactive.
   1 \par 0F87\tab \tab JR\tab NZ,0F72,ALL-BITS\tab Send all bits.
   1 \par 0F86\tab \tab DEC\tab L\tab Decrease bit counter.
   1 \par 0F84\tab \tab JR\tab Z,0F61,SEND-SC\tab network does not have the right state
   1 \par 0F83\tab \tab CP\tab D\tab Repeat again the procedure if the
   1 \par 0F81\tab \tab AND\tab +01\tab Only bit 0.
   1 \par 0F7F\tab \tab IN\tab A,(+F7)\tab Read the network.
   1 \par 0F7D\tab S-SC-DEL\tab DJNZ\tab 0F7D,S-SC-DEL
   1 \par 0F7B\tab \tab LD\tab B,+08\tab Wait 196 T cycles.
   1 \par 0F79\tab \tab RL\tab H\tab Bit 7 of station no. goes into bit
   1 \par 0F77\tab \tab RLC\tab E\tab Rotate 'station no.' left.
   1 \par 0F75\tab \tab LD\tab H,+00\tab Clear H.
   1 \par 0F74\tab \tab LD\tab D,H\tab Save the bit into D.
   1 \par 0F72\tab ALL-BITS\tab OUT\tab (C),H\tab Send a bit.
   1 \par 0F70\tab \tab JR\tab C,0F61,SEND-SC
   1 \par 0F6F\tab \tab RRCA\tab \tab into the network line.
   1 \par 0F6D\tab \tab IN\tab A,(+F7)\tab Start again if some data is found
   1 \par 0F6C\tab \tab LD\tab E,A\tab Pass it to the E register.
   1 \par 0F69\tab \tab LD\tab A,(NTSTAT)\tab Fetch global station number,
   1 \par 0F66\tab \tab LD\tab HL,+0009\tab H=0 (leader bit value)
   1 \par 0F64\tab \tab LD\tab C,+F7\tab Output port.
   1 \par 0F61\tab SEND-SC\tab CALL\tab 0F03,NET-STATE\tab \tab Wait until the network Is resting.
   1 \par 0F61\tab SEND-SC\tab 0F72\tab ALL-BITS\tab 0F7D\tab S-SC-DEL\tab 0F8F\tab END-S-DEL
   1 \par 0F61 Send-scout
   1 \par 0F5F\tab \tab JR\tab 0F58,LP-SCOUT\tab Go back into the loop,
   1 \par 0F5D\tab DELAY-SC\tab DJNZ\tab 0F5D,DELAY-SC
   1 \par 0F5B\tab \tab LD\tab B,+0E\tab Wait a while.
   1 \par 0F5A\tab \tab RET\tab Z\tab 'scout identified') when the counter
   1 \par 0F59\tab \tab SCF\tab \tab Return with carry set (to signal
   1 \par 0F58\tab LP-SCOUT\tab DEC\tab L\tab Decrease it.
   1 \par 0F56\tab SCOUT-END\tab LD\tab L,+09\tab Set a counter.
   1 \par 0F55\tab \tab RST\tab 28,ROMERR
   1 \par 0F51\tab \tab LD\tab (ERR-NR),+14\tab Give the error 'BREAK into program'.
   1 \par 0F4E\tab \tab CALL 0CA9,BORD-REST\tab Restore border colour.
   1 \par 0F4D\tab E-READ-N\tab EI\tab \tab Enable interrupts.
   1 \par 0F4D\tab E-READ-N\tab 0F56\tab SCOUT-END\tab 0F58\tab LP-SCOUT\tab 0F5D\tab DELAY-SC
   1 \par 0F4C\tab \tab RET\tab \tab Carry reset signals 'time-out',
   1 \par 0F4A\tab \tab JR\tab Z,0F35,WT-SYNC
   1 \par 0F49\tab \tab AND\tab A\tab broadcasting.
   1 \par 0F46\tab \tab CD\tab A,(NCIRIS)\tab There is no 'time-out' when
   1 \par 0F44\tab \tab JR\tab NZ,0F35,WT-SYNC
   1 \par 0F43\tab \tab OR\tab C
   1 \par 0F42\tab \tab LD\tab A,H\tab Repeat until it reaches zero.
   1 \par 0F41\tab \tab DEC\tab HL\tab decrease counter.
   1 \par 0F3F\tab \tab JR\tab NC,0F4O,E-READ-N\tab Give an error if it is pressed.
   1 \par 0F3E\tab \tab RRCA
   1 \par 0F3C\tab \tab IN\tab A,(+FE)
   1 \par 0F3A\tab \tab CD\tab A,+7F\tab Check SPACE key.
   1 \par 0F38\tab \tab JR\tab C,0F56,SCOUT-END\tab Jump if the SCOUT is identified.
   1 \par 0F37\tab \tab RRCA\tab \tab Only bit 0.
   1 \par 0F35\tab WT-SYNC\tab IN A,(+F7) \tab Read the network line.
   1 \par 0F34\tab \tab RET\tab \tab Return with carry reset to signal
   1 \par 0F32\tab \tab JR\tab Z,0F21,CLAIMED
   1 \par 0F31\tab \tab AND\tab A\tab broadcasting.
   1 \par 0F2E\tab \tab LD\tab A,(NCIRIS)\tab There is no 'time-out' when
   1 \par 0F2C\tab \tab JR\tab NZ,0F21,CLAIMED
   1 \par 0F2B\tab \tab OR\tab C
   1 \par 0F2A\tab \tab LD\tab A,H
   1 \par 0F29\tab \tab DEC\tab HL\tab until the counter reaches zero.
   1 \par 0F28\tab \tab DEC\tab HL\tab Loop again if the network is active,
   1 \par 0F26\tab \tab JR\tab NC,0F35,WT-SYNC\tab Jump for waiting the SCOUT.
   1 \par 0F23\tab \tab CALL\tab 0F9E,CHK-REST\tab Check network state.
   1 \par 0F21\tab CLAIMED\tab LD\tab B,+80\tab This constant allows the network to
   1 \par 0F1E\tab WT-SCOUT\tab LD\tab HL,+01C2\tab Set a counter.
   1 \par 0F1E Wait-scout
   1 \par 0F1D\tab \tab RET\tab \tab Return with carry reset when network
   1 \par 0F1B\tab \tab DJNZ 0F15,MAKESURE\tab Repeat the test.
   1 \par 0F1A\tab \tab RET\tab C\tab Return if the network is already
   1 \par 0F19\tab \tab RRCA\tab \tab Only bit 0.
   1 \par 0F16\tab \tab POP\tab BC
   1 \par 0F15\tab MAKESURE\tab PUSH\tab BC\tab Wait 21 T cycles.
   1 \par 0F15\tab MAKESURE\tab 0F1E\tab WT-SCOUT\tab 0F21\tab CLAIMED\tab 0F35\tab WT-SYNC
   1 \par 0F13\tab \tab JR NC,0F4D,E-READ-N\tab Give an error if it is pressed.
   1 \par 0F12\tab \tab RRCA
   1 \par 0F10\tab \tab IN\tab A,(+FE)
   1 \par 0F0E\tab CHK-REST\tab LD\tab A,+7F\tab First check SPACE key.
   1 \par 0F0E Check-resting
   1 \par 0F0D\tab \tab RET\tab \tab Return when 'ready to claim'.
   1 \par 0F0B\tab \tab JR\tab C,0F03,NET-STATE\tab Repeat until the network is resting,
   1 \par 0F08\tab \tab CALL\tab 0F8E,CHK-REST\tab Check network state.
   1 \par 0F07\tab \tab LD\tab B,A\tab Pass the value to B.
   1 \par 0F05\tab \tab CP\tab +C0\tab Allow only the range 192..255.
   1 \par 0F03\tab NET-STATE\tab LD\tab A,R\tab Get a random value.
   1 \par 0F03 Network state
   1 \par 0F00\tab \tab JP\tab 0DAB,S-PACK-1\tab Send packet and exit.
   1 \par 0EbF\tab \tab AND\tab A\tab Jump if the data block is empty.
   1 \par 0EFE\tab \tab LD\tab A,+01\tab Signal 'EOF' packet.
   1 \par 0EFD\tab \tab RET\tab Z\tab (NCOBL=0).
   1 \par 0EFC\tab \tab AND\tab A\tab Return if this is a 'read' channel
   1 \par 0EF9\tab \tab LD\tab A,(NCOBL)\tab Fetch data block length.
   1 \par 0EF5\tab SEND-NEOF\tab LD\tab IX,(CURCHL)\tab Fetch start address of channel.
   1 \par 0EF5 Send EOF block to network
   1 \par 0EF3\tab \tab DEFW\tab +0114\tab Length of "n" channel.
   1 \par 0EF1\tab \tab DEFW\tab +0D0C\tab Shadow ROM 'input' routine.
   1 \par 0EEF\tab \tab DEFW\tab +0D6C\tab Shadow ROM 'output' routine.
   1 \par 0EEE\tab \tab DEFB\tab +43\tab "N" (channel specifier)
   1 \par 0EEC\tab \tab DEFW\tab +0008\tab Main ROM 'input' routine.
   1 \par 0EEA\tab \tab DEFW\tab +0008\tab Main ROM 'output' routine.
   1 \par 0EEA "N" channel data
   1 \par 0EE9\tab \tab RET\tab \tab Finished.
   1 \par 0EE5\tab \tab LD\tab DE,(CURCHL)\tab Fetch start address of the channel.
   1 \par 0EE3\tab \tab LDIR
   1 \par 0EE0\tab \tab LD\tab BC,+0106
   1 \par 0EDF\tab \tab INC\tab DE
   1 \par 0EDE\tab \tab LD\tab L,E
   1 \par 0EDD\tab \tab LD\tab H,D\tab Fill the remaining bytes with zeros.
   1 \par 0EDC\tab \tab LD\tab (DE),A
   1 \par 0EDB\tab \tab XOR\tab A \tab Clear it.
   1 \par 0EDA\tab \tab INC\tab DE\tab Points to NCNUMB.
   1 \par 0ED9\tab \tab LD\tab (DE),A\tab Copy it into NCSELF.
   1 \par 0ED6\tab \tab LD\tab A,(NTSTAT)\tab Fetch own station number.
   1 \par 0ED5\tab \tab INC\tab DE\tab Points to NCSELF.
   1 \par 0ED4\tab \tab LD\tab (DE),A\tab Copy it into NCIRIS.
   1 \par 0ED1\tab \tab LD\tab A,(DSTR-1)\tab Fetch destination station number.
   1 \par 0ECF\tab \tab LDIR\tab \tab Copy the data into the channel area.
   1 \par 0ECC\tab \tab LD\tab BC,+000B\tab Length of data.
   1 \par 0EC9\tab \tab LD\tab HL,+0EEA\tab Start of "n" Channel data.
   1 \par 0EC8\tab \tab EX\tab DE,HL\tab Pass 'start' to DE.
   1 \par 0EC5\tab \tab LD\tab (CHURCHL),HL\tab Make the Channel 'current'
   1 \par 0EC3\tab \tab INC\tab HL\tab Point to the first new location.
   1 \par 0EC2\tab \tab CALL I691,RESThN.,.AD\tab \tab Restore start address of 'filename'
   1 \par 0EC1\tab \tab POP\tab BC\tab Restore 'length' of space inserted.
   1 \par 0EBE\tab \tab DEFW\tab +1655\tab \tab to make the required space.
   1 \par 0EBD\tab \tab RST\tab 10,CALBAS\tab Call main ROM 'MAKE-ROOM' subroutine
   1 \par 0EBC\tab \tab PUSH\tab BC\tab \tab Save it briefly.
   1 \par 0EB9\tab \tab LD\tab BC,+0114\tab Length of the channel.
   1 \par 0EB8\tab \tab DEC\tab HL \tab created.
   1 \par 0EB5\tab OP-PERN-N\tab LD\tab HL,(PROG)\tab Fetch start address of the channel
   1 \par 0EB5\tab OP-PERN-N\tab 0EF5\tab SEND-NEOF\tab 0F03\tab NET-STATE\tab 0F0E\tab CHK-REST
   1 \par 0EB5 Open permanent "n" channel
   1 \par 0EB4\tab \tab RET\tab \tab Finished.
   1 \par 0EB1\tab \tab SET\tab 7,(IX+4)\tab Make the channel temporary.
   1 \par 0EAC\tab \tab LD\tab IX,(CURCHL)\tab Fetch start of channel area.
   1 \par 0EA9 Open temporary "n" channel
   1 \par 0EA9 OP-TEMP-N\tab CALL\tab 0EB5,OP-PERM-N\tab Open a permanent "n" channel.
   1 \par 0EA6\tab \tab JP\tab 0B4A,OP-STREAM\tab Attach it to a stream.
   1 \par 0EA3\tab OPEN-N-ST\tab CALL\tab 0EB5.OP-PERM-N\tab Open a permanent "n" channel.
   1 \par 0EA3 OPEN "N" channel command routine
   1 \par 0EA2\tab \tab RET\tab \tab 'block successfully received'.
   1 \par 0EA1\tab GETBF-END\tab CP\tab A\tab Return with zero flag set to signal
   1 \par 0E?A\tab \tab LD\tab E,A\tab Length of the block to be received
   1 \par 0E9E\tab \tab INC\tab (NCNUMB-hi)
   1 \par 0E9C\tab \tab JR\tab NZ,0EA1,GETBF-END
   1 \par 0E99\tab \tab INC\tab (NCNUMB-lo)\tab Finally increment block number.
   1 \par 0E96\tab \tab LD\tab (NCIBL),A\tab Copy it into NCIBL.
   1 \par 0E93\tab \tab CALL\tab NZ,0FBE,SEND-SCOUT\tab Send response code for the data block
   1 \par 0E93\tab STORE-LEN\tab LD\tab A,(NTLEN)\tab Fetch data block length.
   1 \par 0E93\tab STORE-LEN\tab 0EA1\tab GETNBF-END\tab 0EA3\tab OPEN-N-ST\tab 0EA9\tab OP-TEMP-N
   1 \par 0E8F\tab \tab AND\tab A
   1 \par 0E8C\tab \tab LD\tab A,(NTDEST)\tab This holds 0 when broadcasting.
   1 \par 0E8B\tab \tab RET\tab NZ\tab Return if the checksum is wrong.
   1 \par 0E89\tab \tab DJNZ\tab 0E87,CHKS4\tab Repeat for all bytes in the block.
   1 \par 0E88\tab \tab INC\tab HL\tab Point to next location.
   1 \par 0E87\tab CHKS4\tab SUB\tab (HL)\tab Subtract current byte.
   1 \par 0E84\tab \tab LD\tab A,(NTDCS)\tab Start with the data block checksum.
   1 \par 0E83\tab \tab LD\tab B,A\tab B register.
   1 \par 0E83\tab \tab LD\tab A,(NTLEN)\tab Pass length of data block to the
   1 \par 0E7F\tab \tab RET\tab NZ\tab Return if the network was inactive.
   1 \par 0E7E\tab \tab POP\tab HL\tab Restore start address.
   1 \par 0E7B\tab \tab CALL\tab 0F92,INPAK\tab Receive the data block.
   1 \par 0E79\tab \tab PUSH\tab HL\tab Save start address.
   1 \par 0E78\tab \tab ADD\tab HL,DE
   1 \par 0E75\tab \tab LD\tab DE,+0015\tab Point to the start of data buffer.
   1 \par 0E74\tab \tab POP\tab HL\tab channel.
   1 \par 0E73\tab \tab JR\tab Z,0E93,STORE-LEN
   1 \par 0E72\tab \tab PUSH\tab IX\tab Make HL point to the start of the
   1 \par 0E6C\tab \tab LD\tab A,(NTLEN)\tab Fetch data block length.
   1 \par 0E69\tab \tab CALL\tab NZ,0FBE,SEND-RESP\tab Send the 'response' code (for the
   1 \par 0E68\tab \tab AND\tab A
   1 \par 0E65 GET-NBUFF\tab LD\tab A,(NTDEST)\tab This holds zero when broadcasting.
   1 \par 0E64\tab \tab RET\tab \tab the procedure is repeated.
   1 \par 0E62\tab GETNB-END\tab OR\tab +01\tab Return with zero flag reset, so that
   1 \par 0E5F\tab \tab DEC\tab (NCNUMB-hi)
   1 \par 0E5D\tab \tab JR\tab NC,0E62,GETNB-END\tab block.
   1 \par 0E5A\tab \tab DEC\tab (NCNUMB-lo)\tab Decrease NCNUMB, i.e. 'ignore' this
   1 \par 0E57\tab \tab CALL\tab 0E65,GET-NBUFF\tab \tab Receive the block.
   1 \par 0E56\tab \tab RET\tab NZ\tab But refuse other blocks.
   1 \par 0E55\tab \tab OR\tab C\tab lost).
   1 \par 0E54\tab \tab LD\tab A,H\tab (already received, but 'response'
   1 \par 0E53\tab \tab DEC\tab HL\tab Accept also the previous block
   1 \par 0E51\tab \tab JR\tab Z,0E65,GET-NBUFF\tab expected one.
   1 \par 0E4F\tab \tab SBC\tab HL,DE\tab Jump if the block received is the
   1 \par 0E4E\tab \tab AND\tab A
   1 \par 0E4B\tab \tab LD\tab D,(NCNUMB-hi)
   1 \par 0E48\tab \tab LD\tab E,(MCNUMB-lo)\tab Fetch number of expected block.
   1 \par 0E45\tab TEST-BLKN\tab LD\tab HL,(NTNUMB)\tab Fetch number of block being
   1 \par 0E45\tab TEST-BLKN\tab 0E62\tab GETNB-END\tab 0E65\tab GET-NBUFF\tab 0E87\tab CHKS4
   1 \par 0E44\tab \tab RET\tab NZ\tab Return if you are not waiting for a
   1 \par 0E43\tab \tab OR\tab A\tab (i.e. NTDEST and NCIRIS both 0).
   1 \par 0E40\tab BRCAST\tab LD\tab A,(NCIRIS)\tab Make sure that it is broadcasting
   1 \par 0E3E\tab \tab JR\tab 0E45,TEST-BLKN\tab Jump forward.
   1 \par 0E3D\tab \tab RET\tab NZ\tab Return if the transmitting Spectrum
   1 \par 0E3A\tab \tab CP\tab (NCIRIS)\tab Compare against NCIRIS.
   1 \par 0E37\tab \tab LD\tab A,(NTSRCE)\tab Source station number.
   1 \par 0E36\tab \tab RET\tab NZ\tab Return if this data block is for
   1 \par 0E33\tab \tab CP\tab (NCSELF)\tab Otherwise compare with NCSELF.
   1 \par 0E31\tab \tab JR\tab Z,0E40,BRCAST
   1 \par 0E30\tab \tab AND\tab A\tab Jump if broadcasting.
   1 \par 0E2D\tab \tab LD\tab A,(NTDEST)\tab Fetch destination station number.
   1 \par 0E2C\tab \tab RET\tab NZ\tab Return if they do not match.
   1 \par 0E2B\tab \tab CP\tab (HL)\tab Compare with NTCHS checksum.
   1 \par 0E29\tab \tab DJNZ\tab 0E27,CHKS3\tab Repeat for all bytes.
   1 \par 0E28\tab \tab INC\tab HL\tab Point to next location.
   1 \par 0E27\tab CHKS3\tab ADD\tab A,(HL)\tab Add this byte.
   1 \par 0E25\tab \tab LD\tab B,+07\tab Checksum for next 7 bytes.
   1 \par 0E24\tab \tab XOR\tab A\tab First clear A.
   1 \par 0E21\tab \tab LD\tab HL,+5CCE\tab Points again to NTDEST.
   1 \par 0E20\tab \tab RET\tab NZ\tab Return with network inactive (i.e.
   1 \par 0E1D\tab \tab CALL\tab 0F92,INPAK\tab \tab Receive the header.
   1 \par 0E1B\tab \tab LD\tab E,+08\tab Length of the block.
   1 \par 0E18\tab GET-NBLK\tab LD\tab HL,+5CCE\tab Point to NTDEST, i.e. first byte of
   1 \par 0E18 Header and data block receiving
   1 \par 0E17\tab \tab RET\tab \tab Finished.
   1 \par 0E15\tab \tab JR\tab NZ,0E12,DL-LOOP\tab Repeat if not.
   1 \par 0E14\tab \tab OR\tab D\tab zero.
   1 \par 0E13\tab \tab LD\tab A,E\tab Check whether the counter has reached
   1 \par 0E12\tab DL-LOOP\tab DEC\tab DE\tab Decrease it.
   1 \par 0E12\tab DL-LOOP\tab 0E18\tab GET-NBLK\tab 0E27\tab CHKS3\tab 0E40\tab BRCAST
   1 \par 0E0k\tab \tab LD\tab A,(NCIRIS)\tab Get destination station number.
   1 \par 0E0F BR-DELAY
   1 \par 0E09\tab \tab EI\tab \tab Enable interrupts.
   1 \par 0E06\tab \tab CALL\tab 0CA9,BORD-REST\tab Restore border colour.
   1 \par 0E05\tab SP-N-END\tab POP\tab HL\tab Restore pointer to NCIRIS.
   1 \par 0E02\tab \tab INC\tab (NCNUMB-hi)\tab Increment also high byte when low
   1 \par 0E01\tab \tab RET\tab \tab Finished.
   1 \par 0E01\tab BR-DELAY\tab LD\tab DE,+1500\tab Set a counter.
   1 \par 0E00\tab \tab JR\tab NZ,0E05,SP-N-END
   1 \par 0E00\tab \tab AND\tab A\tab Set zero flag if NCIRIS is 0 (i.e.
   1 \par 0DF8\tab \tab JR\tab NZ,0DDA,SENDSCOUT\tab Repeat until succesfully.
   1 \par 0DF8\tab \tab CALL\tab 0D93,OUT-BLK-N\tab \tab Send the data block and get the
   1 \par 0DF6\tab SP-DL-1\tab DJNZ\tab 0DF6,SP-DL-1
   1 \par 0DF6\tab SP-DL-1\tab 0DFD\tab INC-BLKN\tab 0E05\tab SP-N-END\tab 0E0F\tab BR-DELAY
   1 \par 0DF4\tab \tab LD\tab B,+20\tab Wait 418 T cycles before proceeding.
   1 \par 0DF2\tab \tab JR\tab Z,0DFD,INC-BLKN
   1 \par 0DF1\tab \tab AND\tab A\tab is empty); no data needs to be sent.
   1 \par 0DF0\tab \tab LD\tab A,E\tab If NCOBL is zero (i.e. if the buffer
   1 \par 0DF0\tab INC_BLKN\tab INC\tab (NCNUMB-lo)\tab Increment low byte of block number.
   1 \par 0DED\tab \tab LD\tab E,(NCOBL)\tab Get block length.
   1 \par 0DEC\tab \tab ADD\tab HL,DE\tab block.
   1 \par 0DE9\tab \tab LD\tab DE,+0015\tab Now points to the start of the data
   1 \par 0DE8\tab \tab POP\tab HL\tab channel.
   1 \par 0DE6\tab \tab PUSH\tab IX\tab Make HL point to the start of the "n"
   1 \par 0DE4\tab \tab JR\tab NZ,0DDA,SENDSCOUT\tab Repeat until successfully.
   1 \par 0DE1\tab \tab CALL\tab 9II93,OUT-BLK-N\tab The header is sent, and the response
   1 \par 0DDk\tab SENDSCOUT\tab CALL 9Fb1,SEND-SC\tab \tab Send the SCOUT (i.e. a leader
   1 \par 0DD9\tab \tab DI\tab \tab Disable interrupts.
   1 \par 0DD8\tab \tab LD\tab (HL),A\tab Store checksum into NCHCS.
   1 \par 0DD6\tab \tab DJNZ\tab 0DD4,CHKS2\tab Repeat for all bytes.
   1 \par 0DD5\tab \tab INC\tab HL\tab Point to next location.
   1 \par 0DD4\tab CHKS2\tab ADD\tab A,(HL)\tab Add this byte.
   1 \par 0DD3\tab \tab XOR\tab A\tab Clear A register.
   1 \par 0DD1\tab \tab PUSH\tab HL\tab i.e. Start of header block.
   1 \par 0DD1\tab \tab LD\tab B,+07\tab Checksum is for 7 bytes.
   1 \par 0DD1\tab \tab LD\tab 1,48\tab The header Is made by '8' bytes.
   1 \par 0DD0\tab \tab PUSH\tab HL\tab Save the pointer.
   1 \par 0DD0\tab \tab POP\tab HL\tab Restore pointer to NCIEIS,
   1 \par 0DCF\tab \tab ADD\tab HL,DE
   1 \par 0DCC\tab \tab LD\tab HL,+000B\tab Now points to NCIRIS.
   1 \par 0DC9\tab \tab LD\tab (NCDCS),A\tab Store the checksum obtained.
   1 \par 0DC7\tab \tab DJNZ\tab 0DC5,CHKS1\tab Repeat for all bytes in the block.
   1 \par 0DC6\tab \tab INC\tab HL\tab Point to next location.
   1 \par 0DC5\tab CHKS1\tab ADD\tab A,(HL)\tab Add this byte.
   1 \par 0DC4\tab \tab XOR\tab A\tab First clear A register.
   1 \par 0DC3\tab \tab ADD\tab HL,DE\tab the start of the 255-byte buffer.
   1 \par 0DC0\tab \tab LD\tab HL,+0015\tab Add this offset to point to
   1 \par 0DBF\tab \tab POP\tab DE\tab "n" channel.
   1 \par 0DBD\tab \tab PUSH\tab IX\tab Make DE point to the start of the
   1 \par 0DBB\tab \tab OUT\tab (+FE),A
   1 \par 0DB8\tab \tab LD\tab A,(IOBORD)\tab Fetch new border colour.
   1 \par 0DB5\tab \tab LD\tab B,(NCOBL)\tab Fetch block length.
   1 \par 0DB2\tab SEND-PACK\tab 0DC5\tab CHKS1\tab 0DD4\tab CHKS2\tab 0DDA\tab SENDSCOUT
   1 \par 0DB2 SEND-PACK\tab LD\tab (NCTYPE),A\tab Store packet type, i.e. +00 for
   1 \par 0DB2 SEND-PACK
   1 \par 0DB1\tab \tab XOR\tab A\tab Signal normal packet type.
   1 \par 0DAF\tab \tab JP\tab 0E0F,BR-DELAY\tab Otherwise exit through the delay
   1 \par 0DAE\tab \tab RET\tab NZ\tab Return if not broadcasting.
   1 \par 0DAB\tab S-PACK-1\tab CALL\tab 0DB2,SEND-PACK\tab \tab Send the packet.
   1 \par 0DAB S-PACK-1
   1 \par 0DAA\tab \tab RET\tab \tab Return with zero flag reset if it
   1 \par 0DA9\tab \tab DEC\tab A\tab It must be +01.
   1 \par 0DA6\tab \tab LD\tab A,(NTRESP)\tab Now fetch the response byte.
   1 \par 0DA5\tab \tab RET\tab NZ\tab Return with zero flag reset if the
   1 \par 0DA2\tab \tab CALL\tab 0F92,INPAK\tab Get response byte (+01).
   1 \par 0DA0\tab \tab LD\tab E,+01\tab A single byte is to be received
   1 \par 0D9E\tab \tab LD\tab (HL),+00\tab First clear NTRESP.
   1 \par 0D9A\tab \tab RET\tab Z\tab Return if broadcasting.
   1 \par 0D99\tab \tab AND\tab A
   1 \par 0D96\tab \tab LD\tab A,(NCIRIS)\tab This holds zero when broadcasting.
   1 \par 0D93\tab \tab LD\tab HL,+5CCD\tab Address of NTRESP system variable.
   1 \par 0D93\tab OUT-BLK-N\tab CALL\tab 0FC5,OUTPAK\tab Send the block.
   1 \par 0D93 OUT-BLK-N
   1 \par 0D92\tab \tab RET\tab \tab Finished.
   1 \par 0D8F\tab \tab LD\tab (IX+20),A\tab Store byte in the buffer.
   1 \par 0D8D\tab \tab ADD\tab IX,DE\tab the buffer - 20).
   1 \par 0D8B\tab \tab LD\tab D,+00\tab Make IX point to 'first free byte in
   1 \par 0D88\tab ST-BF-LEN\tab LD\tab (NCOBL),E\tab Store new buffer length.
   1 \par 0D86\tab \tab LD\tab E,+01\tab 'Only 1 byte in the buffer'.
   1 \par 0D85\tab \tab POP\tab AF\tab Restore the byte to be sent.
   1 \par 0D82\tab \tab CALL\tab 0DAB,S-PACK-1\tab Send the packet.
   1 \par 0D80\tab \tab PUSH\tab AF\tab Save the byte to be sent.
   1 \par 0D7E\tab \tab JR\tab NZ,0D88,ST-BF-LEN\tab Jump unless the buffer is filled.
   1 \par 0D7D\tab \tab INC\tab E\tab Include the current byte in the
   1 \par 0D7A\tab TEST-OUT\tab LD\tab E,(NCOBL)\tab Fetch length of output buffer.
   1 \par 0D7A\tab TEST-OUT\tab 0D88\tab ST-BF-LEN\tab 0D93\tab OUT-BLK-N\tab 0DAB\tab S-PACK-1
   1 \par 0D79\tab \tab DEFB\tab +0C\tab routine.
   1 \par 0D78\tab \tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 0D76\tab \tab JR\tab Z,0D7A,TEST-OUT\tab Continue only if using a 'write'
   1 \par 0D75\tab \tab LD\tab A,B\tab Restore the byte to be sent.
   1 \par 0D74\tab \tab AND\tab A\tab Set zero flag as required.
   1 \par 0D71\tab \tab LD\tab A,(NCIBL)\tab This holds 0 for 'write' channel.
   1 \par 0D70\tab \tab LD\tab B,A\tab Save temporarily into B the byte to
   1 \par 0D6C NCHAN-OUT\tab LD\tab IX,(CURCHL)\tab Point to start of channel.
   1 \par 0D6C "N" channel output
   1 \par 0D6B\tab \tab RET\tab \tab reset, signalling that no data has
   1 \par 0D69\tab \tab AND\tab +00\tab Return with zero flag set and carry
   1 \par 0D66\tab \tab CALL\tab 0CA9,BORD-REST\tab Restore border colour.
   1 \par 0D65\tab \tab DI\tab \tab Enable interrupts.
   1 \par 0D63\tab \tab JR\tab Z,0D45,TRY-AGAIN\tab broadcasting (NCIRIS=0).
   1 \par 0D62\tab \tab AND\tab A\tab There is no 'time-out' when
   1 \par 0D5F TIME-OUT\tab LD\tab A,(NCIRIS)\tab Fetch destination station no.
   1 \par 0D5D\tab \tab JR\tab 0D1E,TEST-BUFF\tab Try now to fetch the byte.
   1 \par 0D5A\tab \tab LD\tab (NCTYPE),A\tab to signal the packet type.
   1 \par 0D57\tab \tab LD\tab A,(NTTYPE)\tab Copy this byte
   1 \par 0D53\tab \tab LD\tab (NCCUR),+00\tab The position is 0.
   1 \par 0D51\tab \tab CALL\tab 0CA9,BORD-REST\tab Restore border colour.
   1 \par 0D4F\tab \tab EI\tab \tab Enable interrupts.
   1 \par 0D4D\tab \tab JR\tab NZ,0D5F,TIME-OUT\tab Jump with any error.
   1 \par 0D4A\tab \tab CALL\tab 0E18,GET-NBLK\tab Wait for header and data block.
   1 \par 0D48\tab \tab JR\tab NC,0D5F,TIME-OUT\tab Jump if 'time out' occurs.
   1 \par 0D45\tab TRY-AGAIN\tab CALL\tab 0F1E,WT-SCOUT\tab Wait for a 'scout' leader.
   1 \par 0D44\tab \tab DI\tab \tab Disable interrupts.
   1 \par 0D42\tab \tab OUT\tab (+FE),A\tab Change border colour.
   1 \par 0D3F\tab GET-N-BUF\tab LD\tab A,(IOBORD)\tab Fetch new border colour.
   1 \par 0D3F\tab GET-N-BUF\tab 0D45\tab TRY-AGAIN\tab 0D5F\tab TIME-OUT\tab 0D6C\tab NCHAN-OUT
   1 \par 0D3E\tab \tab RET\tab \tab Otherwise return with both zero and
   1 \par 0D3C\tab \tab JR\tab Z,0D3F,GET-N-BUF\tab Indicating a normal packet.
   1 \par 0D3B\tab \tab AND\tab A\tab Jump if packet type = 0.
   1 \par 0D38\tab TST-N-EOF\tab LD\tab A,(NCTYPE)\tab Fetch packet type.
   1 \par 0D37\tab \tab RET\tab \tab Finished.
   1 \par 0D36\tab \tab SCF\tab \tab Carry is set to signal 'acceptable
   1 \par 0D33\tab \tab LD\tab A,(IX+20)\tab \tab Read the byte.
   1 \par 0D31\tab \tab ADD\tab IX,DE\tab \tab Points to 'byte to be read - 20'.
   1 \par 0D2E\tab \tab LD\tab (NCCUR),E
   1 \par 0D2D\tab \tab INC\tab E\tab \tab Update the character position.
   1 \par 0D2B\tab \tab LD\tab D,+00\tab \tab Clear D register.
   1 \par 0D29\tab \tab JR\tab C,0D38,TST-N-EOF\tab Jump if all bytes have been read.
   1 \par 0D28\tab \tab SUB\tab E\tab \tab Subtract position from the result.
   1 \par 0D27\tab \tab DEC\tab A\tab \tab Decrease number of bytes to be read
   1 \par 0D24\tab \tab LD\tab E,(NCCUR)\tab \tab Otherwise fetch the current position.
   1 \par 0D22\tab \tab JR\tab Z,0D38,TST-N-EOF\tab is empty.
   1 \par 0D21\tab \tab AND\tab A\tab If NCIBL holds zero, then the buffer
   1 \par 0D1E\tab TEST-BUFF\tab LD\tab A,(NCIBL)\tab Fetch number of bytes to be read
   1 \par 0D1D\tab \tab DEFB\tab +0D\tab \tab routine.
   1 \par 0D1C\tab \tab RST\tab 20,SH-ERR\tab \tab Call the error handling
   1 \par 0D1A\tab \tab JR\tab Z,0D1E,TEST-BUFF
   1 \par 0D19\tab \tab AND\tab A\tab Jump if it is a "read" file.
   1 \par 0D16\tab \tab LD\tab A,(NCOBL)\tab This holds 0 while 'receiving'.
   1 \par 0D12\tab NCHAN-IN\tab LD\tab IX,(CURCHL)\tab Fetch start of "n" channel.
   1 \par 0D12 "N" channel input service routine
   1 \par 0D0F\tab \tab JP\tab 0CBD,CALL-INP\tab Jump to the control routine.
   1 \par 0D0C\tab N-INPUT\tab LD\tab HL,+0D12\tab Address of NCHAN-IN routine.
   1 \par 0D0C\tab N-INPUT\tab 0D12\tab NCHAN-IN\tab 0D1E\tab TEST-BUFF\tab 0D38\tab TST-N-EOF
   1 \par 0D0C "N" channel input
   1 \par 0D0B\tab \tab RET\tab \tab used - so return with carry and zero
   1 \par 0D09\tab \tab OR\tab +01\tab Otherwise the MOVE command has been
   1 \par 0D07\tab \tab JR\tab Z,0CE5,OREPORT-8\tab 4 of FLAGS3 is reset.
   1 \par 0D05\tab \tab JR\tab 0CF9,TABLOOP
   1 \par 0D04\tab \tab POP\tab DE
   1 \par 0D03\tab \tab BIT\tab 4,(FLAGS3)\tab Give the 'end of file' error if bit
   1 \par 0D02\tab \tab RET\tab Z\tab no character read.
   1 \par 0D01\tab \tab CALL\tab 0C3A,TCHAN-OUT
   1 \par 0D01\tab INK$-END\tab RET\tab C\tab Return with acceptable codes, or
   1 \par 0D00\tab \tab JP\tab (HL)\tab Jump to the service routine.
   1 \par 0CFF\tab \tab PUSH\tab DE
   1 \par 0CFF\tab \tab LD\tab A,+20\tab Print the TAB spaces.
   1 \par 0CFE\tab \tab PUSH\tab DE
   1 \par 0CFD\tab \tab RET\tab Z\tab ..TAB position.
   1 \par 0CFC\tab \tab LD\tab DE,+0D01\tab Return address is INK$-END below.
   1 \par 0CFC\tab \tab JR\tab NC,0CF4,TABZERO\tab Jump if TAB is within range.
   1 \par 0CFC\tab \tab CP\tab D\tab Return if already at the..
   1 \par 0CFB\tab INKEY$\tab POP\tab HL\tab Address of service routine.
   1 \par 0CF9\tab TABLOOP\tab LD\tab A,(5CB0)\tab Fetch current print position.
   1 \par 0CF8\tab \tab JP\tab 0700,UNPAGE\tab Return to the main ROM calling
   1 \par 0CF7\tab END-INPUT\tab POP\tab HL\tab Remove address of service routine.
   1 \par 0CF6\tab \tab JP\tab Z,0C74,NEWLINE
   1 \par 0CF5\tab \tab OR\tab A\tab New line with TAB 0.
   1 \par 0CF5\tab \tab JR\tab 0CDB,IN-AGAIN\tab and read the next byte.
   1 \par 0CF4\tab \tab POP\tab HL\tab Restore address of service routine
   1 \par 0CF4 TABZERO\tab LD\tab A,D\tab Fetch TAB column.
   1 \par 0CF2\tab \tab JR\tab 0CE6,TST-WIDTH\tab Take (TAB pos.) MOD (width).
   1 \par 0CF2\tab \tab DEFW\tab +0F85\tab to the INPUT line - so enter into the
   1 \par 0CF1\tab \tab RST\tab 10,CALBAS\tab Otherwise the character is to be added
   1 \par 0CF1\tab \tab LD\tab D,A\tab The new position.
   1 \par 0CF0\tab \tab SUB\tab B\tab A=TAB-WIDTH
   1 \par 0CEF\tab \tab LD\tab A,D\tab Fetch TAB column.
   1 \par 0CEF\tab \tab JR\tab Z,0CF7,END-INPUT
   1 \par 0CEE TAB-MOD\tab LD\tab B,A\tab Fetch column width.
   1 \par 0CED\tab ACC-CODE\tab CP\tab +0D\tab Jump if the code is ENTER.
   1 \par 0CED\tab ACC-CODE\tab 0CF7\tab END-INPUT\tab 0CFB\tab INKEY$\tab 0D01\tab INK$-END
   1 \par 0CEB\tab \tab JR\tab 0CDB,IN-AGAIN\tab and try again.
   1 \par 0CEA\tab \tab JR\tab Z,0CEE,TAB-MOD\tab Jump if TAB is at last column.
   1 \par 0CEA\tab NO-READ\tab POP\tab HL\tab Restore address of service routine
   1 \par 0CE9\tab \tab RST\tab 28,ROMERR\tab error.
   1 \par 0CE9\tab \tab CP\tab D
   1 \par 0CE6 TST-WIDTH\tab LD\tab A,(5CB1)\tab Fetch line width.
   1 \par 0CE5\tab \tab LD\tab D,A\tab Move it into D.
   1 \par 0CE5\tab OREPORT-8\tab LD\tab (ERR-NR),+07\tab Otherwise report the 'End of file'
   1 \par 0CE3\tab \tab JR\tab Z,0CEA,NO-READ\tab Jump with no data read.
   1 \par 0CE2\tab \tab LD\tab A,(TVDATA-hi)\tab Fetch TAB column.
   1 \par 0CE1\tab \tab RET\tab NZ
   1 \par 0CE1\tab INPUT-END\tab JR\tab C,0CED,ACC-CODE\tab Jump with acceptable codes.
   1 \par 0CE0\tab \tab JP\tab (HL)\tab Jump to the service routine.
   1 \par 0CE0\tab \tab CCF
   1 \par 0CDF\tab \tab PUSH\tab DE
   1 \par 0CDE\tab \tab CP\tab +17\tab Return unless the code is TAB.
   1 \par 0CDC\tab \tab LD\tab DE,+0CE1\tab Return address is INPUT-END below.
   1 \par 0CDC\tab \tab JR\tab Z,0CE6,TST-WIDTH
   1 \par 0CDB\tab IN-AGAIN\tab PUSH\tab HL\tab Save address of the service routine.
   1 \par 0CDB\tab IN-AGAIN\tab 0CE1\tab INPUT-END\tab 0CE5\tab OREPORT-8\tab 0CEA\tab NO-READ
   1 \par 0CDA\tab \tab CP\tab +16\tab Jump with AT.
   1 \par 0CD7\tab \tab LD\tab A,(TVDATA-lo)\tab Fetch first operand (code type).
   1 \par 0CD7\tab \tab LD\tab (ERR-SP),DE\tab is restored.
   1 \par 0CD6\tab \tab POP\tab DE\tab The old value of ERR-SP
   1 \par 0CD6\tab \tab LD\tab D,A\tab Pass 'second operand' to D.
   1 \par 0CD5\tab \tab POP\tab DE\tab Remove ED-ERROR.
   1 \par 0CD3\tab \tab CALL\tab 0CBB,ALTER-OUT
   1 \par 0CD1\tab \tab LD\tab SP,(ERR-SP)\tab Clear machine stack.
   1 \par 0CD0\tab \tab POP\tab HL\tab Restore address of service routine.
   1 \par 0CD0\tab \tab LD\tab DE,+0C3A\tab Restore the normal 'output' address.
   1 \par 0CCE\tab \tab JR\tab NZ,0CFB,INKEY$\tab command.
   1 \par 0CCE\tab \tab JR\tab 0CBB,ALTER-OUT\tab Jump to change the 'output' address.
   1 \par 0CCC\tab \tab SBC\tab HL,DE\tab Jump forward if not during an INPUT
   1 \par 0CCB\tab \tab LD\tab (TVDATA-hi),A\tab Store second operand.
   1 \par 0CC?\tab \tab RET
   1 \par 0CC9\tab \tab LD\tab HL,+107F\tab This is ED-ERROR.
   1 \par 0CC8\tab \tab AND\tab A\tab Prepare for a true subtraction.
   1 \par 0CC8 TAB-SERV\tab LD\tab DE,+0CD0\tab The new 'output' address.
   1 \par 0CC7\tab \tab LD\tab D,(HL)\tab Fetch high byte.
   1 \par 0CC6\tab \tab LD\tab (HL),D
   1 \par 0CC6\tab \tab INC\tab HL
   1 \par 0CC5\tab \tab LD\tab E,(HL)\tab Fetch low byte of error addres
   1 \par 0CC5\tab \tab INC\tab HL
   1 \par 0CC4\tab \tab LD\tab (HL),E\tab Store new 'output' address.
   1 \par 0CC3\tab \tab POP\tab DE
   1 \par 0CC2\tab \tab LD\tab HL,(ERR-SP)\tab Points to the error address.
   1 \par 0CC2\tab \tab ADD\tab HL,DE
   1 \par 0CC1\tab \tab PUSH\tab HL\tab Save address of the service routine.
   1 \par 0CBF\tab \tab LD\tab DE,+0005\tab Point to 'output address' pointer.
   1 \par 0CBE\tab \tab PUSH\tab DE
   1 \par 0CBD\tab CALL-INP\tab RES\tab 3,(TVFLAG)\tab 'The mode is to be considered as being
   1 \par 0CBD CALL-INP
   1 \par 0CBC\tab \tab RST\tab 28,ROMERR
   1 \par 0CBB ALTER-OUT\tab LD\tab HL,(CURCHL)\tab Fetch current channel address.
   1 \par 0CB8\tab \tab LD\tab (ERR-NR),+l4\tab Store error code and give the error.
   1 \par 0CB8 STORE-COD\tab LD\tab (TVDATA-lo),A\tab Store first operand.
   1 \par 0CB5\tab \tab CALL\tab 0CA9,BORD-REST\tab Restore border colour.
   1 \par 0CB5 TAB-PROC\tab LD\tab DE,+0CC8\tab Service routine for AT and TAB
   1 \par 0CB4\tab BRK-INOUT\tab EI\tab \tab Enable interrupts.
   1 \par 0CB4 Break into I/O operation
   1 \par 0CB3\tab \tab RET\tab \tab Finished.
   1 \par 0CB3\tab \tab JR\tab 0CB8,STORE-COD\tab ...control codes.
   1 \par 0CB1\tab \tab OUT\tab (+FE),A\tab Restore colour.
   1 \par 0CB0\tab \tab RRCA
   1 \par 0CB0\tab \tab LD\tab DE,+0CD0\tab Service routine for INK, PAPER
   1 \par 0CAF\tab \tab RRCA
   1 \par 0CAF\tab \tab RET\tab C
   1 \par 0CAE\tab \tab RRCA\tab \tab Rotate colour into bits 0,l,2.
   1 \par 0CAD\tab \tab CP\tab +19\tab Return with codes lower than 16d
   1 \par 0CAC\tab \tab AND\tab +38\tab Only bits 3,4,5, i.e. BORDER.
   1 \par 0CAB\tab \tab JR\tab Z,0C5B,TAB-PROC
   1 \par 0CA9\tab \tab CP\tab +17\tab Jump with TAB control code.
   1 \par 0CA9 Border colour restore
   1 \par 0CA9 BORD-REST\tab LD\tab A,(BORDCR)\tab Fetch lower screen attribute.
   1 \par 0CA7\tab \tab JR\tab Z,0CB5,TAB-PROC
   1 \par 0CA7\tab \tab JR\tab NZ,0CA4,BD-DEL-3
   1 \par 0CA6\tab \tab OR\tab H\tab below.
   1 \par 0CA5\tab \tab LD\tab A,L\tab via the border-restore routine
   1 \par 0CA5 NOT-CNN\tab CP\tab +16\tab Jump with AT control code.
   1 \par 0CA4\tab BD-DEL-3\tab DEC\tab HL\tab Insert a final delay before returning
   1 \par 0CA4\tab BD-DEL-3\tab 0CA9\tab BORD-REST\tab 0CB4\tab BRK-INOUT\tab 0CBD\tab CALL-INP
   1 \par 0CA3\tab \tab JR 0C9A,PRINT-SPC
   1 \par 0CA2\tab \tab RET\tab Z
   1 \par 0CA2\tab \tab OUT\tab (C),B\tab Turn off RS232.
   1 \par 0CA1\tab \tab DEC\tab E
   1 \par 0CA0\tab \tab POP\tab DE\tab Restore space counter.
   1 \par 0CA0\tab \tab OUT\tab (+F7),A\tab Make RXdata having a high level.
   1 \par 0C9l\tab \tab JR\tab NZ,0C8E,BD-DEL-2
   1 \par 0C9E\tab \tab LD\tab B,+EE
   1 \par 0C9D\tab \tab CALL\tab 0C3A,TCHAN-OUT\tab by calling TCHAN-OUT recursively.
   1 \par 0C9C\tab \tab LD\tab C,+EF
   1 \par 0C9B\tab \tab LD\tab A,+20\tab Print the required number of spaces
   1 \par 0C9A\tab \tab LD\tab A,+01
   1 \par 0C9A\tab PRINT-SPC\tab PUSH\tab DE\tab Save space counter.
   1 \par 0C99\tab \tab DI\tab \tab Enable interrupts.
   1 \par 0C98\tab \tab JR\tab 0C8C,SPC-COUNT\tab Column not reached, jump back.
   1 \par 0C97\tab \tab DJNZ\tab 0C88,SER-OUT-L\tab Loop for all 11 bits.
   1 \par 0C96\tab \tab JR\tab NC,0C92,CMMLOOP\tab Subtract again...
   1 \par 0C95\tab \tab SRL\tab C\tab Shift the bit to be sent into carry.
   1 \par 0C94\tab \tab XOR\tab A\tab Clear A for next pass.
   1 \par 0C94\tab \tab JR\tab Z,0C9A,PRINT-SPC\tab Jump when reached the right column.
   1 \par 0C93\tab \tab DEC\tab DE\tab Wait 6 T cycles.
   1 \par 0C92\tab CMM-LOOP\tab SUB\tab +08\tab Tabulate every 8 columns.
   1 \par 0C90\tab \tab OR\tab E
   1 \par 0C90\tab \tab JR\tab Z,0C9A,PRINT-SPC
   1 \par 0C8F\tab \tab LD\tab A,D\tab sent each bit.
   1 \par 0C8F\tab \tab CP\tab B\tab right margin.
   1 \par 0C8E\tab \tab LD\tab A,C\tab Jump if 'position' reaches the
   1 \par 0C8E\tab BD-DEL-2\tab DEC\tab DE\tab Wait 26*(BAUD) T cycles after having
   1 \par 0C8D\tab \tab LD\tab E,L
   1 \par 0C8D\tab \tab INC\tab C\tab Increment print position.
   1 \par 0C8C\tab \tab LD\tab D,H\tab Copy timing constant into DE.
   1 \par 0C8C\tab SPC-COUNT\tab INC\tab E\tab Increment space counter.
   1 \par 0C8A\tab \tab OUT\tab (+F7),A\tab Send this bit over RS232 link.
   1 \par 0C8A\tab \tab LD \tab E,+00
   1 \par 0C88\tab SER-OUT-L\tab ADC\tab A+00\tab In fact, shift carry into bit 0 of
   1 \par 0C87\tab \tab DI\tab \tab Disable interrupts.
   1 \par 0C86\tab \tab SCF\tab \tab Set carry flag (start bit).
   1 \par 0C86\tab \tab LD\tab BC,(5CB0)\tab Fetch width into B, and print
   1 \par 0C84\tab \tab JR\tab Z,0C74,TEST-DTR\tab Jump back until DTR is found high.
   1 \par 0C84\tab \tab JR\tab NZ,0CA5,NOT-CMM\tab 'comma' control code.
   1 \par 0C82\tab \tab AND\tab +08\tab Only bit 3.
   1 \par 0C82\tab NOT-CR\tab CP\tab +06\tab Jump if the character is not the
   1 \par 0C80\tab \tab IN\tab A,(+EF)\tab Read DTR line.
   1 \par 0C7l\tab \tab OR\tab E
   1 \par 0C7F\tab \tab JP\tab 0D07,BCHAN-OUT
   1 \par 0C7D\tab \tab LD\tab A,+0A\tab Print a LF code.
   1 \par 0C7D\tab \tab JP\tab NC,0CB4,BRK-INOUT\tab Give an error if BREAK is pressed.
   1 \par 0C7C\tab \tab RRA\tab \tab Test bit 0.
   1 \par 0C7A\tab \tab IN\tab A,(+FE)\tab if SPACE is being pressed.
   1 \par 0C7A\tab \tab CALL\tab 0D07,BCHAN-OUT
   1 \par 0C78\tab \tab OR\tab +FE\tab Read port +FEFE (CAPS SHIFT key) only
   1 \par 0C78\tab \tab LD\tab A,+0D\tab Print a CR code.
   1 \par 0C76\tab \tab IN\tab A,(+FE)
   1 \par 0C74\tab \tab LD\tab (IY+118),+00\tab Clear print position.
   1 \par 0C74\tab TEST-DTR\tab LD\tab A,+7F\tab Read port +7FFE (SPACE key).
   1 \par 0C72\tab \tab JR\tab NZ,0C82,NOT-CR
   1 \par 0C72\tab \tab JR\tab NZ,0C6F,BD-DEL-1
   1 \par 0C70\tab \tab LD\tab A,D
   1 \par 0C70\tab CTRL-CD\tab CP\tab +0D\tab Jump if the character is not 'CR'.
   1 \par 0C6F\tab BD-DEL-1\tab DEC\tab DE\tab Firstly wait (26*(BAUD)) T cycles.
   1 \par 0C6F\tab BD-DEL-1\tab 0C74\tab TEST-DTR\tab 0C88\tab SER-OUT-L\tab 0C8E\tab BD-DEL-2
   1 \par 0C6E\tab \tab LD\tab E,L
   1 \par 0C6D\tab \tab LD\tab D,H\tab Copy into DE register pair.
   1 \par 0C6D\tab \tab JP\tab 0D07,BCHAN-OUT\tab Print it.
   1 \par 0C6C\tab ENIT-CH\tab POP\tab AF\tab Restore character to be printed.
   1 \par 0C6A\tab \tab LD\tab HL,(BAUD)\tab Fetch timing constant.
   1 \par 0C68\tab \tab OUT\tab (+F7),A\tab Make RXdata have a low signal level.
   1 \par 0C68\tab \tab LD\tab (IY+118),+01\tab Reset 'print position' to +01.
   1 \par 0C67\tab \tab CPL
   1 \par 0C65\tab \tab OUT\tab (+EF),A
   1 \par 0C65\tab \tab CALL\tab 0C74,NEWLINE\tab Send CR and LF codes when pos>width.
   1 \par 0C63\tab \tab LD\tab A,+EF\tab Reset CTS and select RS232.
   1 \par 0C63\tab \tab JR\tab NC,0C6C,EMIT-CH\tab or equal to the value of WIDTH.
   1 \par 0C61\tab \tab OUT\tab (+FE),A\tab Change border colour.
   1 \par 0C60\tab \tab CP\tab (IY+118)\tab Jump if the position is lower than
   1 \par 0C5E\tab \tab LD\tab A,(IOBORD)\tab Fetch new border colour.
   1 \par 0C5D\tab \tab LD\tab C,A\tab C holds the byte to be sent.
   1 \par 0C5D\tab \tab LD\tab A,(5CB1)\tab Fetch line width.
   1 \par 0C5C\tab \tab CPL\tab \tab Invert the eight data bits.
   1 \par 0C5A\tab \tab INC\tab (IY+118)\tab Increment current print position.
   1 \par 0C5A\tab BCHAN-OUT\tab LD\tab B,+0B\tab Counts '11' bits.
   1 \par 0C5A "B" channel output
   1 \par 0C59\tab \tab RET\tab C\tab otherwise use BCHAN-OUT below to send
   1 \par 0C59\tab \tab PUSH\tab AF\tab Save the character code.
   1 \par 0C57\tab \tab JR\tab C,0C78,CTRL-CD
   1 \par 0C57\tab NOT-CR\tab CP\tab +20\tab Ignore all codes lower than +20,
   1 \par 0C55\tab \tab CALL\tab 0C5A,BCHAN-OUT
   1 \par 0C55\tab NOT-GRAPH\tab CP\tab +20\tab Jump with codes lower than +20.
   1 \par 0C53\tab \tab LD\tab A,+3F\tab Otherwise print a '?'
   1 \par 0C53\tab \tab LD\tab A,+0A\tab Follow it with a linefeed code.
   1 \par 0C51\tab \tab JR\tab C,0C55,NOT-GRAPH\tab a 'graphic' character.
   1 \par 0C50\tab \tab CALL\tab 0C5A,BCHAN-OUT\tab Otherwise send the CR code.
   1 \par 0C4F\tab NOT-LEAD\tab CP\tab +7F\tab Jump if the character is not
   1 \par 0C4E\tab \tab JR\tab NZ,0C57,NOT-CR\tab Jump if not.
   1 \par 0C4D\tab \tab SET\tab 0,(HL)\tab Otherwise set 'leading space' flag.
   1 \par 0C4C\tab NOT-GRAPH\tab CP\tab +0D\tab Is the code 'ENTER'?
   1 \par 0C4B\tab \tab JR\tab NZ,0C4F,NOT-LEAD\tab Jump if it is not.
   1 \par 0C4A\tab \tab LD\tab A,+3F\tab Otherwise send a '?'.
   1 \par 0C49\tab \tab CP\tab +20\tab Is the character a space?
   1 \par 0C48\tab \tab JR\tab C,0C4C,NOT-GRAPH\tab graphic character.
   1 \par 0C47\tab \tab RES\tab 0,(HL)\tab Reset 'leading space' flag.
   1 \par 0C46\tab NOT-TOKEN\tab CP\tab +7F\tab Jump if the character is not a
   1 \par 0C46\tab NOT-TOKEN\tab 0C4C\tab NOT-GRAPH\tab 0C57\tab NOT-CR\tab 0C5A\tab BCHAN-OUT
   1 \par 0C45\tab \tab RET\tab \tab 'PO-TOKENS' routine.
   1 \par 0C44\tab NOT-TOKEN\tab LD\tab HL,+5C3B\tab This is FLAGS.
   1 \par 0C43\tab \tab RET\tab \tab ROM 'PO-TOKENS' routine.
   1 \par 0C43\tab \tab DEFW\tab +0C10\tab recursively this routine via main ROM
   1 \par 0C42\tab \tab RST\tab 10,CALBAS\tab and detokenise it by calling
   1 \par 0C41\tab \tab DEFW\tab +0C18\tab recursively this routine via main
   1 \par 0C40\tab \tab SUB\tab +A5\tab Reduce range of token,
   1 \par 0C40\tab \tab RST\tab 10,CALBAS\tab And detokenise it by calling
   1 \par 0C3E\tab \tab SUB\tab +A5\tab Reduce range of token.
   1 \par 0C3E\tab \tab JR\tab C,0C46,NOT-TOKEN
   1 \par 0C3C\tab \tab JR\tab C,0C44,NOT-TOKEN\tab code.
   1 \par 0C3C\tab TCHAN-OUT\tab CF\tab +A5\tab Jump if the code is not a token code.
   1 \par 0C3C "T" channel output
   1 \par 0C3B\tab \tab RET\tab \tab Finished.
   1 \par 0C3A\tab \tab EI\tab \tab Enable interrupts.
   1 \par 0C39\tab \tab POP\tab AF\tab Restore first byte and flags.
   1 \par 0C36\tab END-RS-IN\tab CALL\tab 0CA9,BORDREST\tab Restore border colour.
   1 \par 0C35\tab \tab LD\tab (HL),A\tab SER-FL-hi.
   1 \par 0C34\tab \tab CPL\tab \tab Complement it and store into
   1 \par 0C33\tab \tab LD\tab A,B\tab \tab Fetch the received byte.
   1 \par 0C32\tab \tab INC\tab HL\tab Points to SER-FL-hi.
   1 \par 0C30\tab \tab LD\tab (HL),+01\tab Set it to +01, indicating that
   1 \par 0C2D\tab \tab LD\tab HL,+5CC7\tab Points to SER-FL-lo
   1 \par 0C2B\tab \tab JR\tab NC,0C1D,SER-IN-2
   1 \par 0C29\tab \tab RR\tab B
   1 \par 0C28\tab \tab RLCA
   1 \par 0C26\tab \tab IN\tab A,(+F7)
   1 \par 0C24\tab \tab ADD\tab A,+00
   1 \par 0C22\tab \tab JR\tab NZ,0C1F,BD-DELAY2
   1 \par 0C21\tab \tab OR\tab L
   1 \par 0C20\tab \tab LD\tab A,H
   1 \par 0C1F\tab BD-DELAY2\tab DEC\tab HL
   1 \par 0C1E\tab \tab NOP
   1 \par 0C1D\tab SER-IN-2\tab ADD\tab HL,DE
   1 \par 0C1D\tab SER-IN-2\tab 0C1F\tab BD-DELAY2\tab 0C36\tab END-RS-IN\tab 0C3C\tab TCHAN-OUT
   1 \par 0C1C\tab \tab DEC\tab HL
   1 \par 0C1B\tab \tab DEC\tab HL
   1 \par 0C1A\tab \tab DEC\tab HL
   1 \par 0C18\tab \tab LD\tab B,+00
   1 \par 0C16\tab \tab RR\tab L
   1 \par 0C14\tab \tab SRL\tab H\tab Calculate (BAUD)/2 into HL.
   1 \par 0C13\tab \tab LD\tab L,E
   1 \par 0C12\tab \tab LD\tab H,D\tab Fetch timing constant into HL.
   1 \par 0C10\tab \tab JR\tab NC,0BF9,T-FURTHER
   1 \par 0C0E\tab \tab RLCA
   1 \par 0C0D\tab \tab IN\tab A,(+F7)
   1 \par 0C0B\tab \tab JR\tab NC,0BF9,T-FURTMER
   1 \par 0C0A\tab \tab RLCA
   1 \par 0C08\tab \tab RLCA\tab \tab Shift received bit into carry.
   1 \par 0C08\tab \tab IN\tab A,(+F7)
   1 \par 0C06\tab \tab JR\tab NC,0BF9,T-FURTHER\tab high after 77 T cycles,
   1 \par 0C05\tab \tab RLCA\tab \tab to ensure that TXdata is still
   1 \par 0C03\tab \tab IN\tab A,(+F7)\tab Otherwise repeat the test three times
   1 \par 0C01\tab \tab JR\tab NC,0BF9,T-FURTHER\tab Jump back with TXdats low.
   1 \par 0BFE\tab \tab IN\tab A,(+F7)\tab Read TXdata line.
   1 \par 0BFC\tab \tab JR\tab Z,0C36,END-RS-IN\tab Exit if there is no further byte to
   1 \par 0BFB\tab \tab OR\tab H
   1 \par 0BFA\tab \tab LD\tab A,L \tab Repeat test until it has reached 0.
   1 \par 0BF9\tab T-FURTHER\tab DEC\tab HL \tab Decrease counter.
   1 \par 0BF8\tab \tab ADD\tab HL,DE\tab HL now holds (BAUD)*3.
   1 \par 0BF7\tab \tab ADD\tab HL,DE
   1 \par 0BF6\tab \tab ADD\tab HL,DE
   1 \par 0BF4\tab \tab JR\tab NZ,0BF1,WAIT-2
   1 \par 0BF3\tab \tab OR\tab L
   1 \par 0BF2\tab \tab LD\tab A,H\tab finished.
   1 \par 0BF1\tab WAIT-2\tab DEC\tab HL\tab Wait until the first stop bit is
   1 \par 0BF0\tab WAIT-1\tab ADD\tab HL,DE\tab Make HL hold (BAUD).
   1 \par 0BEF\tab \tab PUSH\tab AF\tab Save the byte and carry flag.
   1 \par 0BEE\tab \tab SCF\tab \tab Signal 'acceptable codes' when exit.
   1 \par 0BED\tab \tab CPL\tab \tab Complement it (the bits are sent
   1 \par 0BEC\tab \tab LD\tab A,B\tab Fetch the received byte.
   1 \par 0BEA\tab \tab OUT\tab (+EF),A
   1 \par 0BE8\tab \tab LD\tab A,+EE\tab Make the CTS line having a low level.
   1 \par 0BE6\tab \tab JR\tab NC,0BD8,SERIAL-IN\tab Repeat until the 'marker' is found
   1 \par 0BE4\tab \tab RR\tab B\tab the B register.
   1 \par 0BE3\tab \tab RLCA\tab \tab Shift it into carry flag, then into
   1 \par 0BE1\tab \tab IN\tab A,(+F7)\tab Read a bit.
   1 \par 0BDF\tab \tab ADD\tab A,+00\tab Wait 7 T cycles.
   1 \par 0BDD\tab \tab JR\tab NZ,0BDA,BD-DELAY
   1 \par 0BDC\tab \tab OR\tab C
   1 \par 0BDB\tab \tab LD\tab A,H\tab length.
   1 \par 0BDA\tab BD-DELAY\tab DEC\tab HL\tab Insert a delay (26*BAUD) T cycles in
   1 \par 0BDA\tab BD-DELAY\tab 0BF0\tab WAIT-1\tab 0BF1\tab WAIT-2\tab 0BF9\tab T-FURTHER
   1 \par 0BD9\tab \tab NOP\tab \tab Wait 4 T cycles.
   1 \par 0BD8\tab SERIAL-IN\tab ADD\tab HL,DE\tab Add (BAUD) to HL.
   1 \par 0BD7\tab \tab DEC\tab HL\tab the time spent before.
   1 \par 0BD6\tab \tab DEC\tab HL\tab the loop by 78 T cycles, balancing
   1 \par 0BD5\tab \tab DEC\tab HL\tab Decrease HL three times, i.e. short
   1 \par 0BD3\tab \tab LD\tab B,+80\tab Set a marker into bit 7.
   1 \par 0BD2\tab \tab LD\tab L,C
   1 \par 0BD1\tab START-BIT\tab LD\tab H,B\tab Get (BAUD/2) into HL.
   1 \par 0BCF\tab \tab JR\tab 0BF0,WAIT-1\tab Jump forward to repeat the test.
   1 \par 0BCD\tab \tab OUT\tab (+EF),A
   1 \par 0BCB\tab \tab LD\tab A,+EE\tab Make the CTS line low again.
   1 \par 0BCA\tab \tab PUSH\tab AF\tab Save zero flag set.
   1 \par 0BC8\tab \tab JR\tab NZ,0BB1,READ-RS
   1 \par 0BC7\tab \tab OR\tab L\tab reaches zero.
   1 \par 0BC6\tab \tab LD\tab A,H\tab Repeat the test until the counter
   1 \par 0BC5\tab TST-AGAIN\tab DEC\tab HL\tab Decrease the counter.
   1 \par 0BC3\tab \tab JR\tab C,0BD1,START-BIT\tab Jump if the beginning of a 'start bit'
   1 \par 0BC2\tab \tab RLCA
   1 \par 0BC0\tab \tab IN\tab A,(+F7)
   1 \par 0BBE\tab \tab JR\tab NC,0BC5,TST-AGAIN
   1 \par 0BBD\tab \tab RLCA
   1 \par 0BBB\tab \tab IN\tab A,(+F7)
   1 \par 0BB9\tab \tab JR\tab NC,0BC5,TST-AGAIN\tab 77 T cycles,
   1 \par 0BB8\tab \tab RLCA\tab \tab sure that TXdata is still high after
   1 \par 0BB6\tab \tab IN\tab A,(+F7)\tab Repeat the test three times, i.e. make
   1 \par 0BB4\tab \tab JR\tab NC,0BC5,TST-AGAIN\tab Jump if the line has a low level.
   1 \par 0BB3\tab \tab RLCA\tab \tab Shift state into carry.
   1 \par 0BB1\tab READ-RS\tab IN\tab A,(+F7)\tab Read TXdata line.
   1 \par 0BB1\tab READ-RS\tab 0BC5\tab TST-AGAIN\tab 0BD1\tab START-BIT\tab 0BD8\tab SERIAL-IN
   1 \par 0BAF\tab \tab OUT\tab (+EF),A
   1 \par 0BAD\tab \tab LD\tab A,+FE\tab Make high the CTS line.
   1 \par 0BAB\tab \tab RR\tab C
   1 \par 0BA9\tab \tab SRL\tab B\tab Make BC hold (constant/2).
   1 \par 0BA8\tab \tab LD\tab C,E\tab register pair.
   1 \par 0BA7\tab \tab LD\tab B,D\tab Copy timing constant into the BC
   1 \par 0BA4\tab \tab LD\tab HL,+0320\tab Repeat '800' times the test.
   1 \par 0BA0\tab \tab LD\tab DE,(BAUD)\tab Fetch timing constant.
   1 \par 0B9E\tab \tab OUT\tab (+FE),A\tab Change border colour.
   1 \par 0B9B\tab \tab LD\tab A,(IOBORD)\tab Fetch new border colour.
   1 \par 0B9A\tab REC-PROC\tab DI\tab \tab Disable interrupts.
   1 \par 0B99\tab \tab RST\tab 28,ROMERR\tab program' error report.
   1 \par 0B95\tab \tab LD\tab (ERR-NR),+14\tab Otherwise give the 'Break into
   1 \par 0B93\tab \tab JR\tab C,0B9A,REC-PROC\tab Jump if SPACE not being pressed.
   1 \par 0B92\tab \tab RRCA\tab \tab Rotate bit 0 into carry.
   1 \par 0B90\tab \tab IN\tab A,(+FE)
   1 \par 0B8E\tab REC-BYTE\tab LD\tab A,+7F\tab Read port +7FFE.
   1 \par 0B8D\tab \tab RET
   1 \par 0B8C\tab \tab SCF\tab \tab Signal 'acceptable code'.
   1 \par 0B8B\tab \tab LD\tab A,(HL)
   1 \par 0B8A\tab \tab INC\tab  HL\tab the byte from SER-FL-hi.
   1 \par 0B88\tab \tab LD\tab  (HL),+00\tab Otherwise clear SER-FL-lo and fetch
   1 \par 0B86\tab \tab JR\tab  Z,0B8E,REC-BYTE\tab holds zero.
   1 \par 0B85\tab \tab AND\tab  A\tab Proceed in receiving the byte if it
   1 \par 0B84\tab \tab LD\tab  A,(HL)\tab variable.
   1 \par 0B81\tab BCHAN-IN\tab LD\tab  HL,+5CC7\tab Fetch contents of SER-FL-lo system
   1 \par 0B81 "B" channel input service routine
   1 \par 0B80\tab \tab RET\tab \tab Finished.
   1 \par 0B7E\tab \tab RES 7,A\tab Accept only codes in the range +00...
   1 \par 0B7B\tab TCHAN-IN\tab CALL 0B81,BCHAN-IN\tab Use the "B" channel input service
   1 \par 0B7B\tab TCHAN-IN\tab 0B81\tab BCHAN-IN\tab 0B8E\tab REC-BYTE\tab 0B9A\tab REC-PROC
   1 \par 0B7B "T" channel input service routine
   1 \par 0B78\tab \tab JP\tab 0CBD,CALL-INP\tab Jump forward.
   1 \par 0B75\tab B-INPUT\tab LD\tab HL,+0B81\tab Address of BCHAN-IN routine.
   1 \par 0B75 "B" channel input
   1 \par 0B72\tab \tab JP\tab 0CBD,CALL-INP\tab Jump forward.
   1 \par 0B6F\tab T-INPUT\tab LD\tab HL,+0B7B\tab Address of TCHAN-IN routine.
   1 \par 0B6F "T" channel input
   1 \par 0B6D\tab \tab DEFW\tab +000B\tab Length of this channel.
   1 \par 0B6B\tab \tab DEFW\tab +0B6F\tab Shadow ROM 'input' routine.
   1 \par 0B69\tab \tab DEFW\tab +0C3C\tab Shadow ROM 'output' routine.
   1 \par 0B68\tab \tab DEFB\tab +54\tab "T" (channel specifier).
   1 \par 0B66\tab \tab DEFW\tab +0008\tab Main ROM 'input' routine.
   1 \par 0B64\tab \tab DEFW\tab +0008\tab Main ROM 'output' routine.
   1 \par 0B64 "T" channel data
   1 \par 0B61\tab \tab JP\tab 05C1,END1\tab Finished.
   1 \par 0B60\tab \tab LD\tab (HL),D
   1 \par 0B5F\tab \tab INC\tab HL
   1 \par 0B5E\tab \tab LD\tab (HL),E\tab Store the displacement.
   1 \par 0B5D\tab \tab ADD\tab HL,BC\tab Index into the STRMS area.
   1 \par 0B5B\tab \tab LD\tab B,+00\tab pair.
   1 \par 0B5A\tab \tab LD\tab C,A\tab Move the offset to the BC register
   1 \par 0B59\tab \tab RLCA\tab \tab double it.
   1 \par 0B56\tab \tab LD\tab A,(S-STR1)\tab Fetch stream number and
   1 \par 0B53\tab \tab LD\tab HL,+5C16\tab Location in STRMS for stream 0.
   1 \par 0B52\tab \tab EX\tab DE,HL\tab Pass the displacement to DE.
   1 \par 0B50\tab \tab SBC\tab HL,DE
   1 \par 0B4F\tab \tab AND\tab A
   1 \par 0B4E\tab \tab EX \tab DE,HL
   1 \par 0B4D\tab \tab DEC\tab HL\tab stored in STRMS.
   1 \par 0B4A\tab OP-STREAM\tab LD \tab HL,(CHANS) \tab Calculate the displacement to be
   1 \par 0B47\tab OP-RSCHAN\tab CALL\tab 0Bl3,OP-RS-CH\tab Create the channel area.
   1 \par 0B47\tab OP-RSCHAN\tab 0B4A\tab OP-STREAM\tab 0B6F\tab T-INPUT\tab 0B75\tab B-INPUT
   1 \par 0B47 Attach channel to a stream
   1 \par 0B46\tab \tab RET\tab \tab Finished.
   1 \par 0B45\tab \tab POP\tab DE\tab Restore channel start address.
   1 \par 0B44\tab \tab LD\tab (HL),D\tab Store the high byte.
   1 \par 0B43\tab \tab INC\tab HL
   1 \par 0B42\tab \tab LD\tab (HL),E\tab Store the low byte.
   1 \par 0B3F\tab \tab LD\tab DE,+0B75\tab The address of the B\emdash INPUT routine,
   1 \par 0B3E\tab \tab INC\tab HL\tab Point to the 'shadow ROM input
   1 \par 0B3D\tab \tab LD\tab (HL),D\tab Store the high byte.
   1 \par 0B3C\tab \tab INC\tab HL
   1 \par 0B3B\tab \tab LD\tab (HL),E\tab Store the low byte.
   1 \par 0B38\tab \tab LD\tab DE,+0C5A\tab the address of the BCHAN\emdash OUT routine.
   1 \par 0B37\tab \tab ADD\tab HL,DE\tab routine' pointer.
   1 \par 0B34\tab \tab LD\tab HL,+0005\tab Point to the 'shadow ROM output
   1 \par 0B33\tab \tab PUSH\tab DE\tab Save channel start address.
   1 \par 0B32\tab \tab RET\tab NZ\tab not the 'B' channel.
   1 \par 0B30\tab \tab CP\tab +42\tab Return if the requested channel was
   1 \par 0B2D\tab \tab LD\tab A,(L-STR1)\tab Fetch channel specifier.
   1 \par 0B2C\tab \tab INC\tab DE\tab Point to the 1st location of the
   1 \par 0B2A\tab \tab LDDR\tab \tab Copy the 'T' channel data.
   1 \par 0B27\tab \tab LD\tab BC,+000B\tab Length of the table.
   1 \par 0B24\tab \tab LD\tab HL,+0B6E\tab Last byte in the "T" channel data
   1 \par 0B23\tab \tab POP\tab DE\tab Restore 'end of channel' address.
   1 \par 0B20\tab \tab CALL\tab 1691,REST-N-AD\tab Restore start address of 'filename' if
   1 \par 0B1F\tab \tab PUSH\tab DE\tab Save address of last byte in the
   1 \par 0B1E\tab \tab POP\tab BC\tab Restore 'length'.
   1 \par 0B1C\tab \tab DEFW\tab +1655\tab space.
   1 \par 0B1B\tab \tab RST\tab 10,CALBAS\tab Call MAKE-ROOM to create the required
   1 \par 0B1A\tab \tab PUSH\tab BC
   1 \par 0B17\tab \tab LD\tab BC,+000B\tab The channel is '11' bytes in length.
   1 \par 0B16\tab \tab DEC\tab HL\tab of the channel.
   1 \par 0B13\tab OP-RS-CH\tab LD\tab HL,(PROG)\tab The start address
   1 \par 0B13 Open RS232 channel in CHANS area
   1 \par 0B11\tab \tab DEFW\tab +0005\tab Constant.
   1 \par 0B0F\tab \tab DEFW\tab +4B00\tab Last baud rate=l9200.
   1 \par 0B0D\tab \tab DEFW\tab +000C\tab Constant.
   1 \par 0B0B\tab \tab DEFW\tab +2580\tab 8th baud rate=9600.
   1 \par 0B09\tab \tab DEFW\tab +001A\tab Constant.
   1 \par 0B07\tab \tab DEFW\tab +12C0\tab 7th baud rate=4800.
   1 \par 0B05\tab \tab DEFW\tab +0036\tab Constant.
   1 \par 0B03\tab \tab DEFW\tab +0960\tab 6th baud rate=2400.
   1 \par 0B01\tab \tab DEFW\tab +006E\tab Constant.
   1 \par 0AFF\tab \tab DEFW\tab +04B0\tab 5th baud rate=1200.
   1 \par 0AFD\tab \tab DEFW\tab +00DE\tab Constant.
   1 \par 0AFB\tab \tab DEFW\tab +0258\tab 4th baud rate=600.
   1 \par 0AF9\tab \tab DEFW\tab +01BE\tab Constant for 300 baud.
   1 \par 0AF7\tab \tab DEFW\tab +012C\tab 3rd baud rate=300.
   1 \par 0AF5\tab \tab DEFW\tab +04C5\tab Constant for 110 baud.
   1 \par 0AF3\tab \tab DEFW\tab +006E\tab 2nd baud rate=110.
   1 \par 0AF1\tab \tab DEFW\tab +0A82\tab is for 75 baud).
   1 \par 0AEF\tab \tab DEFW\tab +0032\tab First baud rate=50 (but the constant
   1 \par 0AEF RS232 timing constants
   1 \par 0AEC\tab \tab JP\tab 05C1,END1\tab Finished.
   1 \par 0AE8\tab \tab LD\tab (BAUD),DE\tab Store the constant.
   1 \par 0AE7\tab \tab LD\tab D,(HL)
   1 \par 0AE6\tab \tab INC\tab HL
   1 \par 0AE5\tab \tab LD\tab E,(HL)\tab Fetch the timing constant.
   1 \par 0AE4\tab END-SET\tab EX\tab DE,HL\tab Restore the pointer in HL.
   1 \par 0AE2\tab \tab JR\tab 0AD0,NXT-ENTRY
   1 \par 0AE1\tab \tab INC\tab HL\tab to examine the next table entry.
   1 \par 0AE0\tab \tab INC\tab HL\tab Skip the constant and jump back
   1 \par 0ADF\tab \tab EX\tab DE,HL\tab Restore the 'pointer' in HL.
   1 \par 0ADD\tab \tab JR\tab NC,0AE4,END-SET
   1 \par 0ADB\tab \tab SBC\tab HL,BC\tab than or equal to the supplied one.
   1 \par 0ADA\tab \tab AND\tab A\tab Jump also if this value is greater
   1 \par 0AD8\tab \tab JR\tab NC,0AE4,END-SET\tab reached.
   1 \par 0AD6\tab \tab CP\tab +48\tab Jump if the end of the table has been
   1 \par 0AD5\tab \tab LD\tab A,H\tab Fetch high byte.
   1 \par 0AD4\tab \tab EX\tab DE,HL\tab Pass the value to HL.
   1 \par 0AD3\tab \tab INC\tab HL
   1 \par 0AD2\tab \tab LD\tab D,(HL)
   1 \par 0AD1\tab \tab INC\tab HL\tab pair.
   1 \par 0AD0\tab NXT-ENTRY\tab LD\tab E,(HL)\tab Fetch an entry in the DE register
   1 \par 0ACD\tab \tab LD\tab HL,+0AEF\tab Start of RS232 timing constants table.
   1 \par 0AC9\tab SET-BAUD\tab LD\tab BC,(D-STR1)\tab Fetch baud rate.
   1 \par 0AC9\tab SET-BAUD\tab 0AD0\tab NXT-ENTRY\tab 0AE4\tab END-SET\tab 0813\tab OP-RS-CH
   1 \par 0AC9 Set "BAUD" system variable
   1 \par 0AC6\tab \tab DEFM\tab "run"\tab The 'run' filename.
   1 \par 0AC3\tab \tab JP\tab 08F2,TEST-TYPE\tab Jump back in the middle of the
   1 \par 0AC0\tab \tab CALL\tab 1580,F-M-HEAD\tab Load the 'new' 9-byte header.
   1 \par 0ABC\tab \tab SET\tab 7,(NSPPC)\tab the RUN command.
   1 \par 0ABA\tab \tab LDIR\tab \tab Clear the 'jump' signal set by using
   1 \par 0AB7\tab \tab LD\tab BC,+0009
   1 \par 0AB4\tab \tab LD\tab DE,+5CDE
   1 \par 0AB1\tab \tab LD\tab HL,+5CE6\tab Copy 'old' header into D-STR2 area.
   1 \par 0AAE\tab \tab CALL\tab 0753,PROG\tab Set HD variablea as required.
   1 \par 0AAA\tab \tab SET\tab 4,(FLAGS3)\tab Signal 'loading'.
   1 \par 0AA6\tab \tab LD\tab (N-STR1+2),BC\tab location.
   1 \par 0AA3\tab \tab LD\tab BC,+0AC6\tab The filename is stored from this
   1 \par 0A9F\tab \tab LD\tab (N-STR1),BC\tab characters in length.
   1 \par 0A9C\tab \tab LD\tab BC,+0003\tab The filename 'run' is three
   1 \par 0A98\tab \tab LD\tab (D-STR1),BC
   1 \par 0A95\tab LOAD-RUN\tab LD\tab BC,+0001\tab Load from drive 1.
   1 \par 0A95 Load "run" program
   1 \par 0A94\tab \tab RET \tab \tab Finished.
   1 \par 0A92\tab \tab JR\tab NZ,0A6A,LV-BN
   1 \par 0A91\tab \tab OR\tab D
   1 \par 0A90\tab \tab LD\tab A,E\tab Repeat until 'length' has reached 0.
   1 \par 0A8F\tab LVBN-END\tab INC\tab HL\tab Move 'start' on to address the next
   1 \par 0A8E\tab \tab DEFB\tab +15\tab routine.
   1 \par 0A8D\tab \tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 0A8B\tab \tab JR\tab Z,0A8F,LVBN-END\tab Continue only if the bytes are equal.
   1 \par 0A8A VR-BN\tab CP\tab (HL)\tab The actual VERIFY, i.e. compare the
   1 \par 0A88\tab \tab JR\tab 0A8F,LVBN-END\tab Jump forward.
   1 \par 0A87\tab \tab LD\tab (HL),A\tab The actual LOAD, i.e. store the
   1 \par 0A85\tab \tab JR\tab NZ,0A8A,VR-BN
   1 \par 0A81\tab \tab BIT\tab 7,(FLAGS3)\tab Jump when VERIFYING.
   1 \par 0A80\tab \tab POP\tab HL\tab Restore 'start'.
   1 \par 0A7F\tab \tab DEC\tab DE
   1 \par 0A7E\tab LV-BN-E\tab POP\tab DE\tab Restore 'length' and decrease it.
   1 \par 0A7E\tab LV-BN-E\tab 0A8A\tab VR-BN\tab 0A8F\tab LVBN-END\tab 0A95\tab LOAD-RUN
   1 \par 0A7C\tab \tab JR\tab NC,0A79,LV-B\tab input routine.
   1 \par 0A79\tab LV-B\tab CALL\tab 0B81,BCHAN-IN\tab Fetch a byte by using the "B" channel
   1 \par 0A77\tab \tab JR\tab 0A7E,LV-BN-E\tab Jump forward.
   1 \par 0A75\tab \tab JR\tab NC,0A72,LV-N\tab Input routine.
   1 \par 0A72\tab LV-N\tab CALL\tab 0D12,NCHAN-IN\tab Fetch a byte by using the "N" channel
   1 \par 0A70\tab \tab JR\tab Z,0A79,LV-B
   1 \par 0A6C\tab \tab BIT\tab 3,(FLAGS3)\tab Jump if RS232 link is being used.
   1 \par 0A6B\tab \tab PUSH\tab DE
   1 \par 0A6A\tab LV-BN\tab PUSH\tab HL\tab Save 'start' and 'length'.
   1 \par 0A69\tab \tab RET\tab \tab Finished.
   1 \par 0A66\tab \tab CALL\tab 15A9,LV-MCH\tab LOAD or VERIFY from Microdrive.
   1 \par 0A64\tab \tab JR\tab NZ,0A6A,LV-BN
   1 \par 0A62\tab \tab CP\tab +CD\tab handling with RS232 or network.
   1 \par 0A5F\tab \tab LD\tab A,(IX+4)\tab Fetch channel specifier and jump if
   1 \par 0A5E\tab \tab RET\tab Z
   1 \par 0A5D\tab \tab OR\tab E
   1 \par 0A5C\tab LV-ANY\tab LD\tab A,D\tab Return if 'length' is zero.
   1 \par 0A5C\tab LV-ANY\tab 0A6A\tab LV-BN\tab 0A72\tab LV-N\tab 0A79\tab LV-B
   1 \par 0A5C LOAD or VERIFY
   1 \par 0A5A\tab \tab JR\tab 0A0F,END-LD-PR\tab Jump back to LOAD the new program.
   1 \par 0A59\tab \tab INC\tab HL\tab Balance the DEC above.
   1 \par 0A56\tab \tab LD\tab (DATADD),HL\tab of the CHANS area.
   1 \par 0A55\tab \tab DEC\tab HL\tab Make DATADD point to the last byte
   1 \par 0A51\tab \tab LD\tab DE,(HD-0B)\tab Fetch program length.
   1 \par 0A4E\tab NO-AUTO\tab LD\tab HL,(PROG)\tab Fetch start address of program area.
   1 \par 0A4A\tab \tab LD\tab (NSPPC),+00\tab Clear NSPPC to signal 'jump'.
   1 \par 0A47\tab \tab LD\tab (NEWPPC),HL\tab Store autostart line no.
   1 \par 0A46\tab \tab LD\tab L,A\tab number.
   1 \par 0A43\tab \tab LD\tab A,(HD-11-lo)\tab Fetch low byte of autostart line
   1 \par 0A3F\tab \tab SET\tab 1,(FLAGS3)\tab Signal 'autostart' (see +0049).
   1 \par 0A3D\tab \tab JR\tab NZ,0A4E,NO-AUTO\tab Jump with 'no autostart'.
   1 \par 0A3B\tab \tab AND\tab +C0
   1 \par 0A3A\tab \tab LD\tab H,A\tab is required.
   1 \par 0A37\tab \tab LD\tab A,(HD-11-hi)\tab This is set to +FF when no autostart
   1 \par 0A34\tab \tab LD\tab (VARS),HL\tab variables area.
   1 \par 0A33\tab \tab ADD\tab HL,BC\tab Calculate and store the start of
   1 \par 0A2F\tab \tab LD\tab BC,(HD-0F)\tab Fetch program length.
   1 \par 0A2E\tab \tab INC\tab HL\tab Points to the first location.
   1 \par 0A2C\tab \tab DEFW\tab +1655\tab required space.
   1 \par 0A2B\tab \tab RST\tab 10,CALBAS\tab Call MAKE-ROOM to create the
   1 \par 0A28\tab \tab LD\tab HL,(PROG)\tab Fetch start address of program.
   1 \par 0A24\tab \tab LD\tab BC,(HD-0B)\tab Fetch length of program and variables.
   1 \par 0A22\tab \tab DEFW\tab +19E5\tab delete the program.
   1 \par 0A21\tab \tab RST\tab 10,CALBAS\tab Call RECLAIM-1 in the main ROM to
   1 \par 0A20\tab \tab DEC\tab HL
   1 \par 0A1D\tab \tab LD\tab HL,(E-LINE)\tab Fetch end of existing program.
   1 \par 0A19\tab \tab LD\tab DE,(PROG)\tab Fetch start of existing program.
   1 \par 0A15\tab SET-PROG\tab RES\tab 1,(FLAGS3)\tab Signal 'no autostart'
   1 \par 0A12\tab \tab JP\tab 0988,TST-MR-M\tab Jump back to close the channel.
   1 \par 0A0F\tab END-LD-PR\tab CALL\tab 0A5C,LV-ANY\tab Load array or BASIC program.
   1 \par 0A0E\tab \tab INC\tab HL\tab The array will be loaded from this
   1 \par 0A0D\tab \tab LD\tab (HL),D
   1 \par 0A0C\tab \tab INC\tab HL
   1 \par 0A0B\tab \tab LD\tab (HL),E\tab locations.
   1 \par 0A0A\tab \tab INC\tab HL\tab Store it into the following two
   1 \par 0A09\tab \tab POP\tab DE\tab Fetch 'array length'.
   1 \par 0A08\tab \tab LD\tab (HL),A\tab the 1st location.
   1 \par 0A07\tab \tab POP\tab AF\tab Restore array name and store into
   1 \par 0A06\tab \tab INC\tab HL\tab Points to the first 'new' location
   1 \par 0A04\tab \tab DEFW\tab +1655\tab for the array.
   1 \par 0A03\tab \tab RST\tab 10,CALBAS\tab Call MAKE-ROOM to create the space
   1 \par 0A02\tab \tab PUSH\tab AF\tab Save it briefly.
   1 \par 09FF\tab \tab LD\tab A,(5CE3)\tab Fetch array name from D-STR2 area.
   1 \par 09FE\tab \tab INC\tab BC\tab array
   1 \par 09FD\tab \tab INC\tab BC\tab array name and two for 'length of
   1 \par 09FC\tab \tab INC\tab BC\tab Include in the length one byte for
   1 \par 09FB\tab \tab PUSH\tab BC\tab Save it.
   1 \par 09F7\tab \tab LD\tab BC,(HD-0B)\tab Fetch the length of the array to be
   1 \par 09F6\tab \tab DEC\tab HL
   1 \par 09F3\tab CRT-NEW\tab LD\tab HL,(E-LINE)\tab Points to the end of variables area.
   1 \par 09F3\tab CRT-NEW\tab 0A0F\tab END-LD-PR\tab 0A15\tab SET-PROG\tab 0A4E\tab NO-AUTO
   1 \par 09F1\tab \tab DEFW\tab +19E8
   1 \par 09F0\tab \tab RST\tab 10,CALBAS\tab Call RECLAIM-2 to delete the array.
   1 \par 09EF\tab \tab INC\tab BC
   1 \par 09EE\tab \tab INC\tab BC\tab array length.
   1 \par 09ED\tab \tab INC\tab BC\tab Include 'length' and 'name' in the
   1 \par 09EC\tab \tab DEC\tab HL\tab Points to the array name.
   1 \par 09EB\tab \tab LD\tab C,(HL)\tab Fetch low byte.
   1 \par 09EA\tab \tab DEC\tab HL\tab Points to the low byte.
   1 \par 09E9\tab \tab LD\tab B,(HL)\tab Fetch high byte.
   1 \par 09E8\tab RCLM-OLD\tab DEC\tab HL\tab Points to the high byte of 'array
   1 \par 09E7\tab \tab ADD\tab HL,DE\tab '276' bytes up after the insertion
   1 \par 09E4\tab \tab LD\tab DE,+0114\tab Otherwise the array has been moved
   1 \par 09E2\tab \tab JR\tab Z,09E8,RCLM-OLD
   1 \par 09DE\tab T-LD-NET\tab BIT\tab 3,(FLAGS3)\tab Jump if using the 515232 link.
   1 \par 09DC\tab \tab JR\tab 09E8,RCLM-OLD
   1 \par 09D9\tab \tab LD\tab HL,(5CE4)\tab Otherwise the start address of the
   1 \par 09D7\tab \tab JR\tab NZ,09DE,T-LD-NET\tab (i.e. "M"+80H), the 'start' is
   1 \par 09D5\tab \tab CP\tab +CD\tab other than temporary "M" channels
   1 \par 09D2\tab \tab LD\tab A,(IX+4)\tab If the channel specifier denotes
   1 \par 09D0\tab \tab JR\tab Z,09F3,CRT-NEW\tab loading the 'new' one.
   1 \par 09CF\tab \tab OR\tab L\tab erased before
   1 \par 09CE\tab \tab LD\tab A,H\tab Jump unless an 'old' array is to be
   1 \par 09CC\tab \tab JR\tab Z,0A15,SET-PROG
   1 \par 09CB\tab \tab AND\tab A\tab BASIC program (+00).
   1 \par 09C8\tab \tab LD\tab A,(HD-00)\tab Jump if 'type' indicates a
   1 \par 09C7\tab TST-TYPE\tab POP\tab HL\tab Restore 'old' start (+0000 when
   1 \par 09C5\tab \tab DEFW\tab +1F05
   1 \par 09C4\tab \tab RST\tab 10,CALBAS\tab 'TEST-ROOM' subroutine.
   1 \par 09C3\tab \tab LD\tab C,L\tab to be loaded, with a call to main ROM
   1 \par 09C2\tab \tab LD\tab B,H\tab in memory for the program (or array)
   1 \par 09C1\tab \tab ADD\tab HL,DE\tab ensure that there is sufficient space
   1 \par 09BE\tab TST-SPACE\tab LD\tab DE,+0005\tab Otherwise a check must be made to
   1 \par 09BE\tab TST-SPACE\tab 09C7\tab TST-TYPE\tab 09DE\tab T-LD-NET\tab 09E8\tab RCLM-OLD
   1 \par 09BC\tab \tab JR\tab C,09C7,TST-TYPE\tab than the existing one.
   1 \par 09BA\tab \tab SBC\tab HL,DE\tab array) being loaded is no longer
   1 \par 09B9\tab \tab SCF\tab \tab Jump forward if the program (or
   1 \par 09B8\tab \tab EX\tab DE,HL\tab HL holds the 'new' length.
   1 \par 09B5\tab LD-PROG\tab LD\tab HL,(5CDF)\tab Fetch 'old' length (i.e. length of
   1 \par 09B4\tab \tab JR\tab 09BE,TST-SPACE\tab Jump forward.
   1 \par 09B2\tab \tab EX\tab DE,HL\tab Move 'length' into HL.
   1 \par 09B1\tab \tab INC\tab DE\tab two-byte length.
   1 \par 09B0\tab \tab INC\tab DE\tab for the insertion of array name and
   1 \par 09AF\tab \tab INC\tab DE\tab Increment 'length' by 3, i.e. allows
   1 \par 09AD\tab \tab JR\tab NZ,09B5,LD-PROG
   1 \par 09AC\tab \tab OR\tab L
   1 \par 09AB\tab \tab LD\tab A,H\tab Jump if not a 'new' array.
   1 \par 09AA\tab \tab PUSH\tab HL\tab Save it temporarily.
   1 \par 09A7\tab \tab LD\tab HL,(5CE1)\tab Fetch 'old' start (set to 0 when
   1 \par 09A3\tab LD-PR-AR\tab LD\tab DE,(HD-0B)\tab Fetch 'new' length.
   1 \par 09A0 MERGE-END\tab JP\tab 05C1,END1\tab Finished.
   1 \par 099D\tab \tab CALL\tab 17B9,RCL-T-CH\tab Reclaim the channel.
   1 \par 099A\tab \tab CALL\tab 0EF5,SEND-NEOF\tab Why?
   1 \par 0998\tab \tab JR\tab Z,09A0,MERGE-END\tab has been used.
   1 \par 0994\tab TST-MR-N\tab BIT\tab 3,(FLAGS3)\tab Exit immediately if the "B" output
   1 \par 0994\tab TST-MR-N\tab 09A0\tab MERGE-END\tab 09A3\tab LD-PR-AR\tab 09B5\tab LD-PROG
   1 \par 0992\tab \tab JR\tab 09A0,MERGE-END\tab Jump forward.
   1 \par 098F\tab \tab CALL\tab 12A9,CLOSE-M2\tab Close the "M" channel.
   1 \par 098D\tab \tab JR\tab NZ,0994,TST-MR-N\tab been used.
   1 \par 098B\tab \tab CP\tab +CD\tab i.e. if other than "M" channel has
   1 \par 0988\tab TST-MR-M\tab LD\tab A,(IX+4)\tab Jump if the specifier is not "M"+80
   1 \par 0986\tab \tab DEFW\tab +08CE\tab program by entering into the main
   1 \par 0985\tab \tab RST\tab 10,CALBAS\tab Do the mergeing with the existing
   1 \par 0984\tab \tab POP\tab HL\tab Restore 'start' pointer.
   1 \par 0981\tab \tab CALL\tab 0A5C,LV-ANY\tab Load the program in the workspace.
   1 \par 0980\tab \tab PUSH\tab HL\tab Save 'start' pointer.
   1 \par 097F\tab \tab POP\tab DE\tab Restore length of program.
   1 \par 097E\tab \tab EX\tab DE,HL\tab HL now points to the start of the
   1 \par 097C\tab \tab LD\tab (HL),+80\tab Mark the end of the space.
   1 \par 097A\tab \tab DEFW\tab +0030\tab required room in workspace.
   1 \par 0979\tab \tab RST\tab 10,CALBAS\tab Call BC-SPACES to make the
   1 \par 0978\tab \tab INC\tab BC\tab Allows for a further location to
   1 \par 0977\tab \tab PUSH\tab BC\tab merged and save it.
   1 \par 0973\tab NO-AUTOST\tab LD\tab BC,(HD-0B)\tab Fetch 'length' of program to be
   1 \par 0972\tab \tab DEFB\tab +14
   1 \par 0971\tab \tab RST\tab 20,SH-ERR\tab a 'MERGE error'.
   1 \par 096E\tab \tab CALL\tab 17B9,RCL-T-CH\tab Otherwise reclaim channels and give
   1 \par 096C\tab \tab JR\tab NZ,0973,NO-AUTOST\tab the program was not saved with
   1 \par 096A\tab \tab AND\tab +C0\tab HD-11 is sufficiently high, i.e. if
   1 \par 0967\tab MERGE-BLK\tab LD\tab A,(HD-11-hi)\tab Continue only if the content of
   1 \par 0965\tab \tab JR\tab 0988,TST-MR-M\tab Jump forward to close the channel
   1 \par 0962\tab LD-NO-PGM\tab CALL\tab 0A5C,LV-ANY\tab Do the actual LOADing or VERIFYing.
   1 \par 0962\tab LD-NO-PGM\tab 0967\tab MERGE-BLK\tab 0973\tab NO-AUTOST\tab 0988\tab TST-MR-M
   1 \par 095F\tab \tab LD\tab HL,(PROG)\tab But with 'program' type, the 'start'
   1 \par 095D\tab \tab JR\tab NZ,0962,LD~NO-PGM
   1 \par 095C\tab \tab AND\tab A\tab other than 'program'.
   1 \par 0959\tab LD-BLK-5\tab LD\tab A,(HD-00)\tab Use the 'start' in HL for types
   1 \par 0956\tab \tab LD\tab HL,(HD-0D)
   1 \par 0954\tab \tab JR\tab NZ,0959,LD-BLK-5\tab otherwise use 'new' start.
   1 \par 0953\tab \tab OR\tab L\tab specified in the command,
   1 \par 0952\tab LD-BLK-4\tab LD\tab A,H\tab Use 'old' start if it has been
   1 \par 0951\tab \tab ADD\tab HL,BC\tab up by '276' bytes after the
   1 \par 094E\tab \tab LD\tab BC,+01l4\tab Otherwise the data has been moved
   1 \par 094C\tab \tab JR\tab Z,0952,LD-BLK-4
   1 \par 094A\tab \tab CP\tab +03
   1 \par 0947\tab \tab LD\tab A,(HD-00)\tab Jump if it is a block of bytes.
   1 \par 0945\tab \tab JR\tab Z,0952,LD-BLK-4
   1 \par 0941\tab LD-BLK-3\tab BIT\tab 3,(FLAGS3)\tab Jump if not using the network.
   1 \par 093F\tab \tab JR\tab 0952,LD-BLK4\tab Jump forward.
   1 \par 093C\tab \tab LD\tab HL,(5CE4)\tab But if the "M" channel is being
   1 \par 093A\tab \tab JR\tab NZ,0941,LD-BLK1\tab temporary "M" channel.
   1 \par 0938\tab \tab CP\tab +CD\tab Jump if not "M"+80, i.e. not a
   1 \par 0935\tab \tab LD\tab A,(IX+4)\tab Fetch specifier from the channel area.
   1 \par 0932\tab LD-BLK-2\tab LD\tab HL,(5CE1)\tab Get 'old' start from D-STR2.
   1 \par 0932\tab LD-BLK-2\tab 0941\tab LD-BLK-3\tab 0952\tab LD-BLK-4\tab 0959\tab LD-BLK-5
   1 \par 0931\tab \tab DEFB\tab +15\tab routine.
   1 \par 0930\tab NREPORT-L\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 092F\tab \tab DEFB\tab +13\tab routine.
   1 \par 092E\tab \tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 092C\tab \tab JR\tab Z,0930,NREPORT-L\tab to LOAD or VERIFY a larger block
   1 \par 0928\tab \tab BIT\tab 4,(FLAGS3)\tab But give an error if attempting
   1 \par 0926\tab \tab JR\tab NC,0932,LD-BLK-2\tab greater than or equal to the
   1 \par 0924\tab \tab SBC\tab HL,DE\tab Accept the 'old' length if it is
   1 \par 0922\tab \tab JR\tab Z,0932,LD-BLK-2
   1 \par 0921\tab \tab OR\tab L\tab (i.e. not specified in the command).
   1 \par 0920\tab \tab LD\tab A,H\tab Jump forward if 'old' length is 0
   1 \par 091C\tab \tab LD\tab DE,(HD-0B)\tab Get 'new' length.
   1 \par 0919\tab LD-BLOCK\tab LD\tab HL,(+5CDF)\tab Get 'old' length from D-STR2.
   1 \par 0918\tab \tab DEFB\tab +14\tab routine.
   1 \par 0917\tab \tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 0915\tab \tab JR\tab Z,0919,LD-BLOCK\tab verifying, but not for the mergeing
   1 \par 0911\tab T-M-CODE\tab BIT\tab 6,(FLAGS3)\tab Allow for the loading or
   1 \par 090E\tab \tab JP\tab Z,09A3,LD-PR-AR\tab doing a LOAD).
   1 \par 090A\tab \tab BIT\tab 7,(FLAGS3)\tab Jump if not doing a VERIFY (i.e.
   1 \par 0908\tab \tab JR\tab NZ,0967,MERGE-BLK
   1 \par 0904\tab TST-MERGE\tab BIT\tab 6,(FLAGS3)\tab Jump if doing a MERGE.
   1 \par 0904\tab TST-MERGE\tab 0911\tab T-M-CODE\tab 0919\tab LD-BLOCK\tab 0930\tab NREPORT-L
   1 \par 0903\tab \tab DEFB\tab +16\tab routine.
   1 \par 0902\tab NREPORT-N\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 0900\tab \tab JR\tab C,0904,TST-MERGE\tab Jump with other types (but refuse
   1 \par 08FE\tab \tab JR\tab Z,0911,T-H-CODE
   1 \par 08FC\tab \tab CP\tab +03\tab Jump if handling a block of bytes.
   1 \par 08FA\tab \tab JR\tab NZ,0902,NREPORT-N\tab Give an error if it does not match.
   1 \par 08F9\tab \tab CP\tab B\tab Compare with the 'old' one.
   1 \par 08F6\tab \tab LD\tab A,(HD-00)\tab Fetch 'new' file type.
   1 \par 08F5\tab \tab LD\tab B,A\tab area and store into B register.
   1 \par 08F2\tab TEST-TYPE\tab LD\tab A,(5CDE)\tab Fetch 'old' type from D-STR2
   1 \par 08F0\tab \tab DJNZ\tab 08D8,LD-HEADER\tab Go around the loop again.
   1 \par 08EF\tab \tab INC\tab HL\tab Advance the pointer.
   1 \par 08EE\tab \tab LD\tab (HL),A\tab Store the byte into the HO area.
   1 \par 08ED\tab \tab POP\tab HL
   1 \par 08EC\tab LD-HDR-2\tab POP\tab BC\tab Restore registers.
   1 \par 08EA\tab \tab JR\tab NC,08E7,LD-HD-RS\tab Repeat until the byte is acceptable.
   1 \par 08E7\tab LD-HD-RS\tab CALL\tab 0B81,BCHAN-IN\tab Fetch a byte from RS232 link.
   1 \par 08E7\tab LD-HD-RS\tab 08EC\tab LD-HDR-2\tab 08F2\tab TEST-TYPE\tab 0902\tab NREPORT-H
   1 \par 08E5\tab \tab JR\tab 08EC,LD-HDR-2\tab Jump forward.
   1 \par 08E3\tab \tab JR\tab NC,08E0,LD-HD-NET\tab Repeat until the byte is acceptable.
   1 \par 08E0\tab LD-HD-NET\tab CALL\tab 0D12,NCHAN-IN\tab Fetch a byte from "N" channel.
   1 \par 08DD\tab \tab JR\tab Z,08E7,LD-HD-RS
   1 \par 08DA\tab \tab BIT\tab 3,(FLAGS3)\tab Jump if using RS232 link.
   1 \par 08D9\tab \tab PUSH\tab BC
   1 \par 08D8\tab LD-HEADER\tab PUSH\tab HL\tab Save HL and BC register pairs.
   1 \par 08D6\tab \tab LD\tab B,+09\tab Nine bytes are now expected.
   1 \par 08D3\tab TS-L-RS\tab LD\tab HL,+5CE6\tab Start of HD area.
   1 \par 08D0\tab \tab CALL\tab 0EA9,OP-TEMP-N\tab Open a temporary "N" channel.
   1 \par 08CD\tab TS-L-NET\tab CALL\tab 068F,TEST-STAT\tab Check station number.
   1 \par 08CD\tab TS-L-NET\tab 08D3\tab TS-L-RS\tab 08D8\tab LD-HEADER\tab 08E0\tab LD-HD-NET
   1 \par 08CB\tab \tab JR\tab 08F2,TEST-TYPE\tab Jump forward.
   1 \par 08C8\tab \tab CALL\tab 1580,F-M-HEAD\tab Fetch first nine bytes from cartridge
   1 \par 08C5\tab \tab CALL\tab 0685,TEST-MNAM\tab Check "M" parameters.
   1 \par 08C3\tab \tab JR\tab Z,08D3,TS-L-RS
   1 \par 08C1\tab \tab CP\tab +42\tab Jump if RS232 link is being used.
   1 \par 08BF\tab \tab JR\tab Z,08CD,TS-L-NET
   1 \par 08BD\tab \tab CP\tab +4E\tab Jump if network is being used.
   1 \par 08BA\tab \tab LD\tab A,(L-STR1)\tab Fetch channel specifier.
   1 \par 08B8\tab \tab LDIR\tab \tab Copy the 'old' header into the D-STR2
   1 \par 08B5\tab \tab LD\tab BC,+0007\tab There are '7' bytes to be copied
   1 \par 08B2\tab \tab LD\tab DE,+5CDE\tab Start of D-STR2 area.
   1 \par 08AF\tab LD-VF-MR\tab LD\tab HL,+5CE6\tab Start of HD area.
   1 \par 08AF LOAD-VERIFY-MERGE commands routine
   1 \par 08AC\tab \tab CALL\tab 0701,EXPT-PRMS\tab Check syntax and set variables.
   1 \par 08A8\tab MRG-SYN\tab SET\tab 6,(FLAGS3)\tab Signal 'doing a MERGE command'.
   1 \par 08A8 MERGE command syntax routine
   1 \par 08A5\tab \tab JP\tab O8AF,LD-VF-MR\tab Do the VERIFY.
   1 \par 08A2\tab \tab CALL\tab 0701,EXPT-PRMS\tab Check syntax and set variables.
   1 \par 089E VERIFY command syntax routine
   1 \par 089E VERIF-SYN\tab SET\tab 7,(FLAGS3)\tab Signal 'doing a VERIFY command'.
   1 \par 089B\tab \tab JP\tab 08AF,LD-VF-MR\tab Do the LOAD.
   1 \par 0898\tab \tab CALL \tab 0701,EXPT-PRMS\tab Check syntax and set variables.
   1 \par 0894\tab LOAD-SYN\tab SET\tab 4,(FLAGS3)\tab Signal 'doing a LOAD command'.
   1 \par 0894\tab LOAD-SYN\tab 089E\tab VERIF-SYN\tab 08A8\tab MRG-SYN\tab 08AF\tab LD-VF-MR
   1 \par 0894 LOAD command syntax routine
   1 \par 0893\tab \tab RET
   1 \par 0892\tab \tab POP\tab HL
   1 \par 0891\tab SA-B-END\tab POP\tab BC\tab Restore registers and return.
   1 \par 088E\tab SA-NET\tab CALL\tab 0D6C,NCHAN-OUT\tab Use "N" channel output routine to
   1 \par 088C\tab \tab JR\tab 0891,SA-B-END\tab Exit.
   1 \par 0889\tab \tab CALL\tab 0C5A,BCHAN-OUT\tab Otherwise send the byte through the
   1 \par 0887\tab \tab JR\tab NZ,088E,SA-NET\tab Jump if network is being used.
   1 \par 0886\tab \tab LD\tab A,(HL)\tab Fetch the byte to be saved.
   1 \par 0882\tab \tab BIT\tab 3,(FLAGS3)\tab Test 'networking' bit.
   1 \par 0881\tab \tab PUSH\tab BC
   1 \par 0880\tab SA-BYTE\tab PUSH\tab HL\tab Save HL and BC register pairs.
   1 \par 0880 Save a byte to network or RS232 link
   1 \par 087D\tab S-BLK-END\tab JP\tab 0988,TST-MR-M\tab Jump forward to send the 'end of
   1 \par 087D\tab S-BLK-END\tab 0880\tab SA-BYTE\tab 088E\tab SA-NET\tab 0891\tab SA-B-END
   1 \par 087B\tab \tab JR\tab 0872,SA-BLK-LP\tab Jump back until the whole block has
   1 \par 087A\tab \tab INC\tab HL\tab Point to next byte.
   1 \par 0879\tab \tab DEC\tab BC\tab Decrement 'length'.
   1 \par 0876\tab \tab CALL\tab 0880,SA-BYTE\tab Send the byte pointed by HL.
   1 \par 0874\tab \tab JR\tab Z,087D,S-BLK-END
   1 \par 0873\tab \tab OR\tab B\tab reached zero.
   1 \par 0872\tab SA-BLK-LP\tab LD\tab A,C\tab Jump forward when the counter has
   1 \par 086E\tab SABLOCK\tab LD\tab BC,(HD-0B)\tab Fetch the 'length' of the block.
   1 \par 086D\tab \tab ADD\tab HL,DE\tab been moved up by '276' bytes after
   1 \par 086A\tab \tab LD\tab DE,+0014\tab Otherwise the data to be saved have
   1 \par 0868\tab \tab JR\tab NC,086E,SA-BLOCK
   1 \par 0866\tab \tab CP\tab +03\tab (i.e. SAVE..CODE).
   1 \par 0863\tab \tab LD\tab A,(HD-00)\tab Jump also if saving a block of memory
   1 \par 0861\tab \tab JR\tab Z,086E,SA-BLOCK
   1 \par 085D\tab \tab BIT\tab 3,(FLAGS3)\tab Jump if "B" channel is being used.
   1 \par 085A\tab \tab LD\tab HL,(HD-0D)\tab Fetch 'start of data block'.
   1 \par 0858\tab \tab DJNZ\tab 0854,HD-LOOP
   1 \par 0857\tab \tab INC\tab HL\tab Each header byte in turn is saved.
   1 \par 0854\tab HD-LOOP\tab CALL\tab 0880,SA-BYTE\tab Save the byte pointed by HL.
   1 \par 0851\tab \tab LD\tab HL,+5CE6\tab Start of HD variables.
   1 \par 084F\tab SA-HEADER\tab LD\tab B,+09\tab Nine bytes are to be saved.
   1 \par 084F\tab SA-HEADER\tab 0854\tab HD-LOOP\tab 086E\tab SA-BLOCK\tab 0872\tab SA-BLK-LP
   1 \par 0849\tab SAVE-M\tab CALL\tab 0685,TEST-MNAM\tab Check "M" parameters.
   1 \par 0847\tab \tab JR\tab 084F,SA-HEADER\tab Jump forward.
   1 \par 0844\tab \tab CALL\tab 0EA9,OP-TEMP-N\tab Open a temporary "N" channel.
   1 \par 0841\tab \tab CALL\tab 068F,TEST-STAT\tab Check station number.
   1 \par 083F\tab \tab JR\tab NZ,0849,SAVE-M\tab being used (i.e. with "M" channel).
   1 \par 083D\tab \tab CP\tab +4E\tab Jump with other than "N" channel
   1 \par 083B\tab \tab JR\tab Z,084F,SA-HEADER
   1 \par 0839\tab \tab CP\tab +42\tab Jump with "B" channel being used.
   1 \par 0836\tab \tab LD\tab A,(L-STR1)\tab Fetch channel specifier.
   1 \par 0833\tab \tab CALL\tab 0701,EXPT-PRMS\tab Check syntax and set variables.
   1 \par 082F\tab SAVE-SYN\tab SET\tab 5,(FLAGS3)\tab Signal "Saving".
   1 \par 082F SAVE command syntax routine
   1 \par 082E\tab \tab RET\tab \tab Finished.
   1 \par 082A\tab \tab LD\tab (HD-0D),DE\tab Store "start" of the array.
   1 \par 0827\tab \tab CALL\tab 05B7,ST-END\tab Confirm end of statement and exit
   1 \par 0825\tab \tab DEFW\tab +0020
   1 \par 0824\tab \tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 0822\tab \tab JR\tab NZ,07F4,NONS-BSC\tab Report an error if not.
   1 \par 0820\tab \tab CP\tab +29\tab Check that the ')' dDEs exist.
   1 \par 081E\tab \tab DEFW\tab +0020
   1 \par 081D\tab \tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 081C\tab END-DATA\tab EX\tab DE,HL\tab DE holds the 'start' of the array
   1 \par 0819\tab NUM-ARR\tab LD\tab (HD-00),A\tab Store file type.
   1 \par 0819\tab NUM-ARR\tab 081C\tab END-DATA\tab 082F\tab SAVE-SYN\tab 0849\tab SAVE-M
   1 \par 0818\tab \tab INC\tab A\tab Otherwise A=2 to signal
   1 \par 0816\tab \tab JR\tab Z,0819,NUM-ARR
   1 \par 0814\tab \tab BIT\tab 6,C\tab Jump if really a numeric array.
   1 \par 0812\tab \tab LD\tab A,+01\tab Signal 'numeric array'.
   1 \par 080F\tab \tab LD\tab (HD-0F-lo),A
   1 \par 080E\tab LD-DATA\tab LD\tab A,C\tab Store array name into HD-0F.
   1 \par 080D\tab \tab INC\tab HL\tab Advance to the start of the
   1 \par 080A\tab \tab LD\tab (HD-0B-hi),A\tab Store it.
   1 \par 0809\tab \tab LD\tab A,(HL)\tab Fetch high byte.
   1 \par 0808\tab \tab INC\tab HL\tab Point to high byte of 'length'.
   1 \par 0805\tab \tab LD\tab (HD-0B-lo),A\tab Store it.
   1 \par 0804\tab \tab LD\tab A,(HL)\tab Fetch low byte.
   1 \par 0803\tab VR-DATA\tab INC\tab HL\tab Point to the 'length' of the array.
   1 \par 0801\tab \tab JR\tab Z,07F4,NONS-BSC\tab a simple string.
   1 \par 07FF\tab \tab BIT\tab 7,(HL)\tab Give an error if trying to SAVE
   1 \par 07FD\tab \tab JR\tab Z,0803,VR-DATA\tab command.
   1 \par 07F9\tab \tab BIT\tab 5,(FLAGS3)\tab Jump forward if not during a SAVE
   1 \par 07F7\tab \tab JR\tab Z,081C,END-DATA\tab being checked.
   1 \par 07F6\tab G-TYPE\tab RST\tab 18,CHKSYNTAX\tab Jump forward if syntax is
   1 \par 07F5\tab \tab DEFB\tab +00
   1 \par 07F4\tab NONS-BSC\tab RST\tab 20,SH-ERR\tab 'Nonsense in BASIC'
   1 \par 07F4\tab NONS-BSC\tab 07F6\tab G-TYPE\tab 0803\tab VR-DATA\tab 080E\tab LD-DATA
   1 \par 07F2\tab EXISTING\tab JR\tab Z,07F6,G-TYPE\tab Continue only when handling a numeric
   1 \par 07F1\tab \tab RST\tab 28,ROMERR\tab found' if trying to SAVE a
   1 \par 07ED\tab \tab LD\tab (ERR-NR),+01\tab Give the error report 'Variable not
   1 \par 07EB\tab \tab JR\tab NZ,080E,LD-DATA
   1 \par 07E7\tab \tab BIT\tab 4,(FLAGS3)\tab Jump forward if LOADing the array.
   1 \par 07E4\tab \tab LD\tab HL,+0000\tab Signal 'using a new array'.
   1 \par 07E2\tab \tab JR\tab NC,07F2,EXISTING\tab Jump if handling an existing array.
   1 \par 07E0\tab \tab SET\tab 7,C\tab Set bit 7 of array name.
   1 \par 07DE\tab \tab DEFW\tab +28B2\tab array name.
   1 \par 07DD\tab \tab RST\tab 10,CALBAS\tab Call LOOK-VARS to look for the
   1 \par 07DB\tab \tab DEFW\tab +0020\tab the array name.
   1 \par 07DA\tab NO-M-ARR\tab RST\tab 10,CALBAS\tab Advance CH-ADD to point to
   1 \par 07D9\tab \tab DEFB\tab +14\tab routine.
   1 \par 07D8\tab \tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 07D6\tab \tab JR\tab Z,07DA,NO-M-ARR\tab an array.
   1 \par 07D2\tab DATA\tab BIT\tab 6,(FLAGS3)\tab Jump unless attempting to MERGE
   1 \par 07D1\tab \tab RET\tab \tab Finished.
   1 \par 07CE\tab \tab LD\tab (HD-00),A
   1 \par 07CC\tab \tab LD\tab A,+03\tab Signal 'bytes' file type.
   1 \par 07C8\tab \tab LD\tab (HD-0D),BC
   1 \par 07C6\tab \tab DEFW\tab +1E99\tab stack and store it.
   1 \par 07C5\tab \tab RST\tab 10,CALBAS\tab Fetch the "start" from the calculator
   1 \par 07C1\tab \tab LD\tab (HD-0B),BC\tab store it.
   1 \par 07BF\tab \tab DEFW\tab +1E99\tab calculator stack and
   1 \par 07BE\tab \tab RST\tab 10,CALBAS\tab Fetch the "length" from the
   1 \par 07BB\tab \tab CALL\tab 05B7,ST-END\tab Confirm end of statement and exit if
   1 \par 07B9\tab \tab DEFW\tab +0018\tab character in the statement.
   1 \par 07B8\tab END-CODE\tab RST\tab 10,CALBAS\tab Call GET-CHAR to fetch the 'last'
   1 \par 07B8\tab END-CODE\tab 07D2\tab DATA\tab 07DA\tab NO-M-ARR\tab 07F2\tab EXISTING
   1 \par 07B6\tab \tab DEFW\tab +1CB2\tab EXPT-1NUM.
   1 \par 07B5\tab \tab RST\tab 10,CALBAS\tab Evaluate the 2nd parameter by calling
   1 \par 07B3\tab \tab DEFW\tab +0020
   1 \par 07B2\tab PAR-2\tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 07B0\tab \tab JR\tab 07B8,END-CODE\tab Jump forward.
   1 \par 07AE\tab \tab DEFW\tab +1CE6
   1 \par 07AD\tab \tab RST\tab 10,CALBAS\tab Use zero also for the 2nd parameter,
   1 \par 07AB\tab \tab JR\tab NZ,073C,OREP-l-2\tab missed in a SAVE name CODE command.
   1 \par 07A7\tab TEST-SAVE\tab BIT\tab 5,(FLAGS3)\tab Give an error if a parameter has been
   1 \par 07A5\tab \tab JR\tab Z,0782,PAR-2
   1 \par 07A2\tab \tab CALL\tab 0581,SEPARATOR\tab Jump if a separator is present.
   1 \par 07A0\tab \tab DEFW\tab +1C82\tab specified value.
   1 \par 079F\tab PAR-1\tab RST\tab 10,CALBAS\tab Otherwise call EXPT-1NUM to use the
   1 \par 079D\tab \tab JR\tab 07A7,TEST-SAVE\tab Jump forward.
   1 \par 079B\tab \tab DEFW\tab +1CE6\tab is made to use a value of zero as
   1 \par 079A\tab DEFLT-0\tab RST\tab 10,CALBAS\tab A call to main ROM routine 'USE-ZERO'
   1 \par 079A\tab DEFLT-0\tab 079F\tab PAR-1\tab 07A7\tab TEST-SAVE\tab 07B2\tab PAR-2
   1 \par 0798\tab \tab JR\tab NZ,OREP-1-2\tab encountered by itself
   1 \par 0794\tab \tab BIT\tab 5,(FLAGS3)\tab Give an error if SAVE "name"CODE is
   1 \par 0792\tab \tab JR\tab NZ,PAR-1\tab evaluated (i.e. the next character
   1 \par 0790\tab \tab CP\tab +3A\tab Jump it there are parameters to be
   1 \par 078E\tab \tab JR\tab Z,079A,DEFLT-0\tab jump to use '0' as default value.
   1 \par 078C\tab \tab CP\tab +0D\tab If there ate no further parameters,
   1 \par 078A\tab \tab DEFW\tab +0020
   1 \par 0789\tab CODE\tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 0788\tab \tab RET\tab \tab Finished.
   1 \par 0785\tab \tab LD\tab (HD-00),A
   1 \par 0783\tab \tab LD\tab A,+03\tab Signal 'bytes' file type.
   1 \par 0780\tab \tab LD\tab (HD-0D),HL\tab file.
   1 \par 077D\tab \tab LD\tab HL,+4000\tab The start address of the display
   1 \par 077A\tab \tab LD\tab (HD-0B),HL\tab and attributes is stored.
   1 \par 0777\tab \tab LD\tab HL,+1B00\tab The 'length' of the display file
   1 \par 0774\tab \tab CALL\tab 05B7,ST-END\tab Confirm end of statement and exit
   1 \par 0772\tab \tab DEFW\tab +0020
   1 \par 0771\tab SCREEN$\tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 0770\tab \tab RET\tab \tab Finished.
   1 \par 076D\tab \tab LD\tab (HD-0F),HL\tab Store it into HD-0F.
   1 \par 076B\tab \tab SBC\tab HL,DE\tab i.e. the length of the program only.
   1 \par 0768\tab \tab LD\tab HL,(VARS)\tab Now calculate (VARS)-(PROG),
   1 \par 0765\tab \tab LD\tab (HD-0B),HL\tab The 'length' is stored.
   1 \par 0763\tab \tab SBC\tab HL,DE\tab ((E-LINE)-(PROG))-1, i.e. the length
   1 \par 0762\tab \tab SCF\tab \tab This calculates
   1 \par 075E\tab \tab LD\tab (HD-0D),DE\tab from PROG, and stored into HD-0D.
   1 \par 075A\tab \tab LD\tab DE,(PROG)\tab The 'start' of data is fetched
   1 \par 0757\tab \tab LD\tab HL,(E-LINE)\tab Address past the last location of
   1 \par 0754\tab \tab LD\tab (HD-00),A\tab 'program' file type).
   1 \par 0753\tab PROG\tab XOR\tab A\tab Store 0 into HD-00 (signalling
   1 \par 0750\tab END-EXPT\tab CALL\tab 05B7,ST-END\tab Confirm end of statement and exit
   1 \par 0750\tab END-EXPT\tab 0753\tab PROC\tab 0771\tab SCREEN$\tab 0789\tab CODE
   1 \par 074E\tab \tab JR\tab 0753,PROG\tab Jump forward.
   1 \par 074A\tab \tab LD\tab (HD-11),BC\tab Store autostart line number.
   1 \par 0748\tab \tab DEFW\tab +1E99\tab the calculator stack.
   1 \par 0747\tab \tab RST\tab 10,CALBAS\tab Fetch the autostart line number from
   1 \par 0744\tab \tab CALL\tab 05B7,ST-END\tab Confirm end of statement, and exit
   1 \par 0742\tab \tab DEFW\tab +1C82\tab autostart line number.
   1 \par 0741\tab \tab RST\tab 10,CALBAS\tab Call EXPT-1NUM to evaluate the
   1 \par 073F\tab \tab DEFW\tab +0020
   1 \par 073E\tab LINE\tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 073D\tab \tab DEFB\tab +00\tab routine.
   1 \par 073C\tab OREP-1-2\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 0739\tab \tab JP\tab Z,07D2,DATA\tab an error report.
   1 \par 0737\tab \tab CP\tab +E4\tab Jump with DATA, otherwise give
   1 \par 0735\tab \tab JR\tab Z,973E,LINE
   1 \par 0733\tab \tab CP\tab +CA\tab Jump with LINE.
   1 \par 0731\tab \tab JR\tab Z,0789,CODE
   1 \par 072F\tab \tab CP\tab +AF\tab Jump with CODE.
   1 \par 072D\tab \tab JR\tab Z,0771,SCREEN$\tab SCREEN$.
   1 \par 072B\tab \tab CP\tab +AA\tab Jump if the statement continues with
   1 \par 0729\tab \tab JR\tab Z,0750,END-EXPT
   1 \par 0727\tab \tab CP\tab +3A\tab with a colon.
   1 \par 0725\tab \tab JR\tab Z,0750,END-EXPT\tab ENTER, or
   1 \par 0723\tab \tab CP\tab +0D\tab Jump if the statement ends with
   1 \par 0722\tab NOT-NET\tab POP\tab AF\tab Restore 'next character'.
   1 \par 071E\tab \tab SET\tab 3,(FLAGS3)\tab otherwise signal "networking".
   1 \par 071C\tab \tab JR\tab NZ,0122,NOT-NET
   1 \par 071A\tab \tab CP\tab +4E\tab Jump if the channel is not "N",
   1 \par 0717\tab \tab LD\tab A,(L-STR1)\tab Fetch channel specifier.
   1 \par 0716\tab NO-NAME\tab PUSH\tab AF\tab The next character is saved.
   1 \par 0716\tab NO-NAME\tab 0722\tab NOT-NET\tab 073C\tab OREP-1-2\tab 073E\tab LINE
   1 \par 0713\tab \tab CALL\tab 062F,EXPT-NAME\tab Evaluate "filename".
   1 \par 0711\tab \tab JR\tab NZ,0716,NO-NAME\tab Jump if no name is to be expected.
   1 \par 070E\tab \tab CALL\tab 05B1,SEPARATOR\tab Check that the separator dDEs exist.
   1 \par 070B\tab \tab CALL\tab 05F5,EXP-SPEC2\tab Evaluate "x";n.
   1 \par 0709\tab \tab DEFW\tab +0020
   1 \par 0708\tab \tab RST\tab 10,CALBAS\tab Advance CH-ADD past the '*'.
   1 \par 0706\tab \tab JR\tab NZ,073C,OREP-1-2\tab Give an error if not a '*'.
   1 \par 0704\tab \tab CP\tab +2A\tab It must be a '*'.
   1 \par 0702\tab \tab DEFW\tab +0020\tab the line.
   1 \par 0701\tab EXPT-PRMS\tab RST\tab 10,CALBAS\tab The next character is fetched from
   1 \par 0701 Evaluate parameters
   1 \par 0700\tab UNPAGE\tab RET\tab \tab RETurn to 'main' ROM.
   1 \par 0700 UNPAGE
   1 \par 06DF...06FF\tab Unused locations (all set to .FF).
   1 \par 06DC\tab \tab JP\tab 0685,TEST-MNAM\tab Otherwise check "m" parameters.
   1 \par 06D9\tab \tab JP\tab Z,068F,TEST-STAT
   1 \par 06D7\tab \tab CP\tab +4E\tab But check station no. if it is "N".
   1 \par 06D6\tab \tab RET\tab Z
   1 \par 06D4\tab \tab CP\tab +42\tab Return if it is "B".
   1 \par 06D3\tab \tab RET\tab Z
   1 \par 06D1\tab \tab CP\tab +54\tab Return if It is "T".
   1 \par 06CE\tab \tab LD\tab A,(LSTR-1)\tab Fetch channel specifier.
   1 \par 06CD\tab \tab RET\tab Z
   1 \par 06CC\tab ENDHERE\tab RST\tab 18,CHKSYNTAX\tab Return if syntax is being checked.
   1 \par 06C9\tab \tab CALL\tab 062F,EXPT-NAME\tab Otherwise deal with "filename".
   1 \par 06C7\tab \tab JR\tab NZ,06CC,ENDHERE\tab separator.
   1 \par 06C4\tab \tab CALL\tab 05B1,SEPARATOR\tab Jump if there is no further
   1 \par 06C1\tab \tab CALL\tab 05F5,EXP-SPEC2\tab otherwise evaluate "x";n.
   1 \par 06BE\tab \tab JP\tab Z,064E,EXPT-STRM\tab Evaluate stream number if so,
   1 \par 06BC\tab \tab CP\tab +23\tab Is the present code an hash sign?
   1 \par 06BA\tab \tab DEFW\tab +0020
   1 \par 06B9\tab EXPT-EXP1\tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 06B9 Evaluate stream or expression
   1 \par 06B8\tab \tab DEFB\tab +09\tab routine.
   1 \par 06B7\tab \tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 06B6\tab \tab RET\tab NZ
   1 \par 06B5\tab \tab OR \tab H
   1 \par 06B4\tab \tab LD \tab A,L
   1 \par 06B3\tab \tab INC\tab HL\tab Accept any value except +FFFF.
   1 \par 06B0\tab TEST-BAUD\tab LD\tab HL,(D-STR1)\tab Fetch baud rate.
   1 \par 06B0 Check baud rate
   1 \par 06AF\tab \tab RET\tab \tab Finished.
   1 \par 06AC\tab \tab CALL\tab 062F,EXPT-NAME\tab Evaluate the filename.
   1 \par 06A9\tab \tab JP\tab NZ,04B2,OREPORT-1
   1 \par 06A6\tab \tab CALL\tab 05B1,SEPARATOR\tab A separator must be present.
   1 \par 06A3\tab EXPT-EXPR\tab CALL\tab 05F2,EXPT-SPEC\tab Evaluate channel specifier and drive
   1 \par 06A3 Evaluate "x";n;"name"
   1 \par 06A2\tab \tab DEFB\tab +07\tab routine.
   1 \par 06A1\tab NREPORT-8\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 06A0\tab \tab DEFB\tab +05\tab routine.
   1 \par 069F\tab \tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 069E\tab \tab RET\tab NC
   1 \par 069C\tab \tab SBC\tab HL,DE\tab greater than 64 decimal.
   1 \par 0699\tab \tab LD\tab HL,+0040\tab Return only if the value is no
   1 \par 0698\tab \tab DEC\tab DE\tab Balance the 'INC' above.
   1 \par 0696\tab \tab JR\tab Z,06A1,NREPORT-8\tab evaluated, so give an error
   1 \par 0695\tab \tab OR\tab D\tab No station number has been
   1 \par 0694\tab \tab LD\tab A,E
   1 \par 0693\tab \tab INC\tab DE\tab Test against +FFFF.
   1 \par 068F\tab TEST-STAT\tab LD\tab DE,(D-STR1)\tab Fetch station number.
   1 \par 068F Check station number
   1 \par 068E\tab \tab DEFB\tab +06\tab routine.
   1 \par 068D\tab \tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 068C\tab \tab RET\tab Z\tab Return if so.
   1 \par 068B\tab \tab AND\tab A\tab Is it 0?
   1 \par 0688\tab \tab LD \tab A,(N-STR1-hi) \tab Fetch high byte of name length.
   1 \par 0685\tab TEST-MNAM\tab CALL\tab 0665,CHECK-M\tab Check "m" parameters.
   1 \par 0685 Check "m" parameters and filename
   1 \par 0684\tab \tab DEFB\tab +08\tab routine.
   1 \par 0683\tab NREPORT-9\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 0682\tab \tab DEFB\tab +04\tab routine.
   1 \par 0681\tab NREPORT-5\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 0680\tab \tab RET\tab NC\tab Return if in range.
   1 \par 067E\tab \tab SBC\tab HL,DE
   1 \par 067B\tab \tab LD\tab HL,+0008\tab Is drive number within range 1..8?
   1 \par 067A\tab \tab DEC\tab DE\tab Balance the 'INC' above.
   1 \par 0678\tab \tab JR\tab Z,0683,NREPORT-9
   1 \par 0677\tab \tab OR\tab D\tab has been evaluated.
   1 \par 0676\tab \tab LD\tab A,E\tab Report an error if no drive number
   1 \par 0675\tab \tab INC\tab DE\tab Test against +FFFF.
   1 \par 0673\tab \tab JR\tab Z,0681,NREPORT-5
   1 \par 0672\tab \tab OR\tab D
   1 \par 0671\tab \tab LD\tab A,E\tab Report an error if zero.
   1 \par 066D\tab CHECK-M-2\tab LD\tab DE,(D-STR1)\tab Fetch drive number.
   1 \par 066D\tab CHECK-M-2\tab 0681\tab NREPORT-5\tab 0683\tab NREPORT-9\tab 0685\tab TEST-MNAM
   1 \par 066A\tab \tab JP\tab NZ,062D,NREPORT-3\tab Report the error if it is not.
   1 \par 0668\tab \tab CP\tab +4D\tab Is it "M"?
   1 \par 0665\tab CHECK-M\tab LD\tab A,(L-STR1)\tab Fetch channel specifier.
   1 \par 0665 Check "m" parameters
   1 \par 0664\tab \tab DEFB\tab +01\tab routine.
   1 \par 0663\tab NREPORT-2\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 0662\tab \tab RET\tab \tab Finished.
   1 \par 0661\tab \tab POP\tab AF\tab Restore A and zero flag.
   1 \par 065E\tab \tab LD\tab (S-STR1),A\tab Store stream number.
   1 \par 065C\tab \tab JR\tab NC,0663,NREPORT-2
   1 \par 065A\tab \tab CP\tab +10\tab Test for numbers greater than 15.
   1 \par 0658\tab \tab DEFW\tab +1E99
   1 \par 0657\tab \tab RST\tab 10,CALBAS\tab Call FIND-INT1 to fetch the value.
   1 \par 0656\tab \tab PUSH\tab AF\tab Save 'next character' and zero flag.
   1 \par 0655\tab \tab RET\tab Z
   1 \par 0654\tab \tab RST\tab 18,CHKSYNTAX\tab Return if syntax is being checked.
   1 \par 0652\tab \tab DEFW\tab +1C82\tab expression.
   1 \par 0651\tab \tab RST\tab 10,CALBAS\tab Call EXPT-1NUM to evaluate a numeric
   1 \par 064F\tab \tab DEFW\tab +0020
   1 \par 064E\tab EXPT-STRM\tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 064E Evaluate stream number
   1 \par 064D\tab \tab DEFB\tab +03\tab routine.
   1 \par 064C\tab NREPORT-4\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 064C\tab NREPORT-4\tab 064E\tab EXPT-STRM\tab 0663\tab NREPORT-2\tab 0665\tab CHECK-H
   1 \par 064B\tab \tab RET\tab \tab Finished.
   1 \par 064A\tab \tab POP\tab AF\tab Restore A and zero flag.
   1 \par 0646\tab \tab LD\tab (N-STR1+2),DE\tab Store the 'start'.
   1 \par 0642\tab \tab LD\tab (N-STR1),BC\tab Store the 'length'.
   1 \par 0640\tab \tab JR\tab C,064C,NREPORT-4
   1 \par 063E\tab \tab SBC\tab HL,BC\tab exceeds ten characters.
   1 \par 063B\tab \tab LD\tab HL,+000A\tab Give the error also if 'length'
   1 \par 0639\tab \tab JR\tab Z,064C,NREPORT-4
   1 \par 0638\tab \tab OR\tab B
   1 \par 0637\tab \tab LD\tab A,C\tab Give an error with null string.
   1 \par 0636\tab \tab PUSH\tab AF\tab Save zero flag and 'next character'.
   1 \par 0635\tab \tab RET\tab Z\tab Return if syntax is being checked.
   1 \par 0632\tab \tab CALL\tab 05E7,EXPT-STR\tab Evaluate the string.
   1 \par 0630\tab \tab DEFW\tab +0020
   1 \par 062F\tab EXPT-NAME\tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 062F Evaluate filename
   1 \par 062E\tab \tab DEFB\tab +02\tab routine.
   1 \par 062D\tab NREPORT-3\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 062C\tab \tab RET\tab \tab Finished.
   1 \par 062B\tab \tab POP\tab AF\tab Restore character and zero flag.
   1 \par 0627\tab \tab LD\tab (D-STR1),BC\tab Store the value.
   1 \par 0625\tab \tab DEFW\tab +1E99\tab value from calculator stack.
   1 \par 0624\tab \tab RST\tab 10,CALBAS\tab Call FIND-INT2 to fetch the
   1 \par 0623\tab \tab PUSH\tab AF\tab Save character following the
   1 \par 0622\tab \tab RET\tab Z
   1 \par 0621\tab \tab RST\tab 18,CHKSYNTAX\tab Return if syntax is being checked.
   1 \par 061F\tab \tab DEFW\tab +1C82\tab evaluate the expression.
   1 \par 061E\tab EXPT-NUM\tab RST\tab 10,CALBAS\tab Call EXPT-NUM in the main ROM to
   1 \par 061E Evaluate numeric expression
   1 \par 061C\tab \tab DEFW\tab +0020\tab no.,station no., baud rate) is
   1 \par 061B\tab \tab RST\tab 10,CALBAS\tab A numeric expression (i.e. drive
   1 \par 0618\tab \tab JP\tab NZ,04B2,OREPORT-1\tab Give an error if not found.
   1 \par 0615\tab \tab CALL\tab 05B1,SEPARATOR\tab Otherwise a separator must be found.
   1 \par 0614\tab \tab RET\tab NC
   1 \par 0612\tab \tab CP\tab +A5 \tab Return also with a keyword.
   1 \par 0611\tab \tab RET\tab Z
   1 \par 060F\tab \tab CP\tab +3A
   1 \par 060E\tab \tab RET\tab Z
   1 \par 060C\tab TEST-NEXT\tab CP\tab +0D \tab Return if it is ENTER, or a colon,
   1 \par 060C\tab TEST-NEXT\tab 061E\tab EXPT-NUM\tab 062D\tab NREPORT-3\tab 062F\tab EXPT-NAME
   1 \par 060B\tab \tab POP\tab AF\tab The 'next character' is restored.
   1 \par 0608\tab \tab LD  \tab (L-STR1),A  \tab Store the channel specifier.
   1 \par 0606\tab \tab AND\tab +DF \tab Make the letter upper case.
   1 \par 0604\tab \tab JR  \tab NC,062D,NREPORT-3\tab Jump if it is not a valid letter
   1 \par 0602\tab \tab DEFW\tab +2C8D\tab valid letter.
   1 \par 0601\tab \tab RST\tab 10,CALBAS \tab Call 'ALPHA' to see whethe nt isi
   1 \par 0600\tab \tab LD  \tab A,(DE)  \tab Fetch the channel specifier.
   1 \par 05FE\tab \tab JR  \tab NZ,062D,NREPORT-3\tab string is null).
   1 \par 05FD\tab \tab OR  \tab B  \tab character in the string (also if the
   1 \par 05FC\tab \tab DEC \tab A \tab Jump if there is more than one
   1 \par 05FB\tab \tab LD\tab A,C\tab 'A' holds the low byte of the
   1 \par 05FA\tab \tab PUSH AF\tab Save the character following the
   1 \par 05F8\tab \tab JR\tab Z,060C,TEST-NEXT\tab Jump if syntax is being checked.
   1 \par 05F5\tab EXP-SPEC2\tab CALL 95E7,EXPT-STR\tab Evaluate string expression.
   1 \par 05F3\tab \tab DEFW +0020
   1 \par 05F2\tab EXPT-SPEC\tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 05F2 Evaluate channel expression
   1 \par 05F1\tab \tab RET\tab \tab Finished.
   1 \par 05F0\tab \tab POP\tab AF\tab Zero flag reset to signal 'runtime'
   1 \par 05EE\tab \tab DEFW\tab +2BF1\tab fetch the parameters.
   1 \par 05ED\tab \tab RST\tab 10,CALBAS\tab Call 'STK-FETCH' in the main ROM to
   1 \par 05EC\tab \tab PUSH AF\tab Save the zero flag and the character
   1 \par 05EB\tab \tab RET\tab Z
   1 \par 05EA\tab \tab RST\tab 18,CHKSYNTAX\tab Return if syntax is being checked
   1 \par 05E8\tab \tab DEFW\tab +1C8C
   1 \par 05E7\tab EXPT-STR\tab RST\tab 10,CALBAS\tab Call 'EXPT-EXP' in the main ROM.
   1 \par 05E7 Evaluate string expression
   1 \par 05E6\tab \tab RST\tab 28,ROMERR\tab the error handling routine.
   1 \par 05E2\tab BREAK-PGM\tab LD\tab (ERR-NR),+14\tab Store the error code and call
   1 \par 05E2\tab BREAK-PGM\tab 05E7\tab EXPT-STR\tab 05F2\tab EXPT-SPEC\tab 05F5\tab EXP-SPEC2
   1 \par 05E1\tab \tab RST\tab 0,MAIN-ROM\tab Return to the main ROM interpreter.
   1 \par 05E0\tab RETAD-SYN\tab PUSH\tab HL\tab Save the return address.
   1 \par 05DD\tab RETAD-RUN\tab LD\tab HL,+1B7D\tab Return address during runtime is
   1 \par 05DB\tab \tab JR\tab NC,05E2,BREAK-PGM
   1 \par 05DA\tab \tab RRA
   1 \par 05D8\tab \tab IN\tab A,(+FE)
   1 \par 05D6\tab \tab LD\tab A,+FE
   1 \par 05D4\tab \tab JR\tab C,05DD,RETAD-RUN
   1 \par 05D3\tab \tab RRA
   1 \par 05D1\tab \tab IN\tab A,(+FE)\tab during runtime.
   1 \par 05Cl Return to the main interpreter
   1 \par 05CF\tab \tab LD\tab A,+7F\tab Give, an error if BREAK is pressed
   1 \par 05CD\tab \tab JR\tab Z,05E0,RETAD-RUN-SYN
   1 \par 05CC\tab \tab RST\tab 18,CHKSYNTAX\tab STMT-NEXT if syntax being checked.
   1 \par 05C9\tab \tab LD\tab HL,+1BF4\tab Return address to main ROM is
   1 \par 05C5\tab \tab LD\tab (ERR-NR),+FF\tab Clear error code.
   1 \par 05C1\tab END1\tab LD\tab SP,(ERR-SP)\tab Clear machine stack.
   1 \par 05C0\tab \tab RET NZ\tab otherwise continue below.
   1 \par 05BF\tab TEST-RET\tab RST\tab 18,CHKSYNTAX\tab Return only during runtime,
   1 \par 05BF\tab TEST-RET\tab 05C1\tab END1\tab 05DD\tab RETAD-RUN\tab 05E0\tab RETAD-SYN
   1 \par 05BD\tab \tab JR\tab NZ,0584,NONSENSE\tab a colon (i.e. the statement is not
   1 \par 05BB\tab \tab CP\tab +3A\tab Give an error if character is not
   1 \par 05B9\tab \tab JR\tab Z,05BF,TEST-RET\tab with ENTER.
   1 \par 05B7\tab ST-END\tab CP\tab +0D\tab Jump if the statement ends
   1 \par 05B7 End of statement
   1 \par 05B6\tab \tab RET\tab \tab Return with zero flag set if so.
   1 \par 05B4\tab \tab CP \tab +3B \tab Is the character a semicolon?
   1 \par 05B3\tab \tab RET\tab Z\tab Return with zero flag set if so.
   1 \par 05B1\tab SEPARATOR\tab CP \tab +2C \tab Is the character a comma?
   1 \par 05B1 SEPARATOR
   1 \par 05B0\tab \tab RET\tab \tab Finished.
   1 \par 05AE\tab \tab DJNZ\tab 05A7,ALL-BYTES\tab Continue until the areas have
   1 \par 05AD\tab \tab INC\tab DE
   1 \par 05AC\tab \tab INC\tab HL\tab Advance the pointers.
   1 \par 05AB\tab \tab LD\tab (DE),A\tab Store it into D-STRZ.
   1 \par 05AA\tab \tab LD\tab A,C\tab Byte from D-STR1.
   1 \par 05A9\tab \tab LD\tab (HL),A\tab Store into D-STR1 the byte coming
   1 \par 05A8\tab \tab LD\tab C,(HL)\tab Fetch a byte from D-STR1.
   1 \par 05A7\tab ALL-BYTES\tab LD\tab A,(DE)\tab Fetch a byte from D-STR2.
   1 \par 05A5\tab \tab LD\tab B,+08\tab Both areas are 8 bytes in length.
   1 \par 05A2\tab \tab LD\tab DE,+5CDE\tab Start of 2nd area.
   1 \par 059F\tab EX-D-STR\tab LD\tab HL,+5CD6\tab Start of first area.
   1 \par 059F\tab EX-D-STR\tab 05A7\tab ALL-BYTES\tab 05B1\tab SEPARATOR\tab 05B7\tab ST-END
   1 \par 059F Exchange file specifiers
   1 \par 059C\tab \tab JP\tab 05C1,END1\tab Finished.
   1 \par 059A\tab \tab JR\tab C,058E,ALL-STRMS\tab have been closed.
   1 \par 0598\tab \tab CP\tab +10\tab Continue until all streams 0..15
   1 \par 0597\tab \tab INC\tab A\tab Each stream in turn is examined.
   1 \par 0596\tab \tab POP\tab AF\tab Restore stream number.
   1 \par 0593\tab \tab CALL\tab 1718,CLOSE\tab Close the current stream.
   1 \par 058F\tab \tab SET\tab 1,(FLAGS3)\tab Signal 'CLEAR# command'.
   1 \par 058E\tab ALL-STRMS\tab PUSH\tab AF\tab Save stream number.
   1 \par 058D\tab \tab XOR\tab A\tab Start with stream 0.
   1 \par 058A\tab \tab CALL\tab 05B7,ST-END\tab Confirm end of statement and exit
   1 \par 0588\tab \tab DEFW\tab +0020
   1 \par 0587\tab \tab RST\tab 10,CALBAS\tab Advance CH-ADD again.
   1 \par 0584\tab NONSENSE\tab JP\tab NZ,04B2,OREPORT-1
   1 \par 0582\tab \tab CP\tab +23\tab The character must be a '#'.
   1 \par 0580\tab \tab DEFW\tab +0020
   1 \par 057F\tab CLR#-SYN\tab RST\tab 10,CALBAS\tab Advance CH-ADD.
   1 \par 057F CLEAR# command routine
   1 \par 057C\tab \tab JP\tab 05Cl,END1\tab Finished.
   1 \par 057A\tab \tab DEFW\tab +0D6B
   1 \par 0579\tab \tab RST\tab 10,CALBAS\tab Call main ROM 'CLS' routine.
   1 \par 0577\tab \tab OUT\tab (+FE),A
   1 \par 0575\tab \tab LD\tab A,+07\tab Set white border.
   1 \par 0572\tab \tab LD\tab (P-FLAG),H\tab Clear P-FLAG.
   1 \par 056F\tab \tab LD\tab (BORDCR),L\tab Store +38 also for lower screen
   1 \par 056C\tab \tab LD\tab (ATTR-T),HL\tab Store +38 into ATTR-T, clear MASK-T.
   1 \par 0569\tab \tab LD\tab (ATTR-P),HL\tab Store +38 into ATTR-P, clear MASK-P.
   1 \par 0566\tab \tab LD\tab HL,+0038\tab +38 is the attribute byte.
   1 \par 0563\tab \tab CALL\tab 05B7,ST-END\tab Confirm end of statement and exii
   1 \par 0561\tab \tab DEFW\tab +0020
   1 \par 0560\tab \tab RST\tab 10,CALBAS\tab Advance CH-ADD again.
   1 \par 055E\tab \tab JR\tab NZ,0584,NONSENSE
   1 \par 055C\tab \tab CP\tab +23\tab The character must be a '#'.
   1 \par 055A\tab \tab DEFW\tab +0020\tab keyword CLS.
   1 \par 0559\tab CLS#-SYN\tab RST\tab 10,CALBAS\tab Advance CH-ADD after the
   1 \par 0559\tab CLS#-SYN\tab 057F\tab CLR#-SYN\tab 0584\tab NONSENSE\tab 058E\tab ALL-STRMS
   1 \par 0559 CLS# command routine
   1 \par 0556\tab \tab JP\tab 1E6B,MOVE-RUN\tab Do the MOVE command,
   1 \par 0553\tab \tab CALL\tab 05B7,ST-END\tab Confirm end of statement and exit
   1 \par 0551\tab \tab DEFW\tab +0018
   1 \par 0550\tab \tab RST\tab 10,CALBAS\tab Call GET-CHAR in the main ROM.
   1 \par 054D\tab \tab CALL\tab 059F,EX-D-STR\tab Exchange again D-STR areas.
   1 \par 054A\tab \tab CALL\tab 06B9,EXPT-EXP1\tab Evaluate 2nd stream number, or
   1 \par 0548\tab \tab JR\tab NZ,0584,NONSENSE\tab between the two expressions.
   1 \par 0546\tab \tab CP\tab +CC\tab The keyword 'TO' must be present
   1 \par 0544\tab \tab DEFW\tab +0018
   1 \par 0543\tab \tab RST\tab 10,CALBAS\tab Call GET-CHAR in the main ROM.
   1 \par 0540\tab \tab CALL\tab 059F,EX-D-STR\tab Exchange D-STR1 and D-STR2 contents.
   1 \par 053D\tab MOVE-SYN\tab CALL\tab 06B9,EXPT-EXP1\tab Evaluate stream number, or channel
   1 \par 053D MOVE command syntax routine
   1 \par 053A\tab \tab JP\tab 1E66,ERASE-RUN\tab Do the ERASE command.
   1 \par 0537\tab \tab CALL\tab 0685,TEST-MNAM\tab Check that all parameters are
   1 \par 0534\tab \tab CALL\tab 05B7,ST-END  \tab Confirm end of statement and exit
   1 \par 0531\tab ERASE-SYN\tab CALL\tab 06A3,EXPT-EXPR\tab Evaluate ("m";n;"name")
   1 \par 0531 ERASE command syntax routine
   1 \par 0530\tab \tab DEFB\tab +0B\tab routine.
   1 \par 052F\tab NREPORT-C\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 052C\tab \tab JP\tab 1E7A,OP-RUN\tab Do the OPEN "M" command.
   1 \par 0529\tab OP-M-C\tab CALL\tab 0685,TEST-MNAM\tab Check that all parameters are valid.
   1 \par 0529\tab OP-M-C\tab 052F\tab NREPORT-C\tab 0531\tab ERASE-SYN\tab 053D\tab MOVE-SYN
   1 \par 0526\tab \tab JP\tab 0EA3,OPEN-N-ST\tab Do the OPEN referred to the network.
   1 \par 0523\tab \tab CALL\tab 068F,TEST-STAT\tab Check that D-STR1 holds a valid
   1 \par 0521\tab \tab JR\tab NZ,0520,OP-M-C\tab with 'm' channel).
   1 \par 051F\tab NOT-OP-B\tab CP\tab +4E\tab Jump if not a 'n' channel (i.e.
   1 \par 051C\tab OPEN-RS\tab JP\tab 0B47,OP-RSCHAN\tab Do the OPEN referred to RS232 link.
   1 \par 051A\tab \tab JR\tab NZ,051F,NOT-OP-B
   1 \par 0518\tab \tab CP\tab +42\tab Jump if not a 'b' channel.
   1 \par 0516\tab \tab JR\tab Z,051C,OPEN-RS
   1 \par 0514\tab \tab CP\tab +54\tab Jump if opening a 't' channel.
   1 \par 0511\tab \tab LD\tab A,(L-STR1)\tab Fetch channel specifier.
   1 \par 050F\tab \tab JR\tab C,052F,NREPORT-C
   1 \par 050D\tab \tab SBC\tab HL,BC\tab channel.
   1 \par 050C\tab \tab AND\tab A\tab is already opened with a 'new'
   1 \par 0509\tab \tab LD\tab HL,+0011\tab In fact, jump if the current stream
   1 \par 0507\tab \tab DEFW\tab +1727\tab on exit, BC holds 'stream data'.
   1 \par 0506\tab \tab RST\tab 10,CALBAS\tab Call main ROM 'STR-DATA1' routine;
   1 \par 0503\tab \tab LD\tab A,(S-STR1)\tab Fetch stream number.
   1 \par 0500\tab NOT-OP-M\tab CALL\tab 05B7,ST-END\tab Confirm end of statement and exit
   1 \par 04FD\tab \tab CALL\tab 062F,EXPT-NAME\tab Otherwise evaluate "name".
   1 \par 04FB\tab \tab JR\tab NZ,0500,NOT-OP-M\tab present.
   1 \par 04F8\tab \tab CALL\tab 05B1,SEPARATOR\tab Jump if no further separator is
   1 \par 04F5\tab \tab CALL\tab 05F2,EXPT-SPEC\tab Evaluate channel specifier,
   1 \par 04F3\tab \tab JR\tab NZ,04B2,OREPORT-1\tab has been missed after 'stream no.'
   1 \par 04F0\tab \tab CALL\tab 05B1,SEPARATOR\tab Give an error report if the separator
   1 \par 04ED\tab OPEN-SYN\tab CALL\tab 064E,EXPT-STRM\tab Evaluate stream number.
   1 \par 04ED\tab OPEN-SYN\tab 0500\tab NOT-OP-M\tab 051C\tab OPEN-RS\tab 051F\tab NOT-OP-B
   1 \par 04ED OPEN command syntax routine
   1 \par 04EA\tab \tab JP\tab 1E75,FOR-RUN\tab Do the FORMAT "M" command.
   1 \par 04E7\tab FOR-M\tab CALL\tab 0685,TEST-MNAM\tab Check that the various parameters
   1 \par 04E4\tab \tab JP\tab 05C1,END1\tab Finished.
   1 \par 04E1\tab \tab LD\tab (NTSTAT),A\tab This is the actual FORMAT command
   1 \par 04DE\tab \tab JP\tab Z,069F,NREPORT-6\tab 'broadcast' specifier).
   1 \par 04DD\tab \tab AND\tab A\tab FORMAT "n"';0 (i.e. with the
   1 \par 04DA\tab \tab LD\tab A,(D-STR1)\tab Give an error if attempting to
   1 \par 04D7\tab \tab CALL\tab 068F,TEST-STAT\tab Check that D-STR1 holds a valid
   1 \par 04D5\tab \tab JR\tab NZ,04E7,FOR-M
   1 \par 04D3\tab NOT-FOR-B\tab CP\tab +4E\tab Jump if not a FORMAT "N" command.
   1 \par 04D0\tab \tab JP\tab 0AC9,SET-BAUD\tab Set BAUD variable from D-STR1 value
   1 \par 04CD\tab FOR-B-T\tab CALL\tab 06B0,TEST-BAUD\tab Check that D-STR1 holds a valid baud
   1 \par 04CB\tab \tab JR\tab NZ,04D3,NOT-FOR-B\tab Jump with "N" and "M" channels.
   1 \par 04C9\tab \tab CP\tab +42\tab Test for FORMAT "B" - note that the
   1 \par 04C7\tab \tab JR\tab Z,04CD,FOR-B-T
   1 \par 04C5\tab \tab CP\tab +54\tab Jump with FORMAT "T"
   1 \par 04C2\tab \tab LD\tab A,(L-STR1)\tab Fetch channel specifier.
   1 \par 04BF\tab NO-FOR-M\tab CALL\tab 05B7,ST-END\tab Confirm end of statement and exit
   1 \par 04BF\tab NO-FOR-M\tab 04CD\tab FOR-B-T\tab 04D3\tab NOT-FOR-B\tab 04E7\tab FOR-M
   1 \par 04BA\tab \tab JR\tab NZ,04BF,NO-FOR-M\tab separator, no filename is to be
   1 \par 04B7\tab \tab CALL\tab 05Bl,SEPARATOR\tab If there is not a further
   1 \par 04B4\tab FRMT-SYN\tab CALL\tab 05F2,EXPT-SPEC\tab Evaluate (string)(separator)(number)
   1 \par 04B4 FORMAT command syntax routine
   1 \par 04B3\tab \tab DEFB\tab +00\tab routine.
   1 \par 04B2\tab OREPORT-1\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 04AF\tab \tab JP\tab 1E70,CAT-RUN\tab Do the CATalogue.
   1 \par 04AC\tab \tab CALL 066D,CHECK-M-2\tab Checks that drive number held in
   1 \par 04A9\tab \tab CALL\tab 05B7,ST-END\tab Confirm end of statement and exit
   1 \par 04A6\tab CAT-SCRN\tab CALL\tab 061E,EXPT-NUM\tab Evaluate drive number.
   1 \par 04A4\tab \tab DEFW\tab +0020\tab character.
   1 \par 04A3\tab \tab RST\tab 10,CALBAS\tab Advance CH-ADD to next
   1 \par 04A1\tab \tab JR\tab NZ,04B2,OREPORT-1\tab number there is no separator.
   1 \par 049E\tab \tab CALL\tab 05B1,SEPARATOR\tab Give an error if after the stream
   1 \par 049B\tab \tab CALL\tab 064E,EXPT-STRM\tab Otherwise evaluate stream number.
   1 \par 0499\tab \tab JR\tab NZ,04A6,CAT-SCRN\tab there is not the 'hash' character.
   1 \par 0497\tab \tab CP\tab +23\tab Jump if after the keyword
   1 \par 0494\tab MISSING-D\tab JP\tab Z,0683,NREPORT-9\tab statement ends with a colon.
   1 \par 0494\tab MISSING-D\tab 04A6\tab CAT-SCRN\tab 04B2\tab OREPORT-1\tab 04B4\tab FRTM-SYN
   1 \par 0492\tab \tab CP\tab +3A\tab Give an error also if the
   1 \par 0490\tab \tab JR\tab Z,0494,MISSING-D\tab produce an error.
   1 \par 048E\tab \tab CP\tab +0D\tab If the line ends here, jump to
   1 \par 048C\tab \tab DEFW\tab +0020\tab 'NEXT-CHAR' in the main ROM.
   1 \par 048B\tab \tab RST\tab 10,CALBAS\tab Advance CH-ADD with a call to
   1 \par 0489\tab \tab LD\tab (HL),+02\tab 'current' stream.
   1 \par 0486\tab CAT-SYN\tab LD\tab HL,S-STR1\tab First make the screen
   1 \par 0486 CAT command syntax routine
   1 \par 0485\tab \tab DEFB\tab +18
   1 \par 0476\tab \tab DEFM\tab "Wrong file type"
   1 \par 0475\tab \tab DEFB\tab +17
   1 \par 045E\tab \tab DEFM\tab "Verification has failed"
   1 \par 045D\tab \tab DEFB\tab +16
   1 \par 0452\tab \tab DEFM\tab "MERGE error"
   1 \par 0451\tab \tab DEFB\tab +15
   1 \par 0447\tab \tab DEFM\tab "CODE error"
   1 \par 0446\tab \tab DEFB\tab +14
   1 \par 0437\tab \tab DEFM\tab "Hook code error"
   1 \par 0436\tab \tab DEFB\tab +13
   1 \par 0428\tab \tab DEFM\tab "File not found"
   1 \par 0427\tab \tab DEFB\tab +12
   1 \par 0411\tab \tab DEFM\tab "Microdrive not present"
   1 \par 0410\tab \tab DEFB\tab +11
   1 \par 0401\tab \tab DEFM\tab "Microdrive full"
   1 \par 0400\tab \tab DEFB\tab +10
   1 \par 03E9\tab \tab DEFM\tab "Drive 'write' protected"
   1 \par 03E8\tab \tab DEFB\tab +0F
   1 \par 03D2\tab \tab DEFM\tab "Reading a 'write' file"
   1 \par 03D1\tab \tab DEFB\tab +0E
   1 \par 03B9\tab \tab DEFM\tab "Writing to a 'read' file"
   1 \par 03B8\tab \tab DEFB\tab +0D
   1 \par 03A5\tab \tab DEFM\tab "Stream already open"
   1 \par 03A4\tab \tab DEFB\tab +0C
   1 \par 038F\tab \tab DEFM\tab "Header mismatch error"
   1 \par 038E\tab \tab DEFB\tab +0B
   1 \par 037D\tab \tab DEFM\tab "Missing baud rate"
   1 \par 037C\tab \tab DEFB\tab +0A
   1 \par 0368\tab \tab DEFM\tab "Missing drive number"
   1 \par 0367\tab \tab DEFB\tab +09
   1 \par 0351\tab \tab DEFM\tab "Missing station number"
   1 \par 0350\tab \tab DEFB\tab +08
   1 \par 0344\tab \tab DEFM\tab "Missing name"
   1 \par 0343\tab \tab DEFB\tab +07
   1 \par 032D\tab \tab DEFM\tab "Invalid station number"
   1 \par 032C\tab \tab DEFB\tab +06
   1 \par 0318\tab \tab DEFM\tab "Invalid drive number"
   1 \par 0317\tab \tab DEFB\tab +05
   1 \par 030B\tab \tab DEFM\tab "Invalid name"
   1 \par 030A\tab \tab DEFB\tab +04
   1 \par 02F1\tab \tab DEFM\tab "Invalid device expression"
   1 \par 02F0\tab \tab DEFB\tab +03
   1 \par 02DB\tab \tab DEFM\tab "Invalid stream number"
   1 \par 02DA\tab \tab DEFB\tab +02
   1 \par 02C9\tab \tab DEFM\tab "Nonsense in BASIC"
   1 \par 02C8\tab \tab DEFB\tab +01
   1 \par 02B8\tab \tab DEFM\tab "Program finished"
   1 \par 02B7\tab \tab DEFB\tab +00
   1 \par 02B6\tab \tab RST\tab 0,MAIN-ROM\tab routine.
   1 \par 02B5\tab \tab PUSH\tab HL\tab middle of the 'print report message
   1 \par 02B2\tab \tab LD \tab HL,+1349 \tab Return to the main ROM in the
   1 \par 02B1\tab \tab INC \tab SP \tab pointed by ERR-SP (that is
   1 \par 02B0\tab \tab INC \tab SP \tab Ignore also the address +1303
   1 \par 02AC\tab END-PR-MS\tab LD \tab SP,(ERR-SP) \tab Clear machine stack.
   1 \par 02AA\tab \tab JR \tab 029F,PR-REP-LP \tab Continue with next character.
   1 \par 02A9\tab \tab INC \tab HL \tab Point to next character.
   1 \par 02A8\tab \tab POP \tab HL \tab Restore pointer.
   1 \par 02A6\tab \tab DEFW\tab +0010\tab to print the character.
   1 \par 02A5\tab \tab RST\tab 10,CALBAS \tab Call main ROM 'PRINT-A' restart
   1 \par 02A4\tab \tab PUSH\tab HL\tab Save pointer.
   1 \par 02A2\tab \tab JR \tab C,02AC,END-PR-MS\tab 'marker' of next message.
   1 \par 02A0\tab \tab CP\tab +20 \tab Print it unless reached the
   1 \par 029F\tab PR-REP-LP\tab LD \tab A,(HL) \tab Fetch character of message.
   1 \par 029D\tab \tab CPIR\tab \tab Advance HL to the required report
   1 \par 029B\tab \tab LD \tab B,+04 \tab Hake BC hold a sufficiently high
   1 \par 0298\tab \tab LD \tab HL,+02B7 \tab Base address of 'report messages'
   1 \par 0297\tab \tab POP \tab AF \tab Restore error number.
   1 \par 0293\tab \tab RES \tab 3,(TVFLAG) \tab Signal 'the mode is to be conside-
   1 \par 028F\tab \tab SET\tab 5,(TVFLAG)\tab Signal 'the lower screen is to be
   1 \par 028D\tab \tab DEFW\tab +0D6E\tab CLS-LOWER.
   1 \par 028C\tab \tab RST\tab 10,CALBAS\tab Clear lower screen by calling
   1 \par 0288\tab \tab RES\tab 5,(FLAGX)\tab Signal 'editing mode'.
   1 \par 0287 Shadow report messages
   1 \par 0286\tab \tab DEFW\tab +16B0\tab by calling SET-MIN.
   1 \par 0285\tab \tab RST\tab 10,CALBAS\tab Clear work areas, calculator stack
   1 \par 0282\tab \tab LD\tab (+5C16),HL\tab Displacement for stream 0 is made
   1 \par 0281\tab \tab INC\tab L\tab Now HL holds +0001.
   1 \par 027E\tab \tab LD\tab (DEFADD),HL
   1 \par 027B\tab \tab LD\tab (X-PTR-hi),H\tab set to zero.
   1 \par 0278\tab \tab LD\tab (FLAGX),H\tab FLAGX, X-PTR-hi and DEFADD are all
   1 \par 0275\tab \tab LD\tab HL,+0000\tab The system variables
   1 \par 0274\tab \tab PUSH\tab AF\tab Save the new value.
   1 \par 0273\tab \tab INC\tab A\tab Increment error number.
   1 \par 0270\tab \tab LD\tab (ERR-NR),A\tab Store it into ERR-NR.
   1 \par 026F\tab \tab LD\tab A,(HL)\tab Fetch error code.
   1 \par 026E\tab FETCH-ERR\tab POP\tab HL\tab This address points to the error code
   1 \par 026E\tab FETCH-ERR\tab 029F\tab PR-REP-LP\tab 02AC\tab END-PR-MS\tab 0486\tab CAT-SYN
   1 \par 026C\tab \tab DEFW\tab +0ECD\tab the buffer.
   1 \par 026B\tab \tab RST\tab 10,CALBAS\tab COPY-BUFF in the main ROM to empty
   1 \par 0269\tab \tab JR\tab Z,026E,FETCH-ERR\tab has not been used, otherwise call
   1 \par 0265\tab \tab BIT\tab 1,(FLAGS2)\tab Jump if the printer buffer
   1 \par 0261\tab \tab RES\tab 5,(FLAGS)\tab Signal 'ready for a new key'.
   1 \par 025E\tab \tab CALL 17B9,RCL-T-CH\tab Reclaim temporary channels and
   1 \par 025D\tab \tab HALT\tab \tab Accept one interrupt.
   1 \par 025C\tab \tab EI\tab \tab Enable interrupts.
   1 \par 0258\tab REP-MSG\tab LD\tab (FLAGS3),+00\tab First clear FLAGS3.
   1 \par 0258 Shadow report printing
   1 \par 0257\tab \tab RET\tab \tab Finished.
   1 \par 0255\tab \tab DJNZ\tab 0252,EACH-VAR
   1 \par 0254\tab \tab INC\tab HL\tab the block.
   1 \par 0252\tab EACH-VAR\tab LD\tab (HL),+FF\tab Store +FF in all the bytes in
   1 \par 0250\tab \tab LD\tab B,+22\tab The block is made by '34' bytes.
   1 \par 024D\tab RES-VARS\tab LD\tab HL,NTRESP\tab Points to the 1st variable.
   1 \par 024D Reset new system variables
   1 \par 024B\tab \tab DEFW\tab +0000\tab Default for SER-FL.
   1 \par 024A\tab \tab DEFB\tab +00\tab Default for IOBORD colour (black).
   1 \par 0249\tab \tab DEFB\tab +01\tab Default for NTSTAT.
   1 \par 0247\tab \tab DEFW\tab +000C\tab default for BAUD is +000C
   1 \par 0246\tab \tab RET
   1 \par 0243\tab \tab LD\tab (H-L),HL\tab routines from the shadow ROM.
   1 \par 0240\tab \tab CALL\tab +0000\tab 'variable', used to call main ROM
   1 \par 023D\tab \tab LD\tab HL,+0000\tab This short subroutine is the SBRT
   1 \par 023B\tab \tab DEFW\tab +01F0\tab Default for VECTOR is ERR-6 address.
   1 \par 023A\tab \tab DEFB\tab +02\tab Default value for FLAGS3 (bit 1 is
   1 \par 023A System variables default values
   1 \par 0239\tab \tab RET\tab \tab Finished.
   1 \par 0235\tab VAR-EXIST\tab RES 1,(FLAGS3)\tab 'New variables already exist'.
   1 \par 0235\tab VAR-EXIST\tab 024D\tab RES-VARS\tab 0252\tab EACH-VAR\tab 0258\tab REP-MSG
   1 \par 0234\tab \tab RET\tab \tab Finished.
   1 \par 0231\tab \tab LD\tab (COPIES),A
   1 \par 022F\tab \tab LD\tab A,+01\tab Set COPIES to +01.
   1 \par 022D\tab \tab LDIR\tab \tab Store default values.
   1 \par 022A\tab \tab LD\tab DE,+5CB6\tab Start of 'new variables' area.
   1 \par 0227\tab \tab LD\tab BC,+0013\tab Length of table.
   1 \par 0224\tab DEFAULT\tab LD\tab HL,+023A\tab Base address of 'default values'
   1 \par 0221\tab \tab JP\tab 0700,UNPAGE
   1 \par 0220\tab \tab PUSH\tab DE\tab is MAKE-ROOM.
   1 \par 021D\tab \tab LD\tab DE,+1655\tab Return address to main ROM
   1 \par 021C\tab \tab PUSH\tab DE\tab shadow ROM.
   1 \par 021A\tab \tab LD\tab E,+08\tab Store return address to the
   1 \par 0219\tab \tab PUSH\tab DE\tab called'.
   1 \par 0216\tab \tab LD\tab DE,+0000\tab Signal 'a main ROM routine has been
   1 \par 0213\tab \tab LD\tab BC,+003A\tab Length of space needed.
   1 \par 0210\tab \tab LD\tab HL,+5CB5\tab One location before the new space
   1 \par 020D\tab \tab LD\tab (MEM),HL\tab MEMBOT area.
   1 \par 020A\tab \tab LD\tab HL,+5C92\tab Set MEM with the address of
   1 \par 0207\tab \tab LD\tab (STKEND),HL\tab stack.
   1 \par 0204\tab \tab LD\tab HL,(STKBOT)\tab Clear the calculator
   1 \par 0203\tab \tab PUSH\tab HL\tab address DEFAHLT below.
   1 \par 0200\tab \tab LD\tab HL,+0224\tab Pre-load machine-stack with the
   1 \par 01FE\tab \tab JR\tab C,0235,VAR-EXIST\tab Jump if the 'new' variables already
   1 \par 01FD\tab \tab ADD\tab HL,DE\tab The carry flag is now set it the
   1 \par 01FA\tab \tab LD\tab DE,+A349\tab This is FFFF-5CB6.
   1 \par 01F7\tab CRT-VARS\tab LD\tab HL,(CHANS)\tab Fetch start of channel area.
   1 \par 01F7 Create new system variables routine
   1 \par 01F6\tab \tab RST\tab 28,ROMERR\tab Give the appropriate error.
   1 \par 01F3\tab \tab LD\tab (CH-ADD),HL
   1 \par 01F0\tab ERR-6\tab LD\tab HL,(CHADD-)\tab Restore initial CH-ADD contents.
   1 \par 01EF\tab \tab JP\tab (HL)\tab VECTOR (normally ERR-6 below).
   1 \par 01EC\tab ERR-V\tab LD\tab HL,(VECTOR)\tab Jump to the address held in
   1 \par 01EC\tab ERR-V\tab 01F0\tab ERR-6\tab 01F7\tab CRT-VARS\tab 0224\tab DEFAULT
   1 \par 01E9\tab \tab JP\tab Z,057F,CLR#-SYN
   1 \par 01E7\tab \tab CP\tab +2F\tab ...and 'CLEAR#' command.
   1 \par 01E4\tab \tab JP\tab Z,0559,CLS#-SYN
   1 \par 01E2\tab \tab CP\tab +2D\tab ...'CLS#',...
   1 \par 01DF\tab \tab JP\tab Z,08A8,MRG-SYN
   1 \par 01DD\tab \tab CP\tab +07\tab ...'MERGE',...
   1 \par 01DA\tab \tab JP\tab Z,089E,VERIF-SYN
   1 \par 01D8\tab \tab CP\tab +08\tab ...'VERIFY',...
   1 \par 01D5\tab \tab JP\tab Z,0894,LOAD-SYN
   1 \par 01D3\tab \tab CP\tab +21\tab ...'LOAD',...
   1 \par 01D0\tab \tab JP\tab Z,082F,SAVE-SYN
   1 \par 01CE\tab \tab CP\tab +2A\tab ...'SAVE',...
   1 \par 01CB\tab \tab JP\tab Z,04ED,OPEN-SYN
   1 \par 01C9\tab \tab CP\tab +05\tab ...'OPEN',...
   1 \par 01C6\tab \tab JP\tab Z,053l,ERASE-SYN
   1 \par 01C4\tab \tab CP\tab +04\tab ...'ERASE',...
   1 \par 01C1\tab \tab JP\tab Z,053D,MOVE-SYN
   1 \par 01BF\tab \tab CP\tab +03\tab ...'MOVE',...
   1 \par 01BC\tab \tab JP\tab Z,04B4,FRMT-SYN
   1 \par 01BA\tab \tab CP\tab +02\tab Also for 'FORMAT',...
   1 \par 01B7\tab \tab JP\tab Z,0486,CAT-SYN\tab Check CAT syntax if so.
   1 \par 01B5\tab \tab CP\tab +01\tab Ia the command a 'CAT'
   1 \par 01B3\tab \tab SUB\tab +CE\tab Reduce range of the code.
   1 \par 01B1\tab \tab DEFW\tab +0020\tab fetch the command code.
   1 \par 01B0\tab \tab RST\tab 10,CALBAS\tab Call NEXT-CHAR in the main ROM to
   1 \par 01AD\tab \tab CALL\tab 024D,RES-VARS\tab Reset some 'new' variables to +FF.
   1 \par 01AB\tab \tab DEFW\tab +16BF\tab ROM 'SET-WORK' routine.
   1 \par 01AA\tab CL-WORK\tab RST\tab 10,CALBAS\tab Clear work areas by calling main
   1 \par 01A8\tab \tab JR\tab NZ,0182,RCLM-NUM
   1 \par 01A6\tab \tab CP\tab +0D\tab the line is finished.
   1 \par 01A5\tab NEXTNUM\tab LD\tab A,(HL)\tab Jump back into the loop until
   1 \par 01A4\tab \tab POP\tab BC
   1 \par 01A3\tab NXT-1\tab POP\tab HL\tab Restore pointer and counter.
   1 \par 01A0\tab \tab LD\tab (CHADD-),HL\tab Store the new value.
   1 \par 019E\tab \tab SBC\tab HL,BC
   1 \par 019D\tab \tab AND\tab A\tab been moved '6' bytes down.
   1 \par 019A\tab \tab LD\tab BC,+0006\tab The character pointed by CHADD- has
   1 \par 0199\tab \tab EX\tab DE,HL\tab Otherwise CHADD- needs to be updated.
   1 \par 0197\tab \tab JR\tab NC,01A3,NXT-1
   1 \par 0195\tab \tab SBC\tab HL,DE\tab pointed by CHADD-.
   1 \par 0194\tab \tab AND\tab A\tab reclaimed were after the character
   1 \par 0190\tab \tab LD\tab DE,(CHADD-)\tab Jump forward if the '6' bytes
   1 \par 018F\tab \tab PUSH\tab HL\tab Save HL (points after the reclaimed
   1 \par 018D\tab \tab DEFW\tab +19E8\tab reclaim the 'number'.
   1 \par 018C\tab \tab RST\tab 10,CALBAS\tab Call RECLAIM-2 in the 'main' ROM to
   1 \par 0189\tab \tab LD\tab BC,+0006\tab '6' bytes have to be reclaimed.
   1 \par 0188\tab \tab PUSH\tab BC\tab Save the counter.
   1 \par 0186\tab \tab JR\tab NZ,01A5,NEXTNUM\tab start of a 'number'.
   1 \par 0184\tab \tab CP\tab +0E\tab Jump if the character is not the
   1 \par 0183\tab \tab LD\tab A,(HL)\tab Fetch the character.
   1 \par 0182\tab RCLN-NUM\tab INC\tab HL\tab Points to next character.
   1 \par 0182\tab RCLM-NUM\tab 01A3\tab NXT-1\tab 01A5\tab NEXTNUM\tab 01AA\tab CL-WORK
   1 \par 0180\tab \tab LD\tab C,+00\tab Clear C register.
   1 \par 017F\tab \tab DEC\tab HL\tab This balances the INC below.
   1 \par 017C\tab \tab JP\tab Z,01F0,ERR-6\tab not in the editing area.
   1 \par 0178\tab \tab BIT\tab 7,(PPC-hi)\tab Give an error report if the line is
   1 \par 0176\tab \tab JR\tab NZ,01AA,CL-WORK
   1 \par 0175\tab \tab RST\tab 18,CHKSYNTAX\tab Jump forward if during runtime.
   1 \par 0172\tab \tab LD\tab (CH-ADD),HL\tab Update CH-ADD to this address.
   1 \par 0171\tab \tab DEC\tab HL\tab Now HL holds the start address of the
   1 \par 016F\tab S-STAT\tab DJNZ\tab 0152,EACH-ST\tab Continue with next statement.
   1 \par 016D\tab \tab JR\tab 0139,NREPORT-1\tab Give an error (because a wrong number
   1 \par 016B\tab \tab JR\tab NZ,0152,EACH-ST\tab Continue the loop if not.
   1 \par 0169\tab CHKEND-L\tab CP\tab +80\tab Check whether the line is finished.
   1 \par 0167\tab \tab JR\tab Z,016F,S-STAT\tab Jump if the statement is finished.
   1 \par 0165\tab CHKEVEN\tab BIT\tab 0,C\tab found is even (i.e. colon or THEN
   1 \par 0163\tab \tab JR\tab NZ,0l69,CHKEND-L\tab Check whether the number of quotes
   1 \par 0161\tab \tab CP\tab +CB\tab Jump unless the character is 'THEN'.
   1 \par 015F\tab \tab JR\tab Z,0165,CHKEVEN\tab Jump if it is.
   1 \par 015D\tab CHKEND\tab CP\tab +3A\tab Is the character a colon?
   1 \par 015D\tab CHKEND\tab 0165\tab CHKEVEN\tab 0169\tab CHKEND-L\tab 016F\tab S-STAT
   1 \par 015C\tab \tab DEC\tab C\tab Decrement counter for each '"' found
   1 \par 015A\tab \tab JR\tab NZ,015D,CHKEND\tab Jump it it is not.
   1 \par 0158\tab \tab CP\tab +22\tab Is the character a '"'?
   1 \par 0157\tab \tab INC\tab HL\tab Points to next character.
   1 \par 0155\tab \tab JR\tab Z,0l4E,SKIP-NUM\tab If so, advance the pointer after the
   1 \par 0153\tab \tab CP\tab +0E\tab Is it the 'number' marker ?
   1 \par 0152\tab EACH-ST\tab LD\tab A,(HL)\tab Get a character from line.
   1 \par 0151\tab \tab ADD\tab HL,DE\tab Skip the floating point representat.
   1 \par 014E\tab SKIP-NUN\tab LD\tab DE,+0006\tab Length of a floating point number.
   1 \par 014C\tab \tab JR\tab 0l33,SC-L-LOOP\tab Continue until found.
   1 \par 014B\tab \tab ADD\tab HL,DE\tab otherwise points to next line.
   1 \par 0149\tab \tab JR\tab Z,0l6F,S-STAT\tab Jump if the line is found,
   1 \par 0148\tab \tab INC\tab HL\tab Points to start of the line.
   1 \par 0147\tab \tab LD\tab D,(HL)\tab Fetch high byte.
   1 \par 0146\tab \tab INC\tab HL
   1 \par 0145\tab \tab LD\tab E,(HL)\tab Fetch low byte of the length.
   1 \par 0144\tab LINE-LEN\tab INC\tab HL\tab Increment the pointer.
   1 \par 0142\tab \tab JR\tab C,0139,NREPORT-1\tab Give an error if the line dDEs
   1 \par 0141\tab \tab CP\tab (HL)\tab the line numbers.
   1 \par 013E\tab \tab LD\tab A,(PPC-lo)\tab Compare also the high byte of
   1 \par 013C\tab \tab JR\tab NZ,0144,LINE-LEN\tab Jump if the 'current' line is not the
   1 \par 013B\tab TEST-LOW\tab INC\tab HL\tab Points to low byte of line no.
   1 \par 013B\tab TEST-LOW\tab 0144\tab LINE-LEN\tab 014E\tab SKIP-NUN\tab 0152\tab EACH-ST
   1 \par 013A\tab \tab DEFB\tab +00\tab routine.
   1 \par 0139\tab NREPORT-1\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 0137\tab \tab JR\tab NC,013B,TEST-LOW\tab Jump if the 'current' line no. is
   1 \par 0136\tab \tab CP\tab (HL)\tab searched with that of the 'current'
   1 \par 0133\tab SC-L-LOOP\tab LD\tab A,(PPC-hi)\tab Compare the number of the tine to be
   1 \par 0130\tab PROG-LINE\tab LD\tab HL,(PROG)\tab Fetch start of program area.
   1 \par 012E\tab \tab JR\tab 016F,S-STAT\tab Jump forward.
   1 \par 012C\tab \tab DEFW\tab +0018\tab update HL to the 1st character in
   1 \par 012B\tab \tab RST\tab l0,CALBAS\tab Call GET-CHAR in the main ROM to
   1 \par 012A\tab \tab POP\tab BC\tab Restore counters.
   1 \par 0128\tab \tab DEFW\tab +19FB\tab the number of the line in the editing
   1 \par 0127\tab \tab RST\tab 10,CALBAS\tab Call main ROM 'E-LINE-NO' (it fetches
   1 \par 0126\tab \tab PUSH\tab BC\tab Save counters.
   1 \par 0124\tab \tab JR\tab Z,0130,PROG-LINE\tab is in the program area.
   1 \par 0120\tab \tab BIT\tab 7,(PPC-hi)\tab Jump forward if the line
   1 \par 011E\tab \tab LD\tab C,+00\tab Counter of ' " ' characters.
   1 \par 011B\tab RUNTIME\tab LD\tab B,(SUBPPC)\tab Statement counter.
   1 \par 011B\tab RUNTIME\tab 0130\tab PROG-LINE\tab 0133\tab SC-L-LOOP\tab 0139\tab NREPORT-1
   1 \par 0117\tab \tab LD\tab (PPC-hi),+FF\tab Signal "syntax time".
   1 \par 0115\tab \tab JR\tab NZ,011B,RUNTIME
   1 \par 0114\tab \tab RST\tab 18,CHKSYNTAX\tab Jump if during runtime.
   1 \par 0110\tab \tab SET\tab 0,(FLAGS3)\tab Signal "execution of a 'new' command"
   1 \par 010D\tab \tab JP\tab NZ,0028,ROMERR
   1 \par 0109\tab \tab BIT\tab 0,(FLAGS3)\tab during execution of a 'new' command.
   1 \par 0106\tab \tab JP\tab NZ,0028,ROMERR\tab in INPUT mode, or
   1 \par 0102\tab \tab BIT\tab 5,(FLAGX)\tab Use 'main' ROM error handler also if
   1 \par 0101\tab \tab POP\tab AF\tab Clear the stack.
   1 \par 00FE\tab \tab LD\tab (CHADD-),HL\tab is saved.
   1 \par 00FB\tab COPYCHADD\tab LD\tab HL,(CH-ADD)\tab The character pointer
   1 \par 00F8\tab \tab JP\tab NZ,0028,ROMERR\tab If none of these, use 'main' ROM
   1 \par 00F6\tab \tab CP\tab +FC\tab Or 'Invalid stream'.
   1 \par 00F4\tab \tab JR\tab Z,00FB,C0PYCHADD
   1 \par 00F2\tab \tab CP\tab +F3\tab Also if 'Invalid filename'.
   1 \par 00F0\tab \tab JR\tab Z,00FB,COPYCHADD\tab 'Nonsense in BASIC'.
   1 \par 00EE\tab \tab CP\tab +F0\tab Jump if the error is
   1 \par 00EB\tab \tab JP\tab NC,1981,HOOK-CODE\tab Jump if it's a hook code, or an
   1 \par 00E9\tab TEST-CODE\tab SUB\tab +1B\tab Reduce the range.
   1 \par 00E8\tab \tab DEFB\tab +FF\tab routine.
   1 \par 00E7\tab NREPORT-0\tab RST\tab 20,SH-ERR\tab Call the error handling
   1 \par 00E4\tab \tab JP\tab Z,0A95,LOAD-RUN\tab Load the 'run' program from
   1 \par 00E2\tab \tab CP\tab +F7\tab Check if the command is 'RUN'.
   1 \par 00E1\tab \tab LD\tab A,(HL)\tab the editing area.
   1 \par 00DE\tab \tab LD\tab HL,(E-LINE)\tab Otherwise fetch the command code from
   1 \par 00DC\tab \tab JR\tab Z,00E7,NREPORT-0\tab line is not in the editing area.
   1 \par 00D8\tab \tab BIT\tab 7,(PPC-hi)\tab Give an error also if the
   1 \par 00D6\tab \tab JR\tab Z,00E7,NREPORT-0\tab Give an error if not the first time.
   1 \par 00D2\tab \tab BIT\tab 1,(FLAGS3)\tab This is set when using the 'shadow'
   1 \par 00D0\tab \tab JR\tab NZ,00E9,TESTCODE\tab Jump if it is not.
   1 \par 00CE\tab \tab CP\tab +FF\tab Check if the error is 'OK'.
   1 \par 00CB\tab \tab LD\tab (ERR-NR),A\tab Store the error code.
   1 \par 00C9\tab \tab DEFW\tab +007B\tab instruction, so the error code is
   1 \par 00C8\tab \tab RST\tab 10,CALBAS\tab This calls a single 'LD A,(HL)'
   1 \par 00C7\tab \tab PUSH\tab AF\tab Save A again.
   1 \par 00C6\tab \tab POP\tab HL\tab Return address (points to the error
   1 \par 00C5\tab \tab POP\tab AF\tab Remove A temporarily.
   1 \par 00C3\tab \tab OUT\tab (+EF),A
   1 \par 00C1\tab \tab LD\tab A,+EE
   1 \par 00BF\tab \tab OUT\tab (+F7),A\tab signals to the Interface 1.
   1 \par 00BD\tab \tab LD\tab A,+01\tab non-existent, then send some
   1 \par 00BC\tab START-4\tab RST\tab 30,NEWVARS\tab Create interface variables if
   1 \par 00BC\tab START-4\tab 00E7\tab NREPORT-0\tab 00E9\tab TEST-CODE\tab 00FB\tab COPYCHADD
   1 \par 00BB\tab \tab JP\tab (HL)\tab Jump to the appropriate 'input' or
   1 \par 00BA\tab \tab EX\tab DE,HL\tab Move the address to HL.
   1 \par 00B9\tab \tab LD\tab D,(HL)\tab Fetch the high byte.
   1 \par 00B8\tab \tab INC\tab HL
   1 \par 00B7\tab \tab LD\tab E,(HL)\tab Fetch the low byte.
   1 \par 00B6\tab \tab ADD\tab HL,DE\tab HL holds the address of the routine
   1 \par 00B3\tab \tab LD\tab HL,+0004\tab DE now holds (address of routine
   1 \par 00B2\tab \tab PUSH\tab HL\tab UNPAGE routine.
   1 \par 00AF\tab \tab LD\tab HL,+0700\tab Make return address the
   1 \par 00AE\tab \tab POP\tab AF\tab Restore A register (character to be
   1 \par 00AC\tab \tab JR\tab NZ,00BC,START-4
   1 \par 00AB\tab \tab POP\tab DE\tab channels have been requested.
   1 \par 00A9\tab \tab SBC\tab HL,DE\tab Jump forward if no
   1 \par 00A6\tab \tab LD\tab DE,+15FE\tab If a channel has been requested,
   1 \par 00A5\tab START-3\tab PUSH\tab DE\tab Save DE temporarily.
   1 \par 00A4\tab \tab RET\tab \tab calling routine.
   1 \par 00A1\tab \tab LD\tab HL,(H-L)\tab Restore HL and return to the
   1 \par 00A0\tab \tab POP\tab HL\tab has been called; clear stack.
   1 \par 009F\tab \tab POP\tab AF\tab Otherwise a 'main' ROM routine
   1 \par 009D\tab \tab JR\tab NZ,00A5,START-3\tab Jump forward if it is not.
   1 \par 009C\tab \tab OR\tab L\tab is zero.
   1 \par 009B\tab \tab LD\tab A,H\tab Check if the return address
   1 \par 009A\tab START-2\tab PUSH\tab AF\tab Save A register.
   1 \par 009A Control routine
   1 \par 0097\tab \tab JP\tab 0700,UNPAGE\tab paged-out the 'shadow' ROM.
   1 \par 0096\tab \tab PUSH\tab HL\tab SBRT subroutine after having
   1 \par 0093\tab \tab LD\tab HL,+5CB9\tab Call indirectly the
   1 \par 0092\tab \tab PUSH\tab HL\tab is +0008.
   1 \par 008F\tab \tab LD\tab HL,+0008\tab Return address to the shadow ROM
   1 \par 008E\tab \tab PUSh\tab HL\tab called".
   1 \par 008B\tab \tab LD\tab HL,+0000\tab Signal "a 'main' ROM routine has been
   1 \par 008A\tab \tab EX\tab DE,HL\tab Restore initial value of DE.
   1 \par 0089\tab \tab EX\tab (SP),HL\tab Exchange with initial value of DE
   1 \par 0088\tab \tab INC\tab HL\tab Points to the return address.
   1 \par 0084\tab \tab LD\tab (5CBD),DE\tab Use the address with the CALL in
   1 \par 0083\tab \tab LD\tab D,(HL)\tab register pair.
   1 \par 0082\tab \tab INC\tab HL\tab to be called Into the DE
   1 \par 0081\tab CALBAS-2\tab LD\tab E,(HL)\tab Fetch the address of the subroutine
   1 \par 0081 CALBAS-2
   1 \par 0080\tab \tab RST\tab 0,MAIN-ROM\tab return addrcs0 & exit.
   1 \par 007C\tab \tab LD \tab SP,(ERR-SP) \tab Make error handler routine the
   1 \par 007B\tab \tab RET\tab Z\tab reset)
   1 \par 0077\tab CHECK-SP\tab BIT\tab 2,(FLAGS3)\tab Return. (Normally bit 2 is always
   1 \par 0077\tab CHECK-SP\tab 0081\tab CALBAS-2\tab 009A\tab START-2\tab 00A5\tab START-3
   1 \par 0077 CHECK-SP
   1 \par 0076\tab \tab RST\tab 0,MAIN-ROM\tab routine.
   1 \par 0075\tab \tab PUSH\tab HL\tab routine to the error handler
   1 \par 0072\tab \tab LD\tab HL,+16C5\tab Return via 'main' ROM 'SET-STK'
   1 \par 006E\tab \tab LD\tab SP,(ERR-SP)\tab Clear machine stack.
   1 \par 006B\tab \tab LD\tab (X-PTR),HL\tab by the interpreter is copied into
   1 \par 0068\tab STERROR\tab LD\tab HL,(CHADD)\tab The address of the character reached
   1 \par 0068 ST-ERROR
   1 \par 0066\tab NMINT-SRV\tab RETN\tab \tab Return immediately.
   1 \par 0066 Non-maskable interrupt
   1 \par 0064\tab \tab DEFB\tab +FF,+FF
   1 \par 0061\tab \tab DEFB\tab +FF,+FF,+FF\tab Unused locations.
   1 \par 0060\tab \tab RST\tab 0,MAIN-ROM\tab +0000 in the 'main' ROM.
   1 \par 005F\tab \tab PUSH\tab HL\tab by jumping to the address
   1 \par 005C\tab \tab LD\tab HL,+0000\tab Otherwise reset the system
   1 \par 005A\tab \tab JR\tab NZ,0068,ST-ERROR\tab Jump if not.
   1 \par 0058\tab \tab CP\tab +14\tab Check if attempting to BREAK into the
   1 \par 0055\tab \tab LD\tab A,(ERR-NR)\tab Fetch the error code.
   1 \par 0053\tab \tab JR\tab Z,0068,ST-ERROR
   1 \par 004F\tab \tab BIT\tab 4,(FLAGS3)\tab an 'autorun' program.
   1 \par 004D\tab \tab JR\tab Z,0068,ST-ERROR\tab during the loading of
   1 \par 0049\tab \tab BIT\tab 1,(FLAGS3)\tab Jump forward if not
   1 \par 0046\tab \tab CALL\tab 17B9,RCL-T-CH\tab Reclaim all temporary channels &
   1 \par 0043\tab \tab CALL\tab 0077,CHECK-SP\tab Use 'main' ROM error handler if
   1 \par 0041\tab \tab JR\tab Z,0068,ST-ERROR
   1 \par 0040\tab RMERR-2\tab RST\tab 18,CHKSYNTAX\tab Jump forward if checking syntax.
   1 \par 0040 Main ROM error routine
   1 \par 003D\tab \tab JP\tab 0258,REP-MSG\tab Print the report message.
   1 \par 003A\tab TEST-SP\tab CALL\tab 0077,CHECK-SP\tab Use 'main' ROM error handler if
   1 \par 003A\tab TEST-SP\tab 0040\tab RMERR-2\tab 0066\tab NMINT-SRV\tab 0068\tab ST-ERROR
   1 \par 003A TEST-SP
   1 \par 0039\tab \tab RET\tab \tab Return immediately.
   1 \par 0038\tab INT-SERV\tab EI\tab \tab Enable interrupts.
   1 \par 0038 Maskable interrupt
   1 \par 0036\tab \tab DEFB\tab +FF,+FF
   1 \par 0033\tab \tab DEFB\tab +FF,+FF,+FF\tab Unused locations.
   1 \par 0030\tab NEWVARS\tab JP\tab 01F7,CRT-VARS\tab Jump forward immediately.
   1 \par 0030 Create new system variables restart
   1 \par 002E\tab \tab DEFB\tab +FF,+FF\tab Unused locations.
   1 \par 002C\tab \tab JR\tab 0040,RMERR-2\tab jump forward.
   1 \par 0028\tab ROMERR\tab RES\tab 3,(TVFLAG)\tab Signal 'the mode is to be considered
   1 \par 0028 Main ROM error restart
   1 \par 0025\tab \tab DEFB\tab +FF,+FF,+FF\tab Unused locations.
   1 \par 0023\tab \tab JR\tab 003A,TEST-SP\tab to TEST-SP during runtime.
   1 \par 0021\tab \tab JR\tab Z,0068,ST-ERROR\tab syntax, or
   1 \par 0020\tab SH-ERR\tab RST\tab 18,CHKSYNTAX\tab Jump to ST-ERROR if checking
   1 \par 0020\tab SH-ERR\tab 0028\tab ROMERR\tab 0030\tab NEWVARS\tab 0038\tab INT-SERV
   1 \par 0020 Shadow error
   1 \par 001D\tab \tab DEFB\tab +FF,+FF,+FF\tab Unused locations.
   1 \par 001C\tab \tab RET\tab \tab Finished.
   1 \par 0018\tab CHKSYNTAX\tab BIT 7,(FLAGS)\tab Test bit 7 of FLAGS.
   1 \par 0018 Test if syntax is being checked
   1 \par 0017\tab \tab DEFB\tab +FF\tab Unused location.
   1 \par 0015\tab \tab JR\tab 0081,CALBAS-2\tab Jump forward.
   1 \par 0014\tab \tab PUSH\tab DE\tab Save DE temporarily.
   1 \par 0013\tab \tab POP\tab HL\tab Get the return address (points to the
   1 \par 0010\tab CALBAS\tab LD\tab (H-L),HL\tab Save HL into SBRT.
   1 \par 0010 Call a main ROM routine
   1 \par 000D\tab \tab JP\tab 009A,START-2\tab Jump forward.
   1 \par 000C\tab \tab PUSH\tab HL\tab (usually points to the error code)
   1 \par 000B\tab \tab POP\tab HL\tab Get the return address
   1 \par 0008\tab ST-SHADOW\tab LD\tab HL,(CH-ADD)\tab The first instruction is common to
   1 \par 0008 Start
   1 \par 0005\tab \tab JP\tab 0700,UNPAGE\tab Return to 'main' ROM.
   1 \par 0001\tab \tab LD\tab (FLAGS3),+00\tab Clear FLAGS3.
   1 \par 0000\tab MAIN-ROM\tab POP\tab HL\tab Remove return address from the
   1 \par 0000 Return to main ROM
   1 \par - When a "m" or "n" channel is created in the CHANS area (OP-PERM-N and SET-T-MCH), a check is made to see if there is sufficient memory to insert the new space.
   1 \par - Two new 'hook codes', +33 and +34, are now available. Hook code +33 may be used to fetch a 'record descriptor' from the next sector; the microdrive motor must be turned on b
   1 \par - The carry flag is preserved when calling the BORD-REST subroutine at +0D4D; thus, the 'hook code' +2F works correctly.
   1 \par - The OP-RS-CH routine stores the "B" specifier into (IX+4) when opening a RS232 "b" channel.
   1 \par - The GET-M-HD subroutine, returns (with bit 0 of HDFLAG or RECFLG inverted) when 'time-out' occurs during the reading operation.
   1 \par - The 'hook code' +2B calls the SET-T-MCH subroutine.
   1 \par - No CR code is sent when a RS232 'b" channel is closed.
   1 \par - Most of the tests done to the BREAK key have been replaced by calls to the TEST-BRK subroutine at +163E.
   1 \par - If the paging of the shadow ROM is the return after a call to a 'main' ROM
   1 \par - If an error has occurred in the 'main' ROM, a check is made to see if the
   1 \par - If an Interface's channel has been requested, it jumps to the required 'input'
   1 \par - An instruction 'SET 7,(HL)' has been inserted at location +1741 (i.e. the middle of the CLOSE routine), to correct the bug present in the 'old' shadow ROM (see comment to the CLOSE routine).
   1 \par (v) Your routine returns control to the BASIC program which is currently running.
   1 \par (iv) Your syntax routine checks to see that you have given what it regards as a correct command. Once it decides that you have, it calls a routine which you have written to do whatever task is required of the new BASIC command.
   1 \par (iii) The Shadow ROM syntax checker rejects your statement, and calls the routine whose address is stored in the variable VECTOR. This would normally be the main ROMs "report an error" routine, but since you have previously changed the contents of VECTOR 
   1 \par (ii) This causes control to be transfered to the syntax checking routine in the Shadow ROM.
   1 \par (i) Command is rejected as being syntactically incorrect by the syntax checking routine in main ROM. Accordingly, an error routine is called, using a RST 8 command.
   1 \par (For owners of Interface 1s equipped with the edition 1 ROM)
   1 \par (For Interface 1s equipped with the edition 1 Shadow ROM.)
   1 \par 'new' channels.
   1 \par 'Stream already open'
   1 \par 'Shadow' system variables
   1 \par 'Reading a write file'
   1 \par 'Reading a 'write' file'
   1 \par 'Program finished'
   1 \par 'Nonsense, in BASIC'
   1 \par 'Missing station number'
   1 \par 'Missing name'
   1 \par 'Missing drive number'
   1 \par 'Missing baud rate'
   1 \par 'Microdrive not present'
   1 \par 'LINE nnnnn'\tab If it is a BASIC program with autostart at line 'nnn'.
   1 \par 'Invalid stream number'
   1 \par 'Invalid station number'
   1 \par 'Invalid name'
   1 \par 'Invalid drive number'
   1 \par 'Invalid device expression'
   1 \par 'Hook code error'
   1 \par 'DATA x'\tab If it is a numeric array named 'x'.
   1 \par 'DATA x$'\tab If it is a string array named 'x$'
   1 \par 'CODE sssss,nnnnn'\tab If it is a 'bytes' file; 'sss' and 'nnn' are respectively
   1 \par 'CODE error'
   1 \par 'BREAK into program'
   1 \par  these, probably a 'new' command has been used. If so, the routine\line  corresponding to the command is called, otherwise the error is produced by
   1 \par  subroutine, then it returns to the calling routine.
   1 \par  or 'output' routine.
   1 \par  jumping to the address 01F0 (held in the VECTOR system variable - thus
   1 \par  is used.
   1 \par  is not a 'hook code', then it checks to determine whether the error is
   1 \par  error code is a 'hook code' (and calls the required routine if it is). If it
   1 \par  altering this address to point a routine in RAM wHL give the possLDility of
   1 \par  adding more 'new' commands). In all other cases, the main ROM error handler
   1 \par  "Nonsense in BASIC", "Invalid filename", or "Invalid stream". If it is any of
   1 \insrsid13766214 CONTENTS
   1 \f2\fs20\lang1043\langfe1033\cgrid\langnp1043\langfenp1033 \sbasedon0 \snext15 Plain Text;}}{\*\revtbl {Unknown;}}{\*\rsidtbl \rsid7820125\rsid13766214}{\*\generator Microsoft Word 10.0.6804;}{\info{\title THE SHADOW ROM DISASSEMBLY}{\author Rudy Biesma}
   1 \dghorigin1701\dgvorigin1984\dghshow1\dgvshow0\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\bdrrlswsix\nolnhtadjtbl\oldas\rsidroot7820125 \fet0{\*\wgrffmtfilter 013f}\sectd \psz9\linex0\endnhere\sectdefaultcl\sftnbj {\*\pnseclvl1
   1 SCHAN if the channel is "B" or "T", otherwise the routine is entered at OP-STREAM with "N" channel (from 0EA6), with DE holding the channel start address. The correct displacement is calculated for the stream whose number is held in S-STR1, and stored in 
   1 LL-INP subroutine (see 0D03) that the 'end of file' error is not to be reported.
   1 INT-type record. The carry flag is returned reset if the reading is successful.
   1 EOF block, the routine does not reach RCLM-CH or DEL-M-BUF, and it is impossible to delete the channel from BASIC unless using the NEW command. The bug should be eliminated by making the channel 'temporary', by setting bit 7 of channel specifier (at 1740.
   1 DCHK checksum. In both cases HL must contain on entry the start address of the block for which the checksum is to be obtained.
   1 DATA "THE MICRODRIVES", "give you fast access to a large memory.", "", "Each Microdrive can hold up to 100 Kbytes on a single", "removable cartridge.", "Note that the Microdrive nearest the computer is always known as", "Microdrive 1, and the next 
   1 DATA "THE CARTRIDGES", "come in a protective box; and should always be kept in their", "box when not in use.", "But remember...", "Never take the cartridge out of the Microdrive while the light", "is on.", "Never switch the power on or of while a cart
   1 Another use for hook code 32H is paging in the Shadow ROM. If you want the Shadow ROM to sit in main memory, where the main ROM normally is, and to be directly accessible to your program, use the following program fragment to page 
   1 A later section will explain how this is done.
   1 ; the number of sectors examined is not fixed to 255, but is given by 'maximum sector number + 3'; this prevents the routine from reading 'nonexistent' sectors, and reduces the time required in the command execution.
   1 5. Note that the standard Intel format is used, i.e. the low byte goes before the high byte in memory. You may use the new POKE command, for example, to store values into two\emdash byte system variables:
   1 32H - This routine is different from the other hook codes in that it can be used to call any routine in the shadow ROM. The shadow ROM is paged in, the routine whose address is held in the system variable HD-11 (held at address 5CEDH) is called, and the 
   1 232 interface, and the Local Area Network, but there are a number of minor differences in the actual code contained in the ROMs. The differences between the two editions are described in appendix 7.
   1 232 channel, and a useful memory dump command which will list the contents of an area of memory, in both hexadecimal and ASCII form.
   1 .1741), so the channel will be deleted when any error occurs.
   1 -STR1, N-STR1, HD-00, HD-0B, HD-0D, HD-0F, HD-11 are properly set.
   1 -FL system variable).
   1 , where 'a' is the address in the range 0..65535, and 'y' is the value to be poked at location 'a', again in the range 0..6553
   1 +A4 are sent as '?', while tokens are de-tokenised. Codes lower than +20 are ignored, except for +0D that sends both CR and LF codes. The routine unfortunately contains a mistake as it does not suppress the 'leading space' flag (bit 0 of FLAGS) as require
   1 'step' value that will be subtracted from 'a' until it reaches zero, and 'd' is a 'repeat' value that defines how many times the whole sound must be made. Try the following statement:
   1 'RES 0,(FLAGS)' before the 'CP +7F'.
   1 'RANDOMISE USR 63744'. The new commands should then be available.
   1  the user doesn't need to know anything about the ROM, only about the various hook codes.
   1  the system variables HD-0D and HD-0B, is written onto the Microdrive (provided that there is sufficient space available on cartridge).
   1  own station number to be copied into NCSELF. A permanent "n" channel is created into the CHANS area, and it is made, the 'current' channel. The routine returns the channel base address into the DE register pair.
   1  initial values before returning. Note that the records may be collected from the Microdrive in a random order.
   1  convert it into a 'write' file if you wish.
   1  codes,\tab the RST 8 causes a jump to the Shadow ROM where there is a second examination of the current BASIC statement, to see if it really is an error.
   1  choice, and on the maximum width that your printer allows. The parameter 'y' will define the number of columns used as step when printing the 'comma' control code. The default value for 'x' and 'y' are 80 and 20.
   1  bytes are converted in a serial form by the hardware). The entry points OUT-M-HD and OUT-M-BUF are used respectively to write headers or data blocks (including preambles).
   1  by another channel.
   1  as well as the table of EQU statements that follows it, into your assembler, assemble it, and save the resulting machine code on tape or microdrive. When you wish to use the new BASIC commands, load the machine code file into your Spectrum at 63744 (F900
   1  after five passes of the tape the record is not found, or if a checksum error occurs, the error 'File not found' is given.
   1  S-STR1 during runtime. Otherwise a channel expression like '"x";n ["name"]' is evaluated, and N-STR1, D-STR1 and L-STR1 are set as required and, if the channel specifier is "M" or "N", the parameters are checked to be in range.
   1  Hex.), and do
   1  EQU table, and then look up the entry for DISP-HEX in the alphabetical list of labels (Appendix 2.). According to this, the DISP-HEX routine is at 1E87H. Look this up in the disassembly, and add the routine you find (shown below) to the end of 
   1  BREAK when the 'scroll' message is displayed on the screen, to stop the listing. The output may be directed to a device other than the screen by first using an OPEN command. i.e. OPEN #2,"T" will direct the output to the RS232 "T" channel.
   1  (provided that you are not using the broadcast). The zero flag is returned reset if no 
   1  "This means that only one of you need ever type in a program.", "Using the lead supplied with each Interface you can link up", "as few as two and as many as 64 Spectrum computers."