BSAVE

From MCS Wiki AVR
Jump to: navigation, search

Contents

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.

 

 

See also

INITFILESYSTEM , OPEN , CLOSEFLUSH , PRINTLINE INPUTLOCLOF , EOF , FREEFILE , FILEATTR , SEEK , BLOAD ,KILL , DISKFREE , DISKSIZE , GET , PUT , FILEDATE , FILETIME , FILEDATETIME , DIR , FILELEN , WRITE , INPUT

 

 

 

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


' THIS IS A CODE FRAGMENT, it needs AVR-DOS in order to work
'now the good old bsave and bload
Dim Ar(100)as Byte , I Asbyte
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

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language