BBS: Inland Empire Archive Date: 04-11-92 (18:45) Number: 187 From: CORIDON HENSHAW Refer#: NONE To: SCOTT WUNSCH Recvd: NO Subj: Disk copier Conf: (2) Quik_Bas
SW> It seems to me you were the guy that told me you were going to SW> post some code to perform a disk copy. I haven't seen it yet - did SW> I miss it? If so, could you please re-post... SW> SW> -= Scott \\'unsch =- No, here it is. 'QuickBasic/Basic PDS diskcopy program 'This must be used with QB.QLB or QBX.QLB. Also loaded and with /AH and /L '$INCLUDE: 'QBX.BI' 'Use '$INCLUDE: 'QB.BI' for QuickBasic DIM Regs AS RegtypeX DIM SectorBuffer(0 TO 16384 * 2) AS STRING' setup a 64K storage area COLOR 14, 1 CLS FOR Y% = 0 TO 1 FOR X% = 0 TO 80 'Use 40 for 360K disks Regs.Ax = 264 ' AL is the number of sectors to read (64) Regs.Cx = VAL(STR$(X%) + "1")' 1 for drive A: 2 for drive B: Regs.Dx = VAL(STR$(Y%) + "00") Regs.Es = SSEG(SectorBuffer) Regs.Bx = SSAD(SectorBuffer) CALL InterruptX(&H13, Regs, Regs) LOCATE 1, 1 PRINT USING "Head: # Track: ##"; Y%; X% Regs.Ax = 264 ' AL is the number of sectors to write (64) Regs.Cx = VAL(STR$(X%) + "1")' 1 for drive A: 2 for drive B: Regs.Dx = VAL(STR$(Y%) + "00") Regs.Es = SSEG(SectorBuffer) Regs.Bx = SSAD(SectorBuffer) CALL InterruptX(&H13, Regs, Regs) NEXT NEXT END 'This program is VERY stupid, it COULD wipe out you hard drive, be VERY careful! 'The code is UNTESTED. It doesn't format a disk for you, so use pre-formatted 'disks. END Sorry about the wraped lines, just cut the comments. --- Maximus 2.00 * Origin: The Programmer's Paradise (416)482-1470 (1:250/801)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET