Home » Personal collection » Acorn DFS disks » dfs_box03_disk02_format_some_games.scp » W.CALC

W.CALC

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn DFS disks » dfs_box03_disk02_format_some_games.scp
Filename: W.CALC
Read OK:
File size: 143D bytes
Load address: FF1900
Exec address: FF801F
Duplicates

There are 3 duplicate copies of this file in the archive:

File contents
   10 REM CALCULATOR
   12 REM Program by Tim Dobson (ACORNSOFT) and Richard G Warner
   14 REM For BBC Model A Microcomputer 16K Minimum
   40 ON ERROR GOTO50
   50 MODE7
   60 CLS:ON ERROR GOTO800
  100 PROCTITLEPAGE
  110 PROCINITIALISE
  120 PROCINSTRUCTIONS
  200 PROCSCREEN
  210 PRINTTAB(7,4);"Enter your expression now"
  220 V%=0:B$="":IN%=0:@%=0
  300 VDU26:IF MEM$>"" THEN PRINTTAB(12,20);"Memories in use"''MEM$
  310 VDU28,0,19,39,5:PROCON
  320 PRINTTAB(0,V%);"   ] ";B$;
  330 PROCGETLINE:PROCOFF
  340 IF KEY%=130 THEN 200
  350 B=FNEVAL(B$)
  400 B$=STR$(B):F%(0)=LEN(B$):f%(0)=LEN(B$)
  410 PRINT:IN%=1:V%=VPOS:GOTO300
  800 IF ERR=17 THEN 900
  810 IF ER$="" THEN REPORT ELSE PRINT'ER$;
  820 GOTO400
  900 VDU26:CLS
  910 PRINTTAB(5,9);
  920 PRINT"Do you want to go on to"
  930 PRINT"     the next program (Y/N)? ";
  940 PROCYN:IF Y%<0 THEN 910
  950 IF Y%=0 THEN 200
  970 CHAIN "ALPHA"
 1000 DEFPROCGETLINE
 1200 KEY%=GET:IF KEY%=130 OR KEY%=13 THEN 1999
 1210 IF KEY%<>127 THEN 1300
 1220 IF IN%=0 THEN 1200
 1230 IN%=IN%-1
 1240 FORJ%=1TOF%(IN%):PRINTCHR$(&7F);:NEXT
 1250 B$=LEFT$(B$,LEN(B$)-f%(IN%)):GOTO1200
 1300 IF LEN(B$)>69 OR KEY%<32 THENVDU7:GOTO1200
 1310 KEY$=CHR$(KEY%):key$=KEY$
 1320 I%=INSTR(";:=?[]{}`_",KEY$):IF I%>0 THEN KEY$=MID$("+*-/()()--",I%,1):key$=KEY$
 1330 IF KEY%>127 THEN KEY%=KEY%-127:KEY$=FUNC$(KEY%):key$=func$(KEY%)
 1340 F%(IN%)=LEN(KEY$):f%(IN%)=LEN(key$)
 1350 IN%=IN%+1:PRINTKEY$;:B$=B$+key$:GOTO1200
 1999 ENDPROC
 2000 DEFFNEVAL(Z$)
 2010 LOCAL X,Y%,Z%
 2020 IF ASC(Z$)=32 THEN Z$=MID$(Z$,2):GOTO2020
 2030 IF Z$="" THEN =0
 2040 FLAG%=0
 2100 REM Check for INV
 2110 Z%=INSTR(Z$,CHR$&89):IF Z%=0 THEN 2200
 2120 REM Check for SIN
 2130 IF MID$(Z$,Z%+1,3)=func$(6) THEN Z$=LEFT$(Z$,Z%-1)+" ASN"+MID$(Z$,Z%+4):GOTO2110
 2140 REM Check for COS
 2150 IF MID$(Z$,Z%+1,3)=func$(7) THEN Z$=LEFT$(Z$,Z%-1)+" ACS"+MID$(Z$,Z%+4):GOTO2110
 2160 REM Check for TAN
 2170 IF MID$(Z$,Z%+1,3)=func$(8) THEN Z$=LEFT$(Z$,Z%-1)+" ATN"+MID$(Z$,Z%+4):GOTO2110
 2180 ER$="INV without SIN,COS or TAN":ERROR
 2200 REM Check for RECALL
 2210 Z%=INSTR(Z$,CHR$&82):IF Z%=0 THEN 2300
 2220 ER$="Number after RECALL out of range"
 2230 Y%=EVAL(MID$(Z$,Z%+1,1)):IF Y%<0 OR Y%>9 THEN ERROR
 2240 X=STORE(Y%)
 2250 Z$=LEFT$(Z$,Z%-1)+STR$(X)+MID$(Z$,Z%+2):GOTO2210
 2300 REM Check for STORE
 2310 Z%=INSTR(Z$,CHR$&81):IF Z%=0 THEN2400
 2320 ER$="Invalid expression after STORE"
 2330 Y%=EVAL(MID$(Z$,Z%+1)):IF Y%<0 OR Y%>9 THEN ERROR
 2340 ER$="Invalid expression before STORE"
 2350 X=EVAL(LEFT$(Z$,Z%-1))
 2360 STORE(Y%)=X:Y$=STR$(Y%):IF MEM$="" THEN 2380
 2370 IF INSTR(MEM$,Y$)>0 THEN 2390
 2380 MEM$=MEM$+"  "+Y$
 2390 =X
 2400 ER$="":=EVAL("0+"+Z$)
 5000 DEFPROCINITIALISE
 5010 DIM FUNC$(10),func$(10),STORE(9),F%(79),f%(79)
 5030 DATA" STORE "," RECALL "," CLEAR ","%","SQR ","SIN ","COS ","TAN ","INV ","^"
 5040 DATA"/100","SQR","SIN","COS","TAN"
 5050 FORI%=1TO10:READ FUNC$(I%):NEXT
 5060 FORI%=1TO10:func$(I%)=CHR$(128+I%):NEXT
 5070 FORI%=4TO8:READ func$(I%):NEXT
 5080 func$(10)="^"
 5100 MEM$=""
 5200 *KEY 0 "|!|@"
 5210 *KEY 1 "|!|A"
 5220 *KEY 2 "|!|B"
 5230 *KEY 3 "|!|C"
 5240 *KEY 4 "|!|D"
 5250 *KEY 5 "|!|E"
 5260 *KEY 6 "|!|F"
 5270 *KEY 7 "|!|G"
 5280 *KEY 8 "|!|H"
 5290 *KEY 9 "|!|I"
 5299 ENDPROC
 6000 DEFPROCINSTRUCTIONS
 6010 PROCSCREEN
 6020 PRINT'"      This program converts your"'"   computer into a simple calculator."'
 6030 PRINT''"      The program makes available the"
 6040 PRINT"   keys 1 - 0 and the full stop key"
 6050 PRINT"   to enter numbers."''
 6060 PRINT"      The keystrokes +, -, *, / are"
 6070 PRINT"   used for the operations of"'"   addition, subtraction,"
 6080 PRINT"   multiplication and division"'"   respectively."
 6090 PROCSPACE
 6100 PROCSCREEN
 6110 PRINT'"      The calculator operates in"'"   algebraic mode, that is, you can"
 6120 PRINT"   type in an expression just as you"'"   would write it."'
 6130 PRINT"      However, multiplication and"'"   division take precedence over"
 6140 PRINT"   addition and subtraction, so that"'"   for example :"'
 6150 PRINTSPC(10)"3/4+5*7.1-6/.2"''SPC(8)"is interpreted as"'
 6160 PRINTSPC(7)"(3/4)+(5*7.1)-(6/.2)"
 6190 PROCSPACE
 6200 PROCSCREEN
 6210 PRINT''"      Round  brackets  ( ) are"'"   available to override the order of"
 6220 PRINT"   execution."''
 6230 PRINT"      Anything in brackets is worked"'"   out before anything else."''
 6240 PRINT"      The  innermost  brackets  are"'"   evaluated first."' 
 6290 PROCSPACE
 6300 PROCSCREEN
 6310 PRINT'"      In  this  program  the red"'"   user-definable keys have special"
 6320 PRINT"   functions, which are:-"'
 6330 PRINT"   f0 - STORE"'"   f1 - RECALL"'"   f2 - CLEAR"'"   f3 - %"
 6340 PRINT"   f4 - SQR (square root)"'"   f5 - SIN (sine of radian angle)"
 6350 PRINT"   f6 - COS (cosine of radian angle)"'"   f7 - TAN (tangent of radian angle)"
 6360 PRINT"   f8 - INV (for inverse"'TAB(13)"trigonometric functions)"
 6370 PRINT"   f9 - ^   (raise to power)"
 6390 PROCSPACE
 6400 PROCSCREEN
 6410 PRINT'"      The  calculator  has  ten"'"   ""memories"", numbered from 0 to 9"
 6420 PRINT"   in each of which can be stored a"'"   number."''
 6430 PRINT"      To  store  the  result  of a"'"   calculation  in  a  memory,  just"
 6440 PRINT"   enter  the  expression  and then"'"   press key f0 (STORE) followed by"
 6450 PRINT"   a number from 0 to 9."'''"      To recall  the  contents  of  a"'"   memory,  press  key  f1 ( RECALL )"
 6460 PRINT"   followed by a  number from 0 to 9."
 6490 PROCSPACE
 6499 ENDPROC
 7000 DEFPROCSCREEN
 7020 VDU26:CLS
 7030 PROCDBL("Calculator Program",10,1)
 7089 REMVDU28,0,24,39,3
 7099 ENDPROC
 8000 DEFPROCDBL(X$,X,Y)
 8010 PRINTTAB(X-1,Y);CHR$(141);X$
 8020 PRINTTAB(X-1,Y+1);CHR$(141);X$
 8099 ENDPROC
 8100 DEFPROCWAIT(X) 
 8110 LOCAL Z
 8120 Z=TIME
 8130 REPEAT UNTIL TIME-Z>X*100
 8199 ENDPROC
 8200 DEFPROCSPACE
 8220 PRINTTAB(3,22);"Press the SPACE BAR to continue";:PROCKCL:PROCOFF
 8240 REPEAT UNTIL GET$=" "
 8299 ENDPROC
 8300 DEFPROCTITLEPAGE
 8310 CLS:PROCDBL("CALCULATOR",13,10)
 8320 PROCOFF:I%=INKEY(500)
 8399 ENDPROC
 8800 DEFPROCKCL
 8810 REPEAT UNTIL INKEY(0)=-1
 8899 ENDPROC
 8900 DEFPROCOFF
 8910 VDU23;8202;0;0;0;:ENDPROC
 8950 DEFPROCON
 8960 VDU23;29194;0;0;0;:ENDPROC
 9200 DEFPROCYN
 9210 Y%=-1
 9220 X%=GET:IF X%=13 AND Y%>=0 THENENDPROC
 9230 X%=X%AND&DF:IFX%<>78ANDX%<>89THEN9220
 9240 Y%=1:IFX%=78THENY%=0
 9250 PRINTCHR$X%;CHR$8;:GOTO9220

 � CALCULATOR
= � Program by Tim Dobson (ACORNSOFT) and Richard G Warner
0 � For BBC Model A Microcomputer 16K Minimum
( � � �Tr@
2 �7
< �:� � �T`C
d �TITLEPAGE
n �INITIALISE
x �INSTRUCTIONS
� �SCREEN
�' �7,4);"Enter your expression now"
� V%=0:B$="":IN%=0:@%=0
,5 �26:� MEM$>"" � �12,20);"Memories in use"''MEM$
6 �28,0,19,39,5:�ON
@ �0,V%);"   ] ";B$;
J �GETLINE:�OFF
T � KEY%=130 � �dH@
^ B=�EVAL(B$)
�$ B$=�(B):F%(0)=�(B$):f%(0)=�(B$)
� �:IN%=1:V%=�:�TlA
  � �=17 � �tDC
* � ER$="" � � � �'ER$;
4
 �tPA
�
 �26:�
� �5,9);
� �"Do you want to go on to"
�& �"     the next program (Y/N)? ";
� �YN:� Y%<0 � �tNC
� � Y%=0 � �dH@
� � "ALPHA"
� ��GETLINE
�' KEY%=�:� KEY%=130 � KEY%=13 � �dOG
� � KEY%<>127 � �TTE
� � IN%=0 � �tpD
� IN%=IN%-1
� �J%=1�F%(IN%):�(&7F);:�
�  B$=�B$,�(B$)-f%(IN%)):�tpD
# � �(B$)>69 � KEY%<32 ��7:�tpD
 KEY$=�(KEY%):key$=KEY$
(G I%=�";:=?[]{}`_",KEY$):� I%>0 � KEY$=�"+*-/()()--",I%,1):key$=KEY$
2A � KEY%>127 � KEY%=KEY%-127:KEY$=FUNC$(KEY%):key$=func$(KEY%)
<$ F%(IN%)=�(KEY$):f%(IN%)=�(key$)
F& IN%=IN%+1:�KEY$;:B$=B$+key$:�tpD
� �
� ݤEVAL(Z$)
� � X,Y%,Z%
�! � �(Z$)=32 � Z$=�Z$,2):�ddG
� � Z$="" � =0
� FLAG%=0
4 � Check for INV
> Z%=�Z$,�&89):� Z%=0 � �tXH
H � Check for SIN
RA � �Z$,Z%+1,3)=func$(6) � Z$=�Z$,Z%-1)+" ASN"+�Z$,Z%+4):�T~H
\ � Check for COS
fA � �Z$,Z%+1,3)=func$(7) � Z$=�Z$,Z%-1)+" ACS"+�Z$,Z%+4):�T~H
p � Check for TAN
zA � �Z$,Z%+1,3)=func$(8) � Z$=�Z$,Z%-1)+" ATN"+�Z$,Z%+4):�T~H
�' ER$="INV without SIN,COS or TAN":�
� � Check for RECALL
� Z%=�Z$,�&82):� Z%=0 � �d|H
�+ ER$="Number after RECALL out of range"
�( Y%=�(�Z$,Z%+1,1)):� Y%<0 � Y%>9 � �
� X=STORE(Y%)
�& Z$=�Z$,Z%-1)+�(X)+�Z$,Z%+2):�tbH
� � Check for STORE
	 Z%=�Z$,�&81):� Z%=0 ��D`I
	) ER$="Invalid expression after STORE"
	& Y%=�(�Z$,Z%+1)):� Y%<0 � Y%>9 � �
	$* ER$="Invalid expression before STORE"
	. X=�(�Z$,Z%-1))
	8* STORE(Y%)=X:Y$=�(Y%):� MEM$="" � �DLI
	B � �MEM$,Y$)>0 � �DVI
	L MEM$=MEM$+"  "+Y$
	V =X
	` ER$="":=�("0+"+Z$)
� ��INITIALISE
�1 � FUNC$(10),func$(10),STORE(9),F%(79),f%(79)
�O �" STORE "," RECALL "," CLEAR ","%","SQR ","SIN ","COS ","TAN ","INV ","^"
�$ �"/100","SQR","SIN","COS","TAN"
� �I%=1�10:� FUNC$(I%):�
�# �I%=1�10:func$(I%)=�(128+I%):�
� �I%=4�8:� func$(I%):�
� func$(10)="^"
� MEM$=""
P *KEY 0 "|!|@"
Z *KEY 1 "|!|A"
d *KEY 2 "|!|B"
n *KEY 3 "|!|C"
x *KEY 4 "|!|D"
� *KEY 5 "|!|E"
� *KEY 6 "|!|F"
� *KEY 7 "|!|G"
� *KEY 8 "|!|H"
� *KEY 9 "|!|I"
� �
p ��INSTRUCTIONS
z �SCREEN
�R �'"      This program converts your"'"   computer into a simple calculator."'
�/ �''"      The program makes available the"
�+ �"   keys 1 - 0 and the full stop key"
� �"   to enter numbers."''
�+ �"      The keystrokes +, -, *, / are"
�A �"   used for the operations of"'"   addition, subtraction,"
�9 �"   multiplication and division"'"   respectively."
� �SPACE
� �SCREEN
�O �'"      The calculator operates in"'"   algebraic mode, that is, you can"
�B �"   type in an expression just as you"'"   would write it."'
�L �"      However, multiplication and"'"   division take precedence over"
�@ �"   addition and subtraction, so that"'"   for example :"'
5 �(10)"3/4+5*7.1-6/.2"''�(8)"is interpreted as"'
  �(7)"(3/4)+(5*7.1)-(6/.2)"
. �SPACE
8 �SCREEN
BP �''"      Round  brackets  ( ) are"'"   available to override the order of"
L �"   execution."''
VM �"      Anything in brackets is worked"'"   out before anything else."''
`C �"      The  innermost  brackets  are"'"   evaluated first."' 
� �SPACE
� �SCREEN
�O �'"      In  this  program  the red"'"   user-definable keys have special"
�" �"   functions, which are:-"'
�B �"   f0 - STORE"'"   f1 - RECALL"'"   f2 - CLEAR"'"   f3 - %"
�F �"   f4 - SQR (square root)"'"   f5 - SIN (sine of radian angle)"
�T �"   f6 - COS (cosine of radian angle)"'"   f7 - TAN (tangent of radian angle)"
�? �"   f8 - INV (for inverse"'�13)"trigonometric functions)"
�$ �"   f9 - ^   (raise to power)"
� �SPACE
 �SCREEN

P �'"      The  calculator  has  ten"'"   ""memories"", numbered from 0 to 9"
: �"   in each of which can be stored a"'"   number."''
Q �"      To  store  the  result  of a"'"   calculation  in  a  memory,  just"
(Q �"   enter  the  expression  and then"'"   press key f0 (STORE) followed by"
2r �"   a number from 0 to 9."'''"      To recall  the  contents  of  a"'"   memory,  press  key  f1 ( RECALL )"
<- �"   followed by a  number from 0 to 9."
Z �SPACE
c �
X
 ��SCREEN
