Classic Computer Magazine Archive COMPUTE! ISSUE 144 / SEPTEMBER 1992 / PAGE G24

Disk tricks. (using disk drives)
by Randy Thompson, Helen Roth, John L. Bergershire, Rob Maxwell, Brad Schultz, Kevin Reeves, Cameron Kaiser

Disk drives are such an integral part of any computer system that it would be difficult to imagine computing without them. Here are some great disk-related tips sent in by readers. Keep those tips coming; we pay $25-$50 for each we publish.

Quick and Easy Append

Follow these seven steps the next time you need to add one BASIC program onto the end of another BASIC program. Note that the last line number of the first program must be lower than the first line number of the program being appended. 1. Load the program with the

lowest line numbers. 2. Enter the commands POKE

43,PEEK(45)-2: POKE 44,

PEEK(46) 3. Load the program with the

highest line numbers. 4. Enter the commands

POKE 43,1: POKE 44,8 5. Enter LIST to check your

new, larger program. 6. If you get an OVERFLOW error

message, enter a do-nothing

line, such as

REM 7. Save your new program.

HELEN ROTH

LOS ANGELES, CA

What's Your Address?

The following program asks for the filename of a machine language program and then tells you where that program loads into memory. This is important information when you forget a program's SYS address because the address in which a program loads is usually its SYS address, too. RB 10 INPUT "FILENAME";F$ RB 20 OPEN 8,8,8,F$+",P,R" SC 30 GET#B,LB$,HB$ QR 40 CLOSE 8 KH 50 HB=ASC (HB$+CHR$ (0)):LB=A

SC (LB$+CHR$(0)):SA=HB*25

6+LB JA 60 PRINT "STARTING ADDRESS:

";SA QH 70 PRINT "PROBABLE PROGRAM

(SPACE)TYPE: "; FS 80 IF SA=2049 THEN PRINT "B

ASIC":END SM 90 PRINT "MACHINE LANGUAGE" JOHN L. BERGERSHIRE MANSTOWN, PA

Scratch That Last Command

If you accidentally delete a program from disk using DOS's SCRATCH command, you may be able to recover it if you act quickly. Immediately after erroneously deleting a file, enter LOAD "*", 8. If the scratched program was the last one loaded or saved, the computer will reload that program into memory. Now, be sure to save the program to disk again before you do anything else foolish. ROB MAXWELL DELTA, B.C. CANADA

Disk Manager

This simple program makes it easier to format disks and rename and delete files. Choose the desired menu option and answer the prompts. KP 10 PRINT "{CLR}{RVS}

{6 SPACES}DISK MANAGER -

BRAD SCHULTZ{7 SPACES}"

:PRINT:PRINT KK 20 PRINT:PRINT "{2 SPACES}

{RVS}1{OFF} RENAME FILE" GH 30 PRINT:PRINT "{2 SPACES}

{RVS}2{OFF} DELETE FILE" GS 40 PRINT:PRINT "{2 SPACES}

{RVS}3{OFF} FORMAT DISK" GJ 50 PRINT:PRINT "{2 SPACES}

{RVS}4{OFF} EXIT PROGRAM

" KS 60 PRINT:PRINT "ENTER YOUR

{SPACE}CHOICE: "; SS 70 GET K$:IF K$<"1" OR K$>"

4" THEN 70 JJ 80 PRINT K$:PRINT:PRINT:ON

{SPACE}VAL(K$) GOSUB 100

,200,300,400 AF 90 GOTO 10 PF 100 REM RENAME FILE MJ 110 INPUT "OLD FILENAME";OF

$:IF OF$="" GOTO 160 FG 120 INPUT "NEW FILENAME";NF

$:IF NF$="" GOTO 160 MD 130 OPEN 15,8,15 XF 140 PRINT#15,"R0:";NF$;"="; OF$

FF 150 CLOSE 15 KA 160 RETURN FQ 200 REM DELETE FILE MS 210 INPUT "DELETE WHICH FIL E";DF$:IF DF$="" GOTO 2 50

BK 220 OPEN 15,8,15 DE 230 PRINT#15,"S0:";DF$ MP 240 CLOSE 15 SG 250 RETURN GK 300 REM FORMAT DISK PC 310 INPUT "DISK NAME";DN$:I

F DN$="" GOTO 370 CH 320 PRINT "PLACE DISK TO BE FORMATTED INTO DRIVE 8 AND PRESS A KEY"

XA 330 GET K$:IF K$="" GOTO 33

0 PB 340 OPEN 15,8,15 XM 350 PRINT#15,"N0:";DN$;",BS

" SD 360 CLOSE 15 DR 370 RETURN KS 400 REM EXIT PROGRAM DR 410 PRINT "{CLR}":END BRAD SCHULTZ APPLETON, WI

Quick-Load Classic

Here's a classic load-and-run tip that's been around the disk block a few times, but it's so useful it bears repeating. Instead of entering a LOAD command, waiting for the designated program to load, and then typing RUN, try typing LOAD "program",8: and then pressing Shift-Run/Stop. As soon as you do, LOAD appears on the screen, and your program automatically loads and runs. You don't even have to press the Return key. KEVIN REEVES GROTON, CT

Vital Statistics

The BASIC code listed below allows you to determine a disk's vital statistics. You can determine the disk's name, ID, and number of free and used disk blocks from within a program without listing the disk's entire directory. The entire process takes three seconds or less. FJ 10 SYS 57812"$0",8,0:POKE 7

80,0:POKE 781,0:POKE 782

,207:SYS 65493 SM 20 BF=PEEK(53025)*256+PEEK(

53024):BU=664-BF EB 30 SS=52998:FS$=":GOSUB 10

0:DN$=FS$ KX 40 ID$=CHR$(PEEK(53016))+CH

R$(PEEK(53017)) DH 50 PRINT "DISK NAME: ";DN$ DE 60 PRINT "DISK ID: ";ID$ XJ 79 PRINT "BLOCKS USED:";BU MD 80 PRINT "BLOCKS FREE:";BF ME 90 END HF 100 SC=PEEK(SS):IF SC=160 O

R SC=34 THEN RETURN RD 110 FS$=FS$+CHR$(SC):SS=SS+

1:GOTO 100