Remote-processing BASIC 52 Manual do Utilizador Página 8

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 163
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 7
RPBASIC-52 PROGRAMMING GUIDE
1-5
RPBASIC-52 Memory Map
subroutines is limited to the amount of internal stack
space. Usually this is about 35 subroutines, but can
go down if FOR-NEXT loops are active. This is
sufficient to handle all multi-tasking (ON LINE, ON
COUNT, ON KEY PAD, etc.) and several levels of
subroutines.
Most complex programs tend to have a maximum of
7 nested subroutine levels. Usually the maxim um is
4.
Passing Variables Between Programs
All variables in R PBASIC-52 are global. This
means any routine can modify any variable at any
time. When a new program is loaded using
EXECU TE, variables are erased.
Values can be passed between programs using any
variations of PEEK and POKE statem ents.
Addresses
Addresses are specified as either decimal or
hexadecim al numbers. Hexadecimal addresses with
a leading alpha character need a preceding zero
otherwise they will be interpreted as variable names.
100 POKEB,1,1000H,15
110 A = PEEKB(1,1000H)
Memory addresses range from 0 to 0FFFFH and
segments from 0 to 7. A segment represents a 64K
block of memory. Programs and RPBASIC-52
variables reside in segment 0. Variables are
generally stored in segment 1 and higher.
Basic program area can be 32K or 64K, depending
upon the am ount of RAM installed.
Arrays
Arrays are single dimension and start with element
0. They are dim ensioned using the DIM statement.
Each variable may have up to 255 elements (0 to
254). Undimensioned arrays default to 11 elem ents,
variable(0) through variable(10). Naming
conventions used for scaler variables apply to arrays.
Strings
Memory is allocated to strings using the STRING
command. There is no power up default. Up to 255
strings, identified as $(0) through $(254) are
available.
To use strings, you must first determine the
maximum length of any one string and then the
maximum num ber of strings. Using the formula
(bytes/string + 1) * number of strings + 1
returns the number of bytes to allocate.
The ASC, CHR, and ST R commands are used to
evaluate and manipulate strings. Text assigned to a
string is enclosed in double quotation marks:
100 STRING 1000,40
110 $(0)=">03"
Vista de página 7
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 162 163

Comentários a estes Manuais

Sem comentários