(self, args)
BSAVE: Save a block of memory into a file.
BSAVE: Save a block of memory into a file.
BSAVE : Save a block of memory into a file .
def bsave_(self, args):
        """BSAVE: Save a block of memory into a file."""
        if self._memory.program.protected and not self.interpreter.run_mode:
            raise error.BASICError(error.IFC)
        name = values.next_string(args)
        offset = values.to_int(next(args), unsigned=True)
        length = values.to_int(next(args), unsigned=True)
        list(args)
        with self._files.open(
                    0, name, filetype=b'M', mode=b'O',
                    seg=self.segment, offset=offset, length=length
                ) as g:
            addr = self.segment * 0x10 + offset
            g.write(bytes(self._get_memory_block(addr, length)))
            # Tandys repeat the header at the end of the file
            if self._syntax == 'tandy':
                g.write(
                    devices.TYPE_TO_MAGIC[b'M'] + struct.pack('<HHH', self.segment, offset, length)
                )
def bsave_ ( self , args ) : if self . _memory . program . protected and not self . interpreter . run_mode : raise error . BASICError ( error . IFC ) name = values . next_string ( args ) offset = values . to_int ( next ( args ) , unsigned = True ) length = values . to_int ( next ( args ) , unsigned = True ) list ( args ) with self . _files . open ( 0 , name , filetype = b'M' , mode = b'O' , seg = self . segment , offset = offset , length = length ) as g : addr = self . segment * 0x10 + offset g . write ( bytes ( self . _get_memory_block ( addr , length ) ) ) # Tandys repeat the header at the end of the file if self . _syntax == 'tandy' : g . write ( devices . TYPE_TO_MAGIC [ b'M' ] + struct . pack ( '<HHH' , self . segment , offset , length ) )