Article 153694 of comp.sys.apple2: Newsgroups: comp.sys.apple2 Subject: Re: use of BLOAD and BSAVE From: dempson@actrix.gen.nz (David Empson) Date: Thu, 21 Oct 1999 22:29:04 +1300 Message-ID: <1e01n1k.je6qquparz54N%dempson@actrix.gen.nz> References: <7ukm25$94p$1@wanadoo.fr> Organization: Empsoft User-Agent: MacSOUP/2.4.2 NNTP-Posting-Host: 202.49.157.176 X-Original-NNTP-Posting-Host: 202.49.157.176 X-Trace: 21 Oct 1999 22:26:33 NZST, 202.49.157.176 Lines: 87 Path: news1.icaen!news.uiowa.edu!news.physics.uiowa.edu!hammer.uoregon.edu!news-feed.fnsi.net!netnews.com!howland.erols.net!cpk-news-hub1.bbnplanet.com!lsanca1-snf1!news.gtei.net!news.netgate.net.nz!news.xtra.co.nz!news.iprolink.co.nz!news.actrix.gen.nz!dempson Xref: news1.icaen comp.sys.apple2:153694 Bernard Esteban 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