Remote-processing RPC-150 Manuale Utente Pagina 15

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 26
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 14
CHAPTER 5 DATA MEMORY
RPC-150 Page 13
50 B = PEEK(60000)
You can store and retrieve arrays, strings, and variables
in this way. There ar e many variations of PEE K and
POKE statements. A list of CAMBASIC commands
appears at the end of this chapter.
ASSEMBLY LANGUAGE INTERFACE
Use the CAMBASIC CALL statement to execute an
assembly or C language program.
A specific area of RAM should be reserved for the
program. This is to prevent strings and variables from
corrupting that area of RAM . Use the SYS(1) and
SYS(2) statements to do this. SYS(1) returns the low
memory location while SYS(2)-500 returns the upper
location. Run the program first to make sure variable
memory has been allocated before running these SYS
commands. F ailure to do so may r esult in address
returned that are not really free for assembly language
program s.
There are sever al ways to put a program in mem ory,
depending upon your application.
1. Use DATA statements and POKE the code into
segment 0 RAM.
2. Write a program to download code. Some
applications are connected to a larger system which
"initializes" its systems. Using INKEY $ or COM $,
code is received and then poked into memory using
POKE$.
3. Read the code from the EPROM (U3) (using INP)
and transfer it to RAM (using POKE ). Y ou would
have to use an external programmer to place the
code above CAMBASIC code.
In all cases, it is best to load code into RAM from a
"secure" source. E ven though RAM is battery backed,
over time there is the possibility it could be corrupted.
Below is an example of loading and running an asse mbly
language program.
100 FOR N = &FB00 TO &FB0C
110 READ A
120 POKE N,A
130 NEXT
900 DATA &DB, 2, &47, &E6, &FE, &D3
910 DATA 2, &78, &F6, 1, &D3, 2, &C9
2000 CALL &FB00
Lines 100 to 130 load the program into RAM.
Line 2000 calls the program. It toggles J2 line 13.
COMMANDS
The following is a list of CAMBASIC commands used
with RAM.
Command Function
CALL Calls an assembly language routine
CLEAR Clears strings and allocates string space
PEEK Returns a byte
DPEEK Returns a 16 bit value
PEEK$ Returns a string
FPEEK Returns a floating point number
POKE Stores a by te
DPOKE Stores a 16 bit value
POKE$ Stores a string
FPOKE Stores a floating point number
Vedere la pagina 14
1 2 ... 10 11 12 13 14 15 16 17 18 19 20 ... 25 26

Commenti su questo manuale

Nessun commento