Remote-processing BASIC 52 Uživatelský manuál Strana 161

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 163
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 160
RPBASIC-52 PROGRAMMING GUIDE
D-1
APPENDIX D - Data storage
STRING STORAGE
BASIC-52 stores string variables between MTOP and top of variable space, call VARTOP. String $(0) would be
stored from VARTOP to [VARTOP + (bytes_per_string + 1)]. String $(1) is stored from [VARTOP +
(bytes_per_string + 2)] to [VARTOP +2 * (bytes_per_string + 1)], and so on.
All strings are terminated with a c arriage return (0D H, 13 decim al).
VARIABLE STORAGE
Scaler variables are numbers not in a dimension. Dimensioned or arrayed variables (commonly referred to as
"arrays") are those whose identifier includes a single-dimensioned expression.
Scaler variables: PAR T, A1, B
Dimensioned variables: TEMP(5), PRESS(A)
Scalars are stored starting at VARTOP-1, with storage growing down at eight bytes per variable.
FLOATING-POINT FORMAT
RPBASIC-52 stores all floating-point numbers in a no rmalized pa cked binary-coded decim al (BCD) format. All
numbers are normalized, so the most significant digit in a floating-point number is never zero unless its actual
value is zero.
To demonstrate the floating-point format, see how RPBASIC-52 stores 12345678.
LOCATION
VALUE DESCRIPTION
X 88H exponent: 81H = 10
1
, 80H = 10
0
, 7FH = 10
-1
, etc.
Zero is represented by a zero exponent
X-1 00H sign bit: 00H = positive, 01H = negative
Other bits are temporary values used only during calculations
X-2 78H least significant two digits
X-3 56H next least significant two digits
X-4 34H next most significant two digits
X-5 12H most significan t two digits
So we have .12345678 X 10
8
which is 12345678.
The POKEF comm and stores numbers in RA M in this same format. PE EKF e xpects to read a number in this
format.
Zobrazit stránku 160
1 2 ... 156 157 158 159 160 161 162 163

Komentáře k této Příručce

Žádné komentáře