[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: use of BLOAD and BSAVE
- Subject: Re: use of BLOAD and BSAVE
- From: dempson@actrix.gen.nz (David Empson)
- Date: 1999/10/21
- Newsgroups: comp.sys.apple2
- Organization: Empsoft
- References: <7ukm25$94p$1@wanadoo.fr>
- User-agent: MacSOUP/2.4.2
Bernard Esteban <esteban@worldnet.fr> wrote:
> I need to make copy of binary file from a 5"1/4 to a 5"1/4 (I have only one
> floppy drive),
>
> Could you help me :
> What is the best adress for BLOAD ?
> How to find, to know the lengh of the binary file loaded, because it does'n
> work with a bad lengh ?
>
> PS : I dont have the possibility to use another commands than DOS3.3's cmd.
Do you have a DOS 3.3 system master disk? It includes a program called
FID which can copy files on a single disk system. Just BRUN FID and
everything is menu driven.
If you really have to do it using BLOAD and BSAVE, the main question is
whether the file _can_ be loaded into memory without overwriting
something. If you BLOAD it at an arbitrary address then BSAVE it again,
you will end up with a file that doesn't match the original, because it
will have a different load address.
This would be a serious problem if the file is a program, but might be
OK if it is only something like a Hi-res graphics screen dump.
What is the file, and how large is it?
Assuming it is safe to use this method, and the file is no larger than
32KB (up to 130 sectors), then it should be safe to load it into memory
at location 4096 ($1000). Use the following:
BLOAD filename,A4096
(Replace 'filename' with the actual name of the file.)
Use the following command to find out the exact length of the file you
just loaded:
PRINT PEEK(43616) + 256 * PEEK(43617)
Take a note of the value printed. You can now switch disks and save the
file using:
BSAVE filename,A4096,Lyyyyy
(Replace 'yyyyy' with the actual value displayed by the PRINT command.)
If you want to risk it, you could try loading the file without
specifying an address, then use another PEEK to find out where it was
loaded:
BLOAD filename
PRINT PEEK(43634) + 256 * PEEK(43635)
The value displayed is the load address of the binary file. You can
also use the earlier peek (43616 and 43617) to find out its length.
If the load address is between 2048 and 38400, and the sum of the load
address and length does not exceed 38400, then it should be OK to save
the file again. Another safe range is 768 through 976 (and this can be
extended down as far as 560 through 976 if you don't type any commands
longer than 40 characters).
Assuming the file is loaded completely within either of these areas,
then you can save it again using:
BSAVE filename,Axxxxx,Lyyyyy
where 'xxxxx' is the load address and 'yyyyy' is the length, as
displayed by the earlier PRINT commands.
If the file does load starting at exactly 2048, then Applesoft BASIC
will subsequently misbehave if you try to do any programming related
commands (NEW, LOAD, entering program lines, etc.) After you have
BSAVEd the file, you can fix things up again by rebooting, or the
following command:
POKE 2048,0
(Make sure you do this after the BSAVE, not before.)
--
David Empson
dempson@actrix.gen.nz
Snail mail: P O Box 27-103, Wellington, New Zealand