" 4/3/87 6:57  =&7C00  P=0 1 ( P%=&A00 2 [OPT P*2 < BCS go FRTS P.go ZLDA #&30:STA &F2 d$LDA #&A:STA &F3:LDY #0:JSR &FFC2 n BEQ end x .loop (JSR &FFC5:BCS end:JSR &FFE3:JMP loop .end JSR &FFE7:JMP &FFE7 ] P:*KEY 10O.|K|MG.190|K|M 7 MM=0 2:_DWIND(MM,0,height,width,0):MM:dp@ WY%=:0,1);"Sigma Computer":0,Y%);" ";0,Y%-2);" ": ?&355<>7 d\@ 5 (?&28A 8)=0 Z=32200 -4:!Z=!(Z-3):Z _STRIPES:0,Y%-2); M ?&408>4 ?&409>4 ?&40A>4 ?&40B>4 ?&408=0:?&409=1:?&40A=2:?&40B=3   mcode% 50  P=0 1  P%=mcode%  [OPT P*2 "LDA #help 255:STA &F2 ,LDA #help 256:STA &F3 6LDA #143:LDX #9:LDY #0 @ JMP &FFF4 J .help T EQUB 13 ^] h P rx COM$(21),BCOM$(7),str$(15),err% 40:str$(0)="S":str$(1)="S":str$(2)="P":str$(3)="R":printer=0:?err%=0:VER$="OS 1.3" | L=1 21: COM$(L): L : CAT,EXEC,ENTER,EXAMINE,FX,HELP,INFO,KEY,LOAD,MESSAGE 8 OPT,OS,ROMS,RUN,SAVE,SPOOL,TAPE,*,*,HARSTON,MASTER  L=1 7: BCOM$(L): L , AUTO,BASIC,EDIT,ERASE,RENUMBER,TRACE,*  TRB !_STREAM(1);: R%=1 dLK "Operating System"' :$err%=0+128+"OS (C)Harston Computing Ltd."+0: err%  line=480 R%=0:_STREAM(0);:42  A$=_EDIT  rline=480  _OSC(A$)  rline  =128 ?(err%+1)=0: +10 =127dhC &6: (?&28A 2)=0 7 0) =251 =250 *K.10O.|KMG.180|K|M :$_STREAM(0);:: <>17 DNB D (-57)=0 DXB N; <128 " at line ";;_STREAM(0);:"FX4":"FX121": X_STREAM(0): line bݤ_TBVAR(X,Y) l X=0 =COM$(Y) v X=1 =BCOM$(Y) IF X=2 THEN =UCOM$(Y)  X>15 Z$:=Z$ ="/" ݤ_TLK2(TB,STRT,MAX) HL2=HL:C=STRT: dPB ݤ_TLOOK(TB,MAX)  HL2=HL C=1 L=1:CC$=_TBVAR(TB,C) " A$,HL,1)=CC$,L,1) TVC  A$,HL,1)<"a" dxB ) (A$,HL,1))-32=CC$,L,1) TVC  A$,HL,1)="." =C C=C+1:HL=HL2: C>MAX =-1  dPB (L=L+1:HL=HL+1: L> CC$ HL=HL-1:=C  dZB *~_STRIPES:?&355<>7 (?&28A 8)<>0 MM=0 2:_DWIND(MM,0,height,width,0):MM:26:?&408=0:?&409=0:?&40A=0:?&40B=0: 426:_DWIND(0,3,24,37,15):_DWIND(1,3,14,39,0):_DWIND(2,3,14,39,0):_DWIND(3,0,24,39,0):Z=014:0,Z);"";157;"":Z:Z=1523:"";157;"":Z >"";157;""; H R_OSC(A$) \HL=0 f A$="" p A$=13 z _Nxtchar="*" DpC  A$,HL,1)="/" TxD NUM=_TLOOK(0,20)  NUM<>-1 dJC _BROM(1): found=1 _UROM(1): found=1 PRINT"Looking elsewhere.."  A$: o NUM dPG,TLH,D^F,d~F,TVH,tXH,TxI,DBI,tHI,ttE,dXI,TFD,TTJ,TrJ,DZJ,d\J,ddL,TPD,TZD,dTC kMM=_GETDEC 8:A%=133:X%=MM:U%=(&FFF4)&FFFF00: U% 256<(P+2000) $(err%+1)="Bad mode"+0: err% ?(err%+1)=127:err% MM:_STRIPES  line  R%=0: dp@ FL$=_GSTR:FL$ FL$=_GSTR:21:"INFO "+FL$ $LFL$="LOAD"""+FL$+""""+6+13:L=1 FL$:"FX 138,0,"+(FL$,L,1)): L .6,11,21: 8A$=A$,HL+1):tvC Bݤ_Nxtchar LHL=HL+1: HL> A$ =13 V A$,HL,1)=13=13 ` A$,HL,1)<"!" DLD j=A$,HL,1) tݤ_GetChar ~ HL> A$ =13 =A$,HL,1)  ݤ_GETDEC  V:V=0 , AA$=_Nxtchar: AA$<"0" AA$>"9" =-1  tzD *AA$=_Nxtchar: AA$<"0" AA$>"9" =V V=V*10+ AA$-48  tpD  ݤ_GHEX -AA$=_Nxtchar: AA$>"`" AA$=( AA$-32)  HX= AA$-48: HX>9 HX=HX-7 ZZ=_Nxtchar+_SEPAR:=HX !$err%=0+"Bad hex"+0: err% =0  ݤ_SEPAR " HL> A$ A$,HL,1)=13 =0 ( A$,HL,1)="," A$,HL,1)=";" =1 ( T`H 2_STREM(ST):DZE < _STRM F5 ST:AA$=_Nxtchar: AA$<>"#" HL=HL-1:ST=1:DZE PST=_GHEX:ZZ=_SEPAR Z?ST=ST 15: str$(ST)="" $(err%+1)="Stream closed"+0:err% dMstflg="SPR",str$(ST)): stflg=0 $(err%+1)="Invalid I/O device"+0:err% n stflg DxE,tBE,tVE x:"FX3,68": ST=0 _WIND(?&408);: _WIND(?&409);: : printer $(err%+1)="Printer not selected"+0:err% "FX3,10": "FX3,7": _STREAM(ST);  "NUM=_GETDEC: NUM=-1 T`H  NUM<>?&AFF DJF  _SEPAR=0 T`H "NUM=_GETDEC: NUM=-1 T`H #HL1=HL: _Nxtchar=13 TXF * A$,HL)=""""""+13 "FX 247":TvF HL=HL1:ZZ=_SEPAR /"KEY 10,"+A$,HL+1):*KEY 10O.|K|MG.180|K|M  A$>200 D@F  $&A30=A$,HL+1):?&A2F= A$-1  *FX249,10 " *FX248 , *FX247,76 6?&AFF=NUM: @)$(err%+1)=&FD+"Bad string"+0: err% J%$(err%+1)="Bad number"+0: err% T ^,AA$=_Nxtchar:VV=_GET2HEX:_STREAM(0); h_HEX(VV);" ";:CHK=0 rAA$=_EDIT |( AA$<>19 "Wrong length": DhF AA$=AA$,18)  LOOP1=VV VV+7 :V1=_GHEX1(AA$,1,2)):CHK=CHK+V1:?LOOP1=V1:AA$=AA$,3) H LOOP1:CHK=CHK 255: CHK<>_GHEX1(AA$) "Checksum error": DhF VV=VV+8: VV<65536 DhF  ݤ_GHEX1(A$)  A$<>2 =0 $V4=A$,1,1)-48: V4>9 V4=V4-7 $V5=A$,2,1)-48: V5>9 V5=V5-7  =V4*16+V5  %_STRM:AA$=_Nxtchar:VV=_GET2HEX +_HEX(VV);" ";:CHK=0: LOOP1=VV VV+7 2_HEX1(?(LOOP1));" ";:CHK=CHK+?(LOOP1):LOOP1 %" =";:CHK=CHK 255:_HEX1(CHK) &#VV=VV+8: VV>65535 THG 0ݤ_HEX1(Z) : Z<15 ="0"+~(Z) =~(Z) D ݤ_HEX(Z) N$=_HEX1(Z 256)+_HEX1(Z 255) Xݤ_GET2HEX b VV,AA$,FL:VV=0:FL=0 l-AA$=A$,HL,1): AA$>"`" AA$=( AA$-32) v6 AA$<"0" AA$>"F" (AA$>"9" AA$<"A") tTG .FL=1:VV=VV*16+ AA$-48: AA$>"9" VV=VV-7 HL=HL+1: DlG  FL=1 =VV DJF  _SPC  HL> A$ # A$,HL,1)=" " HL=HL+1: thG  A$,HL,1)=13   FF$="."  _STRM % (_Nxtchar)=-1 FL$="": dxG FL$=FF$+A$,HL)  FL$   FF$="EXEC ": dZG !VL=_GETDEC: VL<>-1 TjH  )$err%=0+254+"Bad command"+0: err% *"VB=0:VC=0: _SEPAR=3 T`H 4%VB=_GETDEC: VB=-1 VB=0: DRH >ZZ=_SEPAR HVC=_GETDEC: VC=-1 VC=0 R'AA$="FX "+(VL)+","+(VB)+","+(VC) \VL=101 :" (";;")": f*VL=13 VB<4 VC<8 ?(&408+VB)=VC: p7VL=13 VB=255 ?&408=0:?&409=1:?&40A=2:?&40B=3: z/VL=0 VB=0 $(err%+1)=247+VER$+0:err%  VL=0  AA$:  _STRM AA$=_Nxtchar:AL$=A$,HL)  AA$=13 'VER$:TZI :HL1=HL:NUM1=_TLK2(0,12,14):HL=HL1: NUM1<>12 TZI ''VER$:MAX=17: drH:_HLP(0):TZI  _HLP(X)  L=1 MAX & " ";_TBVAR(X,L);" ";: Z$: Z$  L  (#) (),(#) ,,(#) , <1st par> <2nd par>,(#) ,(#) ,  , , ,,(#),(#) , (/+) ,(#)   AA$="": _BROM(2):_UROM(2) $$help=AL$,10): mcode% . 8FF$="INFO ": dZG BKY=_GETDEC L KY=-1 KY>25 D`I V$$err%=0+251+"Bad key"+0:err% `ZZ=_SEPAR j, KY=10 AA$="O.|K|MG.180|K|M" AA$="" t "KEY"+(KY)+AA$+A$,HL+1) ~ AA$=_Nxtchar:HL2=HL:t\I AA$=_Nxtchar - AA$<>"," AA$<>";" AA$<>13 tRI FL$=A$,HL2,HL-HL2) ADD$=A$,HL+1) FL$="LOAD "+FL$+" "+ADD$ FL$  VL=_GETDEC: VL=-1 T@J ZZ=_SEPAR  A$  '$err%=0+203+"Bad option"+0:err%   _STRM Y"15 OS"20)"( / / /S)"'"14 BASIC"20)"(F/R/L/S)"'"13 Extra Utilities"20)"( / / /S)" ( 2 _STRM <AA$="RUN "+A$,HL+1) F AA$ P Z+FL$="SAVE "+_GSTR: _SEPAR=0 t`J dRFL$=FL$+" "+_GSTR: A$,HL,1)<>"," A$,HL,1)<>";" A$,HL,1)<>"+" t`J n0 A$,HL,1)<>"+" FL$=FL$+" " FL$=FL$+"+" x'FL$=FL$+_GSTR: _SEPAR=0 tVJ +FL$=FL$+" "+_GSTR: _SEPAR=0 tVJ 4FL$=FL$+" "+_GSTR: _SEPAR=0 tVJ t`J FL$: )$(err%+1)=252+"Bad address"+0:err% ݤ_GSTR AA$=_Nxtchar:HL2=HL:dHJ AA$=_Nxtchar 8 AA$<>";" AA$<>"," AA$<>"+" AA$<>13 t~J =A$,HL2,HL-HL2) FF$="SPOOL ": dZG  2 This is the BASIC 'ROM' from here onwards... _BROM(X)  found=0  X>2  X=2 DJK "!NUM=_TLOOK(1,6): NUM=-1 ,$found=1: NUM=2 NUM=6 D@K 6 R%<>1 found=0: @) NUM tFK,d`K,tTL,DbL,thL,dPL J$ _GetChar=13 '"BASIC 1.00": T(HL1=HL: _TLK2(1,2,2)<>2 HL=HL1: ^HL=HL1:'"BASIC 1.00" h D|K rMAX=6:_HLP(1): |? ,,, , ,<1/0> +VL=_GETDEC: VL=-1 VL=10:ST=10:tdK ZZ=_SEPAR ST=_GETDEC: ST=-1 ST=10  LO=VL 65000 ST _PR(LO):A$=_EDIT  LO  _SB: djK _SB )line=2060:R%=1:"BASIC"':rline=2060: 2$err%=0+"(C)1986 Harston Computing"+0:err% :_STREAM(0);">";:A$=_EDIT: A$="CALL !-4"+13 !-4 "HL=0: _Nxtchar<>"*" dtK _OSC(A$,HL+1))  dtK  _PR(LO) & LO>9999 DXL 0 LO>999 " ";: DXL : LO>99 " ";: DXL D LO>9 " ";: DXL N " "; X;LO;" ";: b VL=_GETDEC: VL=-1 T`H l _SEPAR<>1 T`H v!VL2=_GETDEC: VL=-1 T`H ("Lines deleted from ";VL;" to ";VL2  VL=_GETDEC: VL=-1 T`H "Editing line ";VL: *VL=_GETDEC: VL=-1 VL=10:ST=10: dFL ZZ=_SEPAR ST=_GETDEC: ST=-1 ST=10 @"Lines renumbered, starting at ";VL;","'"going up by ";ST: VL= _GETDEC HVL=VL 1:"Trace is o";: (110*VL)+(102*(1-VL)),(102*(1-VL)):".": &baud=_GETDEC: baud=-1 baud=300 "Tape baud ";baud # baud=300 "TAPE3" *TAPE12   Editing routine: _restofline 'Y$,Y$-1);B$;: B$<>"" 8:B$="" * 4 _doline >_restofline Hĩ Y$-1,(8)); R \ _INIT f*X$="":Y$=" ":edflag=0:keylen=0:edflg=0 p 23,1,0;0;0;0; z  A2=255:keylen=-1:=(27) _EEXIT *FX225,1 *FX225,128 *FX225,144  ݤ_GETKEY  keylen=-1 keylen=0:=A2 A$=_KEY:A= A$  A=?&26C tNM A=27 A2=27:keylen=-1:=A  A<128 =A$  A<138 DBN  (A 15)<11 =(A$-16)  (?&28A 1)=0 TnN $* (A 48)<20 A=(A 16): 'AMSTRAD' .' (A 48)=0 (A 15)=11 DLN 88A2=((A-11) 7):A=(A 48)/2:A2=A2+A:keylen=-1:=(27) B"FX138,0,"+(A+64):d^M L.A=A 15: A-10 DVN,tHN,D`N,D~N,tRN V/A=_SCRN: DjN: A<>0 =(A) 7: d^M ` DjN:edflag=1: d^M j&edx=edx+1: edx-1 d^M edx=width-1 ?edy=edy-1:edflag=1: edy>-1 d^M edy=height-1: d^M ݤheight=?&309-?&30B+1 ݤwidth=?&30A-?&308+1  ݤ_SCRN _DECURSOR X1=:Y1=:edx,edy); 3A%=135:U%= &FFF4:X1,Y1);:=((U% &FF00)/256)  ݤ_KEY # edflag=0 edx=:edy=: dvN 23,1,1;0;0;0;:edx,edy); =  _CURSOR   ?&355=7 (255);(8);: +?&D3=255-?&D3:Y$,1);:8:?&D3=255-?&D3 ,xp=:yp=: edflag=0 edx,edy);: (_DECURSOR 2 ?&355=7 <$ ?&355=7 xp,yp);" ";(8);: Fxp,yp);Y$,1);:8: P ݤ_EDIT Z4 A$,B$,A,B,X$,Y$,edflag,edx,edy,xp,yp:xp=:yp= d n _INIT xescflag=?&275:*FX 229,1 *FX 225,128 *FX 226,144 *FX 227,160 *FX 228,176  *FX221,1  *FX4,2 # Y$="" Y$=" ":X$=X$, X$-1) )_CURSOR: edflag=1 23,1,1;0;0;0;  loop  ?&355<>7 dzO 255:_doline:8  X$<>"" 8:X$,1); lxp=:lyp=:A$=_GETKEY lxp,lyp); _DECURSOR  A= A$ " A=27 dBP , A=127 _DEL:t~O 6 A<32 tPP @ X$+ Y$>250 7: t~O Jz ( X$+ Y$)>=(width*height)-2 ?&275=escflag:_restofline:32,8::_EEXIT:$(err%+1)="No room for line"+0: err% TX$=X$+A$:A$;:_doline ^ t~O h _DEL r X$="" _BEEP: | 32,8,127:X$=X$, X$-1) B$=" "+(8):_doline: M A=13 ?&275=escflag:_restofline:32,8::_EEXIT:=X$+Y$, Y$-1)+(13)  Decode control keys NA<>21 A:"FX218":t~O X$="" t~O L1=1 X$:_DEL::t~O I (escflag 1)=0 ?&275=escflag:_restofline:32,8::_EEXIT:*FX125  dRO  esc codes A=_GETKEY: A=27 dRO  A=255 tnP A2=A 8:A=A 7  A2 TRQ,tJQ,TBR _BEEP:t~O  _BEEP: (?&28A 4)=0 7   A>2 _doline $ A+1 TfQ,TzQ,DNQ,DbQ,DvQ & Y$=" " dtP 0$Y$=Y$,2):B$=" ":_doline: t~O : X$="" dtP D*Y$=X$,1)+Y$:X$=X$, X$-1): 8: t~O N Y$=" " dtP X%X$=X$+Y$,1):Y$=Y$,2): 9: t~O b Y$-1 Y$-1 ĩ Y$-1,9);:X$=X$+Y$, Y$-1):Y$=" ": t~O HĤwidth-x1-1,(9));:X$=X$+Y$,width-x1-1):Y$=Y$,width-x1): t~O  A=0 dtP  A+7: t~O _DWIND(wind%,a%,b%,c%,d%)  BA% * wind%>7 wind%<0 4BA%=wind%*9+&411 >?BA%=0:?(BA%+1)=0 H3?(BA%+2)=a%:?(BA%+3)=b%:?(BA%+4)=c%:?(BA%+5)=d% R.?(BA%+6)=?&D2:?(BA%+7)=?&D3:?(BA%+8)=?&358 \ fݤ_WIND(w%) p w%<0 w%>7 ="" z BA% BA%=(7 (?&410))*9+&411 =?BA%=:BA%?1=:?(BA%+6)=?&D2:?(BA%+7)=?&D3:?(BA%+8)=?&358 BA%=w%*9+&411 , 28,?(BA%+2),?(BA%+3),?(BA%+4),?(BA%+5) 31,?BA%,?(BA%+1) 7?&410=w%:?&D2=?(BA%+6):?&D3=?(BA%+7):?&358=?(BA%+8) ="" ݤ_STREAM(w%) _STREM(w%):="" _UROM(X)  X>2  X=2 tHS 8 DLS:NUM=_TLOOK(16,17): NUM=-1 (NUM 1)=0 Ffound=1: (NUM+1)/2 TPD,DVS,dTC,TZD,TPS,TZS,TnS,DjS,TdS 2:printer=-1: 3:printer=0: $>_STREAM(0);: L=015:;~L;8;10;str$(L);9;11;::'': . _STRM 8VL=_GETDEC: VL=-1 B VL:TxS L CHAIN,,DEFWINDOW, ,MODE,,PLOAD,,PRINTON,,PRINTOFF,,VDU,(#) ...,TIME,(