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

  • 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 25
RPBASIC-52 PROGRAMMING GUIDE
2-7
many sectors, the last written sector is filled in with more data from R AM. Note that BL OAD allows data
retrieval of any length and is not affected by sector size.
The easiest way to determine an even sector address is to "AND" the EPROM address with either FFC0H,
FF80H, or FE00H for 32K, 128K or 512K EPROMs respectively.
Data can be saved "above" program s. The following is a way to dete rmine the ne xt free sector for writing to
flash.
1) Save the program. Note the number of bytes saved.
2) Add the sector size (based on flash EPROM type) plus 64 bytes to the number of bytes saved. (64
bytes is for program overhead). For example, suppose the program is 28145 bytes long and a 512K
(29C040) EPROM is installed. 28145 + 512 + 64 = 28721
3) At the terminal, print the following:
print 28721 .AND. 0FE00H
the response is
28672
What you have done is told the computer to print the length o f the program + 512 bytes (for the sector) +
64 bytes (for program overhead) and 'and' it with FE00H. Notice the address, 28672, is higher than the
number of bytes saved and less than the number we figured for sector size and overhead.
4) BSAVE can be used starting at this address (28672, or 7000H).
This method will work regardless of the number of programs saved or segment numbe r.
Writing takes about 35 ms/1000 bytes. During BSAVE time, ONTICK and ONITR interrupts are recognized
but not serviced. If these com mands mu st be serviced quicker, write data in smaller bl ocks.
RELATED
BLOAD, POKE com mands
ERRORS
BAD ARGUMENT When any parameter is out of range or EPROM does not work properly.
HARDWARE When verify to EPROM is bad
EXAMPLE
The following example POKEs data into segment 1 of data RAM. The data is then saved to EPROM
segment 6 and loaded back to a different location in RAM. The data is then verified. A 128K RAM and
512K flash E PRO M m ust be installed for this example to w ork.
10 RA=512
20 FOR N=0 TO 1000 STEP 2
30 POKE W1,N,N
40 NEXT
50 FOR N=2000 TO 3000 STEP 2
60 POKE W1,N,0
70 NEXT
80 BSAVE6,RA,1,0,1000
90 BLOAD1,2000,6,RA,1002
100 FOR N=0 TO 1000 STEP 2
110 B=PEEKW(1,N+2000)
120 IF B<>N THEN PRINT "Error address",N," data is",B
130 NEXT
Zobrazit stránku 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 162 163

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

Žádné komentáře