BSAVE

Action

Save a range in SRAM to a File

 

Syntax

BSave sFileName, wSRAMPointer, wLength

 

Remarks

sFileName

(String) Name of the File to be written

wSRAMPointer

(Word) Variable, which holds the SRAM Address, from where SRAM should be written to a File

wLength

(Word) Count of Bytes from SRAM, which should be written to the file

 

This function writes a range from the SRAM to a file. A free file handle is needed for this function.

 

 ASM

Calls

_BSave

 

Input

X: Pointer to string with filename

Z: Pointer to Long-variable, which holds the start position of SRAM

 

r20/r21: Count of bytes to be written

 

Output

r25: Errorcode

C-Flag: Set on Error

  

 

Example

'now the good old bsave and bload
Dim Ar(100) As Byte , I As Byte
For I = 1 To 100
Ar(i) = I ' fill the array
Next

Wait 2

W = Varptr(ar(1))
Bsave "josef.img" , W , 100
For I = 1 To 100
Ar(i) = 0 ' reset the array
Next

Bload "josef.img" , W ' Josef you are amazing !

For I = 1 To 10
Print Ar(i) ; " " ;
Next
Print