Micro­power

  

Volume 2 · Number 1 · February 1982

Page 15 of 37
1670; @@@@@@@@@@@@@@@@@@@@@@@
1680; @@                   EVALUATE A STRING                   @@
1690; @@@@@@@@@@@@@@@@@@@@@@@
1700;
2DCFE11710EVALPOP HL
2DD0231720INC HL
2DD1CD8B1B1730CALL EXPR; GET STRING
2DD4E51740PUSH HL
2DD5CD6A211750CALL ASCO; GET ADDRESS IN DE
2DD82B1760DEC HL; FIND LENGTH
2DD92B1770DEC HL
2DDA2B1780DEC HL
2DDB7E1790LD A, (HL); GET LENGTH IN A
2DDCFE5A1800CP 90; IS IT TOO LONG?
2DDE38051810JR C, EVAL2; IF NO, JUMP
2DE01E0F1820LD E, 15; IF YES, WRITE
2DE2C319131830JP ERROR; ERROR MESSAGE
2DE54F1840EVAL2LD C, A
2DE606001850LD B, 0
2DE8EB1860EX DE, HL
2DE911D50C1870LD DE, BUFFER; COMPRESS OVER
2DECEDB01880LDIR; ITSELF
2DEE231890INC HL
2DEF36001900LD (HL), 0
2DF121D50C1910LD HL, BUFFER
2DF4CD49141920CALL CMPRSS
2DF7231930INC HL
2DF8CD771B1940CALL EXNMCK; EVALUATE EXPR.
2DFBC3AA2B1950JP FNEND; BACK TO BASIC
2DFE001960CONVDEFS 1; CONVERSION FLAG
1965;
1970; ROUTINES IN CRYSTAL BASIC
1980;
2DFE154C1990TSTCOMEQU 154CH; TEST FOR COMMA
2DFE22502000IN255EQU 2250H; GET NUMBER 0 – 255
2DFE1FAB2010ASNSTREQU 1FABH; CREATE NEW STRING
2DFE1FD92020STRENDEQU 1FD9H; RETURN WITH RESULT
2DFE15512030TSTCHREQU 1551H; TEST FOR NEXT BYTE
2DFE215B2040LEN1EQU 215BH; GET STRING LENGTH
2DFE1B8B2050EXPREQU 1B8BH; EVALUATE EXPRESSION
2DFE216A2060ASCOEQU 216AH; GET ADDRESS & LENGTH
2DFE14492070CMPRSSEQU 1449H; COMPRESS TO BUFFER
2DFE2BAA2080FNENDEQU 2BAAH; RETURN FROM FUNCTION
2DFE1B772090EXNMCKEQU 1B77H; EVALUATE NUMERIC EXP.
2DFE0CD52100BUFFEREQU 0CD5H; BASIC INPUT BUFFER
2DFE13192110ERROREQU 1319H; PRINT ERROR MESSAGE

These routines should can be entered into the crystal basic interpreter in the normal way, or they can be added by means of the loader program given in the last issue. The code to be entered when using this program is given below.

NAME:OLD

0000     FD     2A     83     12     FD     E5     DD     E1     AF     06     00     11     04     00

Page 15 of 37