l
 �26:�
v$ �DBL("Calculator Program",10,1)
� �VDU28,0,24,39,3
� �
@ ��DBL(X$,X,Y)
J �X-1,Y);�(141);X$
T �X-1,Y+1);�(141);X$
� �
� ��WAIT(X) 
� � Z
� Z=�
� � � �-Z>X*100
  �
  ��SPACE
 9 �3,22);"Press the SPACE BAR to continue";:�KCL:�OFF
 0 � � �=" "
 k �
 l ��TITLEPAGE
 v �:�DBL("CALCULATOR",13,10)
 � �OFF:I%=�(500)
 � �
"`
 ��KCL
"j � � �(0)=-1
"� �
"�
 ��OFF
"� �23;8202;0;0;0;:�
"�	 ��ON
# �23;29194;0;0;0;:�
#�	 ��YN
#�
 Y%=-1
$ X%=�:� X%=13 � Y%>=0 ��
$" X%=X%�&DF:�X%<>78�X%<>89��TDd
$ Y%=1:�X%=78�Y%=0
$" �X%;�8;:�TDd
�
00000000  0d 00 0a 11 20 f4 20 43  41 4c 43 55 4c 41 54 4f  |.... . CALCULATO|
00000010  52 0d 00 0c 3d 20 f4 20  50 72 6f 67 72 61 6d 20  |R...= . Program |
00000020  62 79 20 54 69 6d 20 44  6f 62 73 6f 6e 20 28 41  |by Tim Dobson (A|
00000030  43 4f 52 4e 53 4f 46 54  29 20 61 6e 64 20 52 69  |CORNSOFT) and Ri|
00000040  63 68 61 72 64 20 47 20  57 61 72 6e 65 72 0d 00  |chard G Warner..|
00000050  0e 30 20 f4 20 46 6f 72  20 42 42 43 20 4d 6f 64  |.0 . For BBC Mod|
00000060  65 6c 20 41 20 4d 69 63  72 6f 63 6f 6d 70 75 74  |el A Microcomput|
00000070  65 72 20 31 36 4b 20 4d  69 6e 69 6d 75 6d 0d 00  |er 16K Minimum..|
00000080  28 0e 20 ee 20 85 20 e5  8d 54 72 40 0d 00 32 07  |(. . . ..Tr@..2.|
00000090  20 eb 37 0d 00 3c 10 20  db 3a ee 20 85 20 e5 8d  | .7..<. .:. . ..|
000000a0  54 60 43 0d 00 64 0f 20  f2 54 49 54 4c 45 50 41  |T`C..d. .TITLEPA|
000000b0  47 45 0d 00 6e 10 20 f2  49 4e 49 54 49 41 4c 49  |GE..n. .INITIALI|
000000c0  53 45 0d 00 78 12 20 f2  49 4e 53 54 52 55 43 54  |SE..x. .INSTRUCT|
000000d0  49 4f 4e 53 0d 00 c8 0c  20 f2 53 43 52 45 45 4e  |IONS.... .SCREEN|
000000e0  0d 00 d2 27 20 f1 8a 37  2c 34 29 3b 22 45 6e 74  |...' ..7,4);"Ent|
000000f0  65 72 20 79 6f 75 72 20  65 78 70 72 65 73 73 69  |er your expressi|
00000100  6f 6e 20 6e 6f 77 22 0d  00 dc 1a 20 56 25 3d 30  |on now".... V%=0|
00000110  3a 42 24 3d 22 22 3a 49  4e 25 3d 30 3a 40 25 3d  |:B$="":IN%=0:@%=|
00000120  30 0d 01 2c 35 20 ef 32  36 3a e7 20 4d 45 4d 24  |0..,5 .26:. MEM$|
00000130  3e 22 22 20 8c 20 f1 8a  31 32 2c 32 30 29 3b 22  |>"" . ..12,20);"|
00000140  4d 65 6d 6f 72 69 65 73  20 69 6e 20 75 73 65 22  |Memories in use"|
00000150  27 27 4d 45 4d 24 0d 01  36 16 20 ef 32 38 2c 30  |''MEM$..6. .28,0|
00000160  2c 31 39 2c 33 39 2c 35  3a f2 4f 4e 0d 01 40 18  |,19,39,5:.ON..@.|
00000170  20 f1 8a 30 2c 56 25 29  3b 22 20 20 20 5d 20 22  | ..0,V%);"   ] "|
00000180  3b 42 24 3b 0d 01 4a 12  20 f2 47 45 54 4c 49 4e  |;B$;..J. .GETLIN|
00000190  45 3a f2 4f 46 46 0d 01  54 16 20 e7 20 4b 45 59  |E:.OFF..T. . KEY|
000001a0  25 3d 31 33 30 20 8c 20  8d 64 48 40 0d 01 5e 10  |%=130 . .dH@..^.|
000001b0  20 42 3d a4 45 56 41 4c  28 42 24 29 0d 01 90 24  | B=.EVAL(B$)...$|
000001c0  20 42 24 3d c3 28 42 29  3a 46 25 28 30 29 3d a9  | B$=.(B):F%(0)=.|
000001d0  28 42 24 29 3a 66 25 28  30 29 3d a9 28 42 24 29  |(B$):f%(0)=.(B$)|
000001e0  0d 01 9a 17 20 f1 3a 49  4e 25 3d 31 3a 56 25 3d  |.... .:IN%=1:V%=|
000001f0  bc 3a e5 8d 54 6c 41 0d  03 20 12 20 e7 20 9f 3d  |.:..TlA.. . . .=|
00000200  31 37 20 8c 20 8d 74 44  43 0d 03 2a 1a 20 e7 20  |17 . .tDC..*. . |
00000210  45 52 24 3d 22 22 20 8c  20 f6 20 8b 20 f1 27 45  |ER$="" . . . .'E|
00000220  52 24 3b 0d 03 34 0a 20  e5 8d 74 50 41 0d 03 84  |R$;..4. ..tPA...|
00000230  0a 20 ef 32 36 3a db 0d  03 8e 0c 20 f1 8a 35 2c  |. .26:..... ..5,|
00000240  39 29 3b 0d 03 98 1f 20  f1 22 44 6f 20 79 6f 75  |9);.... ."Do you|
00000250  20 77 61 6e 74 20 74 6f  20 67 6f 20 6f 6e 20 74  | want to go on t|
00000260  6f 22 0d 03 a2 26 20 f1  22 20 20 20 20 20 74 68  |o"...& ."     th|
00000270  65 20 6e 65 78 74 20 70  72 6f 67 72 61 6d 20 28  |e next program (|
00000280  59 2f 4e 29 3f 20 22 3b  0d 03 ac 16 20 f2 59 4e  |Y/N)? ";.... .YN|
00000290  3a e7 20 59 25 3c 30 20  8c 20 8d 74 4e 43 0d 03  |:. Y%<0 . .tNC..|
000002a0  b6 12 20 e7 20 59 25 3d  30 20 8c 20 8d 64 48 40  |.. . Y%=0 . .dH@|
000002b0  0d 03 ca 0e 20 d7 20 22  41 4c 50 48 41 22 0d 03  |.... . "ALPHA"..|
000002c0  e8 0e 20 dd f2 47 45 54  4c 49 4e 45 0d 04 b0 27  |.. ..GETLINE...'|
000002d0  20 4b 45 59 25 3d a5 3a  e7 20 4b 45 59 25 3d 31  | KEY%=.:. KEY%=1|
000002e0  33 30 20 84 20 4b 45 59  25 3d 31 33 20 8c 20 8d  |30 . KEY%=13 . .|
000002f0  64 4f 47 0d 04 ba 17 20  e7 20 4b 45 59 25 3c 3e  |dOG.... . KEY%<>|
00000300  31 32 37 20 8c 20 8d 54  54 45 0d 04 c4 13 20 e7  |127 . .TTE.... .|
00000310  20 49 4e 25 3d 30 20 8c  20 8d 74 70 44 0d 04 ce  | IN%=0 . .tpD...|
00000320  0e 20 49 4e 25 3d 49 4e  25 2d 31 0d 04 d8 1d 20  |. IN%=IN%-1.... |
00000330  e3 4a 25 3d 31 b8 46 25  28 49 4e 25 29 3a f1 bd  |.J%=1.F%(IN%):..|
00000340  28 26 37 46 29 3b 3a ed  0d 04 e2 20 20 42 24 3d  |(&7F);:....  B$=|
00000350  c0 42 24 2c a9 28 42 24  29 2d 66 25 28 49 4e 25  |.B$,.(B$)-f%(IN%|
00000360  29 29 3a e5 8d 74 70 44  0d 05 14 23 20 e7 20 a9  |)):..tpD...# . .|
00000370  28 42 24 29 3e 36 39 20  84 20 4b 45 59 25 3c 33  |(B$)>69 . KEY%<3|
00000380  32 20 8c ef 37 3a e5 8d  74 70 44 0d 05 1e 1b 20  |2 ..7:..tpD.... |
00000390  4b 45 59 24 3d bd 28 4b  45 59 25 29 3a 6b 65 79  |KEY$=.(KEY%):key|
000003a0  24 3d 4b 45 59 24 0d 05  28 47 20 49 25 3d a7 22  |$=KEY$..(G I%=."|
000003b0  3b 3a 3d 3f 5b 5d 7b 7d  60 5f 22 2c 4b 45 59 24  |;:=?[]{}`_",KEY$|
000003c0  29 3a e7 20 49 25 3e 30  20 8c 20 4b 45 59 24 3d  |):. I%>0 . KEY$=|
000003d0  c1 22 2b 2a 2d 2f 28 29  28 29 2d 2d 22 2c 49 25  |."+*-/()()--",I%|
000003e0  2c 31 29 3a 6b 65 79 24  3d 4b 45 59 24 0d 05 32  |,1):key$=KEY$..2|
000003f0  41 20 e7 20 4b 45 59 25  3e 31 32 37 20 8c 20 4b  |A . KEY%>127 . K|
00000400  45 59 25 3d 4b 45 59 25  2d 31 32 37 3a 4b 45 59  |EY%=KEY%-127:KEY|
00000410  24 3d 46 55 4e 43 24 28  4b 45 59 25 29 3a 6b 65  |$=FUNC$(KEY%):ke|
00000420  79 24 3d 66 75 6e 63 24  28 4b 45 59 25 29 0d 05  |y$=func$(KEY%)..|
00000430  3c 24 20 46 25 28 49 4e  25 29 3d a9 28 4b 45 59  |<$ F%(IN%)=.(KEY|
00000440  24 29 3a 66 25 28 49 4e  25 29 3d a9 28 6b 65 79  |$):f%(IN%)=.(key|
00000450  24 29 0d 05 46 26 20 49  4e 25 3d 49 4e 25 2b 31  |$)..F& IN%=IN%+1|
00000460  3a f1 4b 45 59 24 3b 3a  42 24 3d 42 24 2b 6b 65  |:.KEY$;:B$=B$+ke|
00000470  79 24 3a e5 8d 74 70 44  0d 07 cf 06 20 e1 0d 07  |y$:..tpD.... ...|
00000480  d0 0f 20 dd a4 45 56 41  4c 28 5a 24 29 0d 07 da  |.. ..EVAL(Z$)...|
00000490  0e 20 ea 20 58 2c 59 25  2c 5a 25 0d 07 e4 21 20  |. . X,Y%,Z%...! |
000004a0  e7 20 97 28 5a 24 29 3d  33 32 20 8c 20 5a 24 3d  |. .(Z$)=32 . Z$=|
000004b0  c1 5a 24 2c 32 29 3a e5  8d 64 64 47 0d 07 ee 11  |.Z$,2):..ddG....|
000004c0  20 e7 20 5a 24 3d 22 22  20 8c 20 3d 30 0d 07 f8  | . Z$="" . =0...|
000004d0  0c 20 46 4c 41 47 25 3d  30 0d 08 34 14 20 f4 20  |. FLAG%=0..4. . |
000004e0  43 68 65 63 6b 20 66 6f  72 20 49 4e 56 0d 08 3e  |Check for INV..>|
000004f0  1f 20 5a 25 3d a7 5a 24  2c bd 26 38 39 29 3a e7  |. Z%=.Z$,.&89):.|
00000500  20 5a 25 3d 30 20 8c 20  8d 74 58 48 0d 08 48 14  | Z%=0 . .tXH..H.|
00000510  20 f4 20 43 68 65 63 6b  20 66 6f 72 20 53 49 4e  | . Check for SIN|
00000520  0d 08 52 41 20 e7 20 c1  5a 24 2c 5a 25 2b 31 2c  |..RA . .Z$,Z%+1,|
00000530  33 29 3d 66 75 6e 63 24  28 36 29 20 8c 20 5a 24  |3)=func$(6) . Z$|
00000540  3d c0 5a 24 2c 5a 25 2d  31 29 2b 22 20 41 53 4e  |=.Z$,Z%-1)+" ASN|
00000550  22 2b c1 5a 24 2c 5a 25  2b 34 29 3a e5 8d 54 7e  |"+.Z$,Z%+4):..T~|
00000560  48 0d 08 5c 14 20 f4 20  43 68 65 63 6b 20 66 6f  |H..\. . Check fo|
00000570  72 20 43 4f 53 0d 08 66  41 20 e7 20 c1 5a 24 2c  |r COS..fA . .Z$,|
00000580  5a 25 2b 31 2c 33 29 3d  66 75 6e 63 24 28 37 29  |Z%+1,3)=func$(7)|
00000590  20 8c 20 5a 24 3d c0 5a  24 2c 5a 25 2d 31 29 2b  | . Z$=.Z$,Z%-1)+|
000005a0  22 20 41 43 53 22 2b c1  5a 24 2c 5a 25 2b 34 29  |" ACS"+.Z$,Z%+4)|
000005b0  3a e5 8d 54 7e 48 0d 08  70 14 20 f4 20 43 68 65  |:..T~H..p. . Che|
000005c0  63 6b 20 66 6f 72 20 54  41 4e 0d 08 7a 41 20 e7  |ck for TAN..zA .|
000005d0  20 c1 5a 24 2c 5a 25 2b  31 2c 33 29 3d 66 75 6e  | .Z$,Z%+1,3)=fun|
000005e0  63 24 28 38 29 20 8c 20  5a 24 3d c0 5a 24 2c 5a  |c$(8) . Z$=.Z$,Z|
000005f0  25 2d 31 29 2b 22 20 41  54 4e 22 2b c1 5a 24 2c  |%-1)+" ATN"+.Z$,|
00000600  5a 25 2b 34 29 3a e5 8d  54 7e 48 0d 08 84 27 20  |Z%+4):..T~H...' |
00000610  45 52 24 3d 22 49 4e 56  20 77 69 74 68 6f 75 74  |ER$="INV without|
00000620  20 53 49 4e 2c 43 4f 53  20 6f 72 20 54 41 4e 22  | SIN,COS or TAN"|
00000630  3a 85 0d 08 98 17 20 f4  20 43 68 65 63 6b 20 66  |:..... . Check f|
00000640  6f 72 20 52 45 43 41 4c  4c 0d 08 a2 1f 20 5a 25  |or RECALL.... Z%|
00000650  3d a7 5a 24 2c bd 26 38  32 29 3a e7 20 5a 25 3d  |=.Z$,.&82):. Z%=|
00000660  30 20 8c 20 8d 64 7c 48  0d 08 ac 2b 20 45 52 24  |0 . .d|H...+ ER$|
00000670  3d 22 4e 75 6d 62 65 72  20 61 66 74 65 72 20 52  |="Number after R|
00000680  45 43 41 4c 4c 20 6f 75  74 20 6f 66 20 72 61 6e  |ECALL out of ran|
00000690  67 65 22 0d 08 b6 28 20  59 25 3d a0 28 c1 5a 24  |ge"...( Y%=.(.Z$|
000006a0  2c 5a 25 2b 31 2c 31 29  29 3a e7 20 59 25 3c 30  |,Z%+1,1)):. Y%<0|
000006b0  20 84 20 59 25 3e 39 20  8c 20 85 0d 08 c0 10 20  | . Y%>9 . ..... |
000006c0  58 3d 53 54 4f 52 45 28  59 25 29 0d 08 ca 26 20  |X=STORE(Y%)...& |
000006d0  5a 24 3d c0 5a 24 2c 5a  25 2d 31 29 2b c3 28 58  |Z$=.Z$,Z%-1)+.(X|
000006e0  29 2b c1 5a 24 2c 5a 25  2b 32 29 3a e5 8d 74 62  |)+.Z$,Z%+2):..tb|
000006f0  48 0d 08 fc 16 20 f4 20  43 68 65 63 6b 20 66 6f  |H.... . Check fo|
00000700  72 20 53 54 4f 52 45 0d  09 06 1e 20 5a 25 3d a7  |r STORE.... Z%=.|
00000710  5a 24 2c bd 26 38 31 29  3a e7 20 5a 25 3d 30 20  |Z$,.&81):. Z%=0 |
00000720  8c 8d 44 60 49 0d 09 10  29 20 45 52 24 3d 22 49  |..D`I...) ER$="I|
00000730  6e 76 61 6c 69 64 20 65  78 70 72 65 73 73 69 6f  |nvalid expressio|
00000740  6e 20 61 66 74 65 72 20  53 54 4f 52 45 22 0d 09  |n after STORE"..|
00000750  1a 26 20 59 25 3d a0 28  c1 5a 24 2c 5a 25 2b 31  |.& Y%=.(.Z$,Z%+1|
00000760  29 29 3a e7 20 59 25 3c  30 20 84 20 59 25 3e 39  |)):. Y%<0 . Y%>9|
00000770  20 8c 20 85 0d 09 24 2a  20 45 52 24 3d 22 49 6e  | . ...$* ER$="In|
00000780  76 61 6c 69 64 20 65 78  70 72 65 73 73 69 6f 6e  |valid expression|
00000790  20 62 65 66 6f 72 65 20  53 54 4f 52 45 22 0d 09  | before STORE"..|
000007a0  2e 13 20 58 3d a0 28 c0  5a 24 2c 5a 25 2d 31 29  |.. X=.(.Z$,Z%-1)|
000007b0  29 0d 09 38 2a 20 53 54  4f 52 45 28 59 25 29 3d  |)..8* STORE(Y%)=|
000007c0  58 3a 59 24 3d c3 28 59  25 29 3a e7 20 4d 45 4d  |X:Y$=.(Y%):. MEM|
000007d0  24 3d 22 22 20 8c 20 8d  44 4c 49 0d 09 42 19 20  |$="" . .DLI..B. |
000007e0  e7 20 a7 4d 45 4d 24 2c  59 24 29 3e 30 20 8c 20  |. .MEM$,Y$)>0 . |
000007f0  8d 44 56 49 0d 09 4c 16  20 4d 45 4d 24 3d 4d 45  |.DVI..L. MEM$=ME|
00000800  4d 24 2b 22 20 20 22 2b  59 24 0d 09 56 07 20 3d  |M$+"  "+Y$..V. =|
00000810  58 0d 09 60 17 20 45 52  24 3d 22 22 3a 3d a0 28  |X..`. ER$="":=.(|
00000820  22 30 2b 22 2b 5a 24 29  0d 13 88 11 20 dd f2 49  |"0+"+Z$).... ..I|
00000830  4e 49 54 49 41 4c 49 53  45 0d 13 92 31 20 de 20  |NITIALISE...1 . |
00000840  46 55 4e 43 24 28 31 30  29 2c 66 75 6e 63 24 28  |FUNC$(10),func$(|
00000850  31 30 29 2c 53 54 4f 52  45 28 39 29 2c 46 25 28  |10),STORE(9),F%(|
00000860  37 39 29 2c 66 25 28 37  39 29 0d 13 a6 4f 20 dc  |79),f%(79)...O .|
00000870  22 20 53 54 4f 52 45 20  22 2c 22 20 52 45 43 41  |" STORE "," RECA|
00000880  4c 4c 20 22 2c 22 20 43  4c 45 41 52 20 22 2c 22  |LL "," CLEAR ","|
00000890  25 22 2c 22 53 51 52 20  22 2c 22 53 49 4e 20 22  |%","SQR ","SIN "|
000008a0  2c 22 43 4f 53 20 22 2c  22 54 41 4e 20 22 2c 22  |,"COS ","TAN ","|
000008b0  49 4e 56 20 22 2c 22 5e  22 0d 13 b0 24 20 dc 22  |INV ","^"...$ ."|
000008c0  2f 31 30 30 22 2c 22 53  51 52 22 2c 22 53 49 4e  |/100","SQR","SIN|
000008d0  22 2c 22 43 4f 53 22 2c  22 54 41 4e 22 0d 13 ba  |","COS","TAN"...|
000008e0  1b 20 e3 49 25 3d 31 b8  31 30 3a f3 20 46 55 4e  |. .I%=1.10:. FUN|
000008f0  43 24 28 49 25 29 3a ed  0d 13 c4 23 20 e3 49 25  |C$(I%):....# .I%|
00000900  3d 31 b8 31 30 3a 66 75  6e 63 24 28 49 25 29 3d  |=1.10:func$(I%)=|
00000910  bd 28 31 32 38 2b 49 25  29 3a ed 0d 13 ce 1a 20  |.(128+I%):..... |
00000920  e3 49 25 3d 34 b8 38 3a  f3 20 66 75 6e 63 24 28  |.I%=4.8:. func$(|
00000930  49 25 29 3a ed 0d 13 d8  12 20 66 75 6e 63 24 28  |I%):..... func$(|
00000940  31 30 29 3d 22 5e 22 0d  13 ec 0c 20 4d 45 4d 24  |10)="^".... MEM$|
00000950  3d 22 22 0d 14 50 12 20  2a 4b 45 59 20 30 20 22  |=""..P. *KEY 0 "|
00000960  7c 21 7c 40 22 0d 14 5a  12 20 2a 4b 45 59 20 31  ||!|@"..Z. *KEY 1|
00000970  20 22 7c 21 7c 41 22 0d  14 64 12 20 2a 4b 45 59  | "|!|A"..d. *KEY|
00000980  20 32 20 22 7c 21 7c 42  22 0d 14 6e 12 20 2a 4b  | 2 "|!|B"..n. *K|
00000990  45 59 20 33 20 22 7c 21  7c 43 22 0d 14 78 12 20  |EY 3 "|!|C"..x. |
000009a0  2a 4b 45 59 20 34 20 22  7c 21 7c 44 22 0d 14 82  |*KEY 4 "|!|D"...|
000009b0  12 20 2a 4b 45 59 20 35  20 22 7c 21 7c 45 22 0d  |. *KEY 5 "|!|E".|
000009c0  14 8c 12 20 2a 4b 45 59  20 36 20 22 7c 21 7c 46  |... *KEY 6 "|!|F|
000009d0  22 0d 14 96 12 20 2a 4b  45 59 20 37 20 22 7c 21  |".... *KEY 7 "|!|
000009e0  7c 47 22 0d 14 a0 12 20  2a 4b 45 59 20 38 20 22  ||G".... *KEY 8 "|
000009f0  7c 21 7c 48 22 0d 14 aa  12 20 2a 4b 45 59 20 39  ||!|H".... *KEY 9|
00000a00  20 22 7c 21 7c 49 22 0d  14 b3 06 20 e1 0d 17 70  | "|!|I".... ...p|
00000a10  13 20 dd f2 49 4e 53 54  52 55 43 54 49 4f 4e 53  |. ..INSTRUCTIONS|
00000a20  0d 17 7a 0c 20 f2 53 43  52 45 45 4e 0d 17 84 52  |..z. .SCREEN...R|
00000a30  20 f1 27 22 20 20 20 20  20 20 54 68 69 73 20 70  | .'"      This p|
00000a40  72 6f 67 72 61 6d 20 63  6f 6e 76 65 72 74 73 20  |rogram converts |
00000a50  79 6f 75 72 22 27 22 20  20 20 63 6f 6d 70 75 74  |your"'"   comput|
00000a60  65 72 20 69 6e 74 6f 20  61 20 73 69 6d 70 6c 65  |er into a simple|
00000a70  20 63 61 6c 63 75 6c 61  74 6f 72 2e 22 27 0d 17  | calculator."'..|
00000a80  8e 2f 20 f1 27 27 22 20  20 20 20 20 20 54 68 65  |./ .''"      The|
00000a90  20 70 72 6f 67 72 61 6d  20 6d 61 6b 65 73 20 61  | program makes a|
00000aa0  76 61 69 6c 61 62 6c 65  20 74 68 65 22 0d 17 98  |vailable the"...|
00000ab0  2b 20 f1 22 20 20 20 6b  65 79 73 20 31 20 2d 20  |+ ."   keys 1 - |
00000ac0  30 20 61 6e 64 20 74 68  65 20 66 75 6c 6c 20 73  |0 and the full s|
00000ad0  74 6f 70 20 6b 65 79 22  0d 17 a2 1e 20 f1 22 20  |top key".... ." |
00000ae0  20 20 74 6f 20 65 6e 74  65 72 20 6e 75 6d 62 65  |  to enter numbe|
00000af0  72 73 2e 22 27 27 0d 17  ac 2b 20 f1 22 20 20 20  |rs."''...+ ."   |
00000b00  20 20 20 54 68 65 20 6b  65 79 73 74 72 6f 6b 65  |   The keystroke|
00000b10  73 20 2b 2c 20 2d 2c 20  2a 2c 20 2f 20 61 72 65  |s +, -, *, / are|
00000b20  22 0d 17 b6 41 20 f1 22  20 20 20 75 73 65 64 20  |"...A ."   used |
00000b30  66 6f 72 20 74 68 65 20  6f 70 65 72 61 74 69 6f  |for the operatio|
00000b40  6e 73 20 6f 66 22 27 22  20 20 20 61 64 64 69 74  |ns of"'"   addit|
00000b50  69 6f 6e 2c 20 73 75 62  74 72 61 63 74 69 6f 6e  |ion, subtraction|
00000b60  2c 22 0d 17 c0 39 20 f1  22 20 20 20 6d 75 6c 74  |,"...9 ."   mult|
00000b70  69 70 6c 69 63 61 74 69  6f 6e 20 61 6e 64 20 64  |iplication and d|
00000b80  69 76 69 73 69 6f 6e 22  27 22 20 20 20 72 65 73  |ivision"'"   res|
00000b90  70 65 63 74 69 76 65 6c  79 2e 22 0d 17 ca 0b 20  |pectively.".... |
00000ba0  f2 53 50 41 43 45 0d 17  d4 0c 20 f2 53 43 52 45  |.SPACE.... .SCRE|
00000bb0  45 4e 0d 17 de 4f 20 f1  27 22 20 20 20 20 20 20  |EN...O .'"      |
00000bc0  54 68 65 20 63 61 6c 63  75 6c 61 74 6f 72 20 6f  |The calculator o|
00000bd0  70 65 72 61 74 65 73 20  69 6e 22 27 22 20 20 20  |perates in"'"   |
00000be0  61 6c 67 65 62 72 61 69  63 20 6d 6f 64 65 2c 20  |algebraic mode, |
00000bf0  74 68 61 74 20 69 73 2c  20 79 6f 75 20 63 61 6e  |that is, you can|
00000c00  22 0d 17 e8 42 20 f1 22  20 20 20 74 79 70 65 20  |"...B ."   type |
00000c10  69 6e 20 61 6e 20 65 78  70 72 65 73 73 69 6f 6e  |in an expression|
00000c20  20 6a 75 73 74 20 61 73  20 79 6f 75 22 27 22 20  | just as you"'" |
00000c30  20 20 77 6f 75 6c 64 20  77 72 69 74 65 20 69 74  |  would write it|
00000c40  2e 22 27 0d 17 f2 4c 20  f1 22 20 20 20 20 20 20  |."'...L ."      |
00000c50  48 6f 77 65 76 65 72 2c  20 6d 75 6c 74 69 70 6c  |However, multipl|
00000c60  69 63 61 74 69 6f 6e 20  61 6e 64 22 27 22 20 20  |ication and"'"  |
00000c70  20 64 69 76 69 73 69 6f  6e 20 74 61 6b 65 20 70  | division take p|
00000c80  72 65 63 65 64 65 6e 63  65 20 6f 76 65 72 22 0d  |recedence over".|
00000c90  17 fc 40 20 f1 22 20 20  20 61 64 64 69 74 69 6f  |..@ ."   additio|
00000ca0  6e 20 61 6e 64 20 73 75  62 74 72 61 63 74 69 6f  |n and subtractio|
00000cb0  6e 2c 20 73 6f 20 74 68  61 74 22 27 22 20 20 20  |n, so that"'"   |
00000cc0  66 6f 72 20 65 78 61 6d  70 6c 65 20 3a 22 27 0d  |for example :"'.|
00000cd0  18 06 35 20 f1 89 28 31  30 29 22 33 2f 34 2b 35  |..5 ..(10)"3/4+5|
00000ce0  2a 37 2e 31 2d 36 2f 2e  32 22 27 27 89 28 38 29  |*7.1-6/.2"''.(8)|
00000cf0  22 69 73 20 69 6e 74 65  72 70 72 65 74 65 64 20  |"is interpreted |
00000d00  61 73 22 27 0d 18 10 20  20 f1 89 28 37 29 22 28  |as"'...  ..(7)"(|
00000d10  33 2f 34 29 2b 28 35 2a  37 2e 31 29 2d 28 36 2f  |3/4)+(5*7.1)-(6/|
00000d20  2e 32 29 22 0d 18 2e 0b  20 f2 53 50 41 43 45 0d  |.2)".... .SPACE.|
00000d30  18 38 0c 20 f2 53 43 52  45 45 4e 0d 18 42 50 20  |.8. .SCREEN..BP |
00000d40  f1 27 27 22 20 20 20 20  20 20 52 6f 75 6e 64 20  |.''"      Round |
00000d50  20 62 72 61 63 6b 65 74  73 20 20 28 20 29 20 61  | brackets  ( ) a|
00000d60  72 65 22 27 22 20 20 20  61 76 61 69 6c 61 62 6c  |re"'"   availabl|
00000d70  65 20 74 6f 20 6f 76 65  72 72 69 64 65 20 74 68  |e to override th|
00000d80  65 20 6f 72 64 65 72 20  6f 66 22 0d 18 4c 17 20  |e order of"..L. |
00000d90  f1 22 20 20 20 65 78 65  63 75 74 69 6f 6e 2e 22  |."   execution."|
00000da0  27 27 0d 18 56 4d 20 f1  22 20 20 20 20 20 20 41  |''..VM ."      A|
00000db0  6e 79 74 68 69 6e 67 20  69 6e 20 62 72 61 63 6b  |nything in brack|
00000dc0  65 74 73 20 69 73 20 77  6f 72 6b 65 64 22 27 22  |ets is worked"'"|
00000dd0  20 20 20 6f 75 74 20 62  65 66 6f 72 65 20 61 6e  |   out before an|
00000de0  79 74 68 69 6e 67 20 65  6c 73 65 2e 22 27 27 0d  |ything else."''.|
00000df0  18 60 43 20 f1 22 20 20  20 20 20 20 54 68 65 20  |.`C ."      The |
00000e00  20 69 6e 6e 65 72 6d 6f  73 74 20 20 62 72 61 63  | innermost  brac|
00000e10  6b 65 74 73 20 20 61 72  65 22 27 22 20 20 20 65  |kets  are"'"   e|
00000e20  76 61 6c 75 61 74 65 64  20 66 69 72 73 74 2e 22  |valuated first."|
00000e30  27 20 0d 18 92 0b 20 f2  53 50 41 43 45 0d 18 9c  |' .... .SPACE...|
00000e40  0c 20 f2 53 43 52 45 45  4e 0d 18 a6 4f 20 f1 27  |. .SCREEN...O .'|
00000e50  22 20 20 20 20 20 20 49  6e 20 20 74 68 69 73 20  |"      In  this |
00000e60  20 70 72 6f 67 72 61 6d  20 20 74 68 65 20 72 65  | program  the re|
00000e70  64 22 27 22 20 20 20 75  73 65 72 2d 64 65 66 69  |d"'"   user-defi|
00000e80  6e 61 62 6c 65 20 6b 65  79 73 20 68 61 76 65 20  |nable keys have |
00000e90  73 70 65 63 69 61 6c 22  0d 18 b0 22 20 f1 22 20  |special"..." ." |
00000ea0  20 20 66 75 6e 63 74 69  6f 6e 73 2c 20 77 68 69  |  functions, whi|
00000eb0  63 68 20 61 72 65 3a 2d  22 27 0d 18 ba 42 20 f1  |ch are:-"'...B .|
00000ec0  22 20 20 20 66 30 20 2d  20 53 54 4f 52 45 22 27  |"   f0 - STORE"'|
00000ed0  22 20 20 20 66 31 20 2d  20 52 45 43 41 4c 4c 22  |"   f1 - RECALL"|
00000ee0  27 22 20 20 20 66 32 20  2d 20 43 4c 45 41 52 22  |'"   f2 - CLEAR"|
00000ef0  27 22 20 20 20 66 33 20  2d 20 25 22 0d 18 c4 46  |'"   f3 - %"...F|
00000f00  20 f1 22 20 20 20 66 34  20 2d 20 53 51 52 20 28  | ."   f4 - SQR (|
00000f10  73 71 75 61 72 65 20 72  6f 6f 74 29 22 27 22 20  |square root)"'" |
00000f20  20 20 66 35 20 2d 20 53  49 4e 20 28 73 69 6e 65  |  f5 - SIN (sine|
00000f30  20 6f 66 20 72 61 64 69  61 6e 20 61 6e 67 6c 65  | of radian angle|
00000f40  29 22 0d 18 ce 54 20 f1  22 20 20 20 66 36 20 2d  |)"...T ."   f6 -|
00000f50  20 43 4f 53 20 28 63 6f  73 69 6e 65 20 6f 66 20  | COS (cosine of |
00000f60  72 61 64 69 61 6e 20 61  6e 67 6c 65 29 22 27 22  |radian angle)"'"|
00000f70  20 20 20 66 37 20 2d 20  54 41 4e 20 28 74 61 6e  |   f7 - TAN (tan|
00000f80  67 65 6e 74 20 6f 66 20  72 61 64 69 61 6e 20 61  |gent of radian a|
00000f90  6e 67 6c 65 29 22 0d 18  d8 3f 20 f1 22 20 20 20  |ngle)"...? ."   |
00000fa0  66 38 20 2d 20 49 4e 56  20 28 66 6f 72 20 69 6e  |f8 - INV (for in|
00000fb0  76 65 72 73 65 22 27 8a  31 33 29 22 74 72 69 67  |verse"'.13)"trig|
00000fc0  6f 6e 6f 6d 65 74 72 69  63 20 66 75 6e 63 74 69  |onometric functi|
00000fd0  6f 6e 73 29 22 0d 18 e2  24 20 f1 22 20 20 20 66  |ons)"...$ ."   f|
00000fe0  39 20 2d 20 5e 20 20 20  28 72 61 69 73 65 20 74  |9 - ^   (raise t|
00000ff0  6f 20 70 6f 77 65 72 29  22 0d 18 f6 0b 20 f2 53  |o power)".... .S|
00001000  50 41 43 45 0d 19 00 0c  20 f2 53 43 52 45 45 4e  |PACE.... .SCREEN|
00001010  0d 19 0a 50 20 f1 27 22  20 20 20 20 20 20 54 68  |...P .'"      Th|
00001020  65 20 20 63 61 6c 63 75  6c 61 74 6f 72 20 20 68  |e  calculator  h|
00001030  61 73 20 20 74 65 6e 22  27 22 20 20 20 22 22 6d  |as  ten"'"   ""m|
00001040  65 6d 6f 72 69 65 73 22  22 2c 20 6e 75 6d 62 65  |emories"", numbe|
00001050  72 65 64 20 66 72 6f 6d  20 30 20 74 6f 20 39 22  |red from 0 to 9"|
00001060  0d 19 14 3a 20 f1 22 20  20 20 69 6e 20 65 61 63  |...: ."   in eac|
00001070  68 20 6f 66 20 77 68 69  63 68 20 63 61 6e 20 62  |h of which can b|
00001080  65 20 73 74 6f 72 65 64  20 61 22 27 22 20 20 20  |e stored a"'"   |
00001090  6e 75 6d 62 65 72 2e 22  27 27 0d 19 1e 51 20 f1  |number."''...Q .|
000010a0  22 20 20 20 20 20 20 54  6f 20 20 73 74 6f 72 65  |"      To  store|
000010b0  20 20 74 68 65 20 20 72  65 73 75 6c 74 20 20 6f  |  the  result  o|
000010c0  66 20 61 22 27 22 20 20  20 63 61 6c 63 75 6c 61  |f a"'"   calcula|
000010d0  74 69 6f 6e 20 20 69 6e  20 20 61 20 20 6d 65 6d  |tion  in  a  mem|
000010e0  6f 72 79 2c 20 20 6a 75  73 74 22 0d 19 28 51 20  |ory,  just"..(Q |
000010f0  f1 22 20 20 20 65 6e 74  65 72 20 20 74 68 65 20  |."   enter  the |
00001100  20 65 78 70 72 65 73 73  69 6f 6e 20 20 61 6e 64  | expression  and|
00001110  20 74 68 65 6e 22 27 22  20 20 20 70 72 65 73 73  | then"'"   press|
00001120  20 6b 65 79 20 66 30 20  28 53 54 4f 52 45 29 20  | key f0 (STORE) |
00001130  66 6f 6c 6c 6f 77 65 64  20 62 79 22 0d 19 32 72  |followed by"..2r|
00001140  20 f1 22 20 20 20 61 20  6e 75 6d 62 65 72 20 66  | ."   a number f|
00001150  72 6f 6d 20 30 20 74 6f  20 39 2e 22 27 27 27 22  |rom 0 to 9."'''"|
00001160  20 20 20 20 20 20 54 6f  20 72 65 63 61 6c 6c 20  |      To recall |
00001170  20 74 68 65 20 20 63 6f  6e 74 65 6e 74 73 20 20  | the  contents  |
00001180  6f 66 20 20 61 22 27 22  20 20 20 6d 65 6d 6f 72  |of  a"'"   memor|
00001190  79 2c 20 20 70 72 65 73  73 20 20 6b 65 79 20 20  |y,  press  key  |
000011a0  66 31 20 28 20 52 45 43  41 4c 4c 20 29 22 0d 19  |f1 ( RECALL )"..|
000011b0  3c 2d 20 f1 22 20 20 20  66 6f 6c 6c 6f 77 65 64  |<- ."   followed|
000011c0  20 62 79 20 61 20 20 6e  75 6d 62 65 72 20 66 72  | by a  number fr|
000011d0  6f 6d 20 30 20 74 6f 20  39 2e 22 0d 19 5a 0b 20  |om 0 to 9."..Z. |
000011e0  f2 53 50 41 43 45 0d 19  63 06 20 e1 0d 1b 58 0d  |.SPACE..c. ...X.|
000011f0  20 dd f2 53 43 52 45 45  4e 0d 1b 6c 0a 20 ef 32  | ..SCREEN..l. .2|
00001200  36 3a db 0d 1b 76 24 20  f2 44 42 4c 28 22 43 61  |6:...v$ .DBL("Ca|
00001210  6c 63 75 6c 61 74 6f 72  20 50 72 6f 67 72 61 6d  |lculator Program|
00001220  22 2c 31 30 2c 31 29 0d  1b b1 15 20 f4 56 44 55  |",10,1).... .VDU|
00001230  32 38 2c 30 2c 32 34 2c  33 39 2c 33 0d 1b bb 06  |28,0,24,39,3....|
00001240  20 e1 0d 1f 40 12 20 dd  f2 44 42 4c 28 58 24 2c  | ...@. ..DBL(X$,|
00001250  58 2c 59 29 0d 1f 4a 17  20 f1 8a 58 2d 31 2c 59  |X,Y)..J. ..X-1,Y|
00001260  29 3b bd 28 31 34 31 29  3b 58 24 0d 1f 54 19 20  |);.(141);X$..T. |
00001270  f1 8a 58 2d 31 2c 59 2b  31 29 3b bd 28 31 34 31  |..X-1,Y+1);.(141|
00001280  29 3b 58 24 0d 1f a3 06  20 e1 0d 1f a4 0f 20 dd  |);X$.... ..... .|
00001290  f2 57 41 49 54 28 58 29  20 0d 1f ae 08 20 ea 20  |.WAIT(X) .... . |
000012a0  5a 0d 1f b8 08 20 5a 3d  91 0d 1f c2 12 20 f5 20  |Z.... Z=..... . |
000012b0  fd 20 91 2d 5a 3e 58 2a  31 30 30 0d 20 07 06 20  |. .-Z>X*100. .. |
000012c0  e1 0d 20 08 0c 20 dd f2  53 50 41 43 45 0d 20 1c  |.. .. ..SPACE. .|
000012d0  39 20 f1 8a 33 2c 32 32  29 3b 22 50 72 65 73 73  |9 ..3,22);"Press|
000012e0  20 74 68 65 20 53 50 41  43 45 20 42 41 52 20 74  | the SPACE BAR t|
000012f0  6f 20 63 6f 6e 74 69 6e  75 65 22 3b 3a f2 4b 43  |o continue";:.KC|
00001300  4c 3a f2 4f 46 46 0d 20  30 0e 20 f5 20 fd 20 be  |L:.OFF. 0. . . .|
00001310  3d 22 20 22 0d 20 6b 06  20 e1 0d 20 6c 10 20 dd  |=" ". k. .. l. .|
00001320  f2 54 49 54 4c 45 50 41  47 45 0d 20 76 1f 20 db  |.TITLEPAGE. v. .|
00001330  3a f2 44 42 4c 28 22 43  41 4c 43 55 4c 41 54 4f  |:.DBL("CALCULATO|
00001340  52 22 2c 31 33 2c 31 30  29 0d 20 80 13 20 f2 4f  |R",13,10). .. .O|
00001350  46 46 3a 49 25 3d a6 28  35 30 30 29 0d 20 cf 06  |FF:I%=.(500). ..|
00001360  20 e1 0d 22 60 0a 20 dd  f2 4b 43 4c 0d 22 6a 10  | .."`. ..KCL."j.|
00001370  20 f5 20 fd 20 a6 28 30  29 3d 2d 31 0d 22 c3 06  | . . .(0)=-1."..|
00001380  20 e1 0d 22 c4 0a 20 dd  f2 4f 46 46 0d 22 ce 16  | ..".. ..OFF."..|
00001390  20 ef 32 33 3b 38 32 30  32 3b 30 3b 30 3b 30 3b  | .23;8202;0;0;0;|
000013a0  3a e1 0d 22 f6 09 20 dd  f2 4f 4e 0d 23 00 17 20  |:..".. ..ON.#.. |
000013b0  ef 32 33 3b 32 39 31 39  34 3b 30 3b 30 3b 30 3b  |.23;29194;0;0;0;|
000013c0  3a e1 0d 23 f0 09 20 dd  f2 59 4e 0d 23 fa 0a 20  |:..#.. ..YN.#.. |
000013d0  59 25 3d 2d 31 0d 24 04  1c 20 58 25 3d a5 3a e7  |Y%=-1.$.. X%=.:.|
000013e0  20 58 25 3d 31 33 20 80  20 59 25 3e 3d 30 20 8c  | X%=13 . Y%>=0 .|
000013f0  e1 0d 24 0e 22 20 58 25  3d 58 25 80 26 44 46 3a  |..$." X%=X%.&DF:|
00001400  e7 58 25 3c 3e 37 38 80  58 25 3c 3e 38 39 8c 8d  |.X%<>78.X%<>89..|
00001410  54 44 64 0d 24 18 15 20  59 25 3d 31 3a e7 58 25  |TDd.$.. Y%=1:.X%|
00001420  3d 37 38 8c 59 25 3d 30  0d 24 22 13 20 f1 bd 58  |=78.Y%=0.$". ..X|
00001430  25 3b bd 38 3b 3a e5 8d  54 44 64 0d ff           |%;.8;:..TDd..|
0000143d
W.CALC.m0
W.CALC.m1
W.CALC.m2
W.CALC.m4
W.CALC.m5