home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
UTILITYS
/
XLINK128.SFX
/
xlink.doc
< prev
next >
Wrap
Text File
|
1980-01-01
|
11KB
|
234 lines
╪-╠INK 2.1
╨ART ╔╔ - ┴ ╨RACTICAL ┼XAMPLE OF ─ATA ╨ORTABILITY
├╥╧╙╙ ╠╔╬╦ IS A SHORT ┬┴╙╔├ 7 PROGRAM FOR USE ON THE ├-128 WITH A
SINGLE 1571 DRIVE. ╔T ALLOWS YOU TO READ A FILE INTO A 45 K ╥┴═ BUFFER
FROM ANY ONE OF THE FOLLOWING SEVEN DISK FORMATS:
╙┼╤ - ┴╙├╔╔
╙┼╤ WITH ╨┼╘╙├╔╔ <> ┴╙├╔╔ CONVERSION
╨╥╟ - ┴╙├╔╔
╨╥╟ - WITH SCREEN CODE <> ┴╙├╔╔ CONVERSION
├-128 ├╨/═ SINGLE SIDED
├-128 ├╨/═ DOUBLE SIDED
╔┬═ ╨├-─╧╙ DOUBLE SIDED, 9 SECTORS/TRACK.
╘HE BUFFER CAN THEN BE WRITTEN TO ANOTHER DISK IN ANY OF THE SAME
LIST OF FORMATS OR TO A PRINTER. (╔T SHOULD BE NOTED THAT THE ╔┬═
╨├-─╧╙ DOUBLE SIDED FORMAT IS ╬╧╘ THE SAME AS THE "╔┬═-─╙" WHICH IS
SUPPORTED BY ├-128 ├╨/═ MODE. ╘HE LATTER FORMAT IS USED BY ├╨/═-86
WHICH IS THE 16 BIT VERSION OF ├╨/═ DESIGNED TO RUN ON THE ╔┬═-╨├
INSTEAD OF ╨├-─╧╙. ╨├-─╧╙ AND ├╨/═-86 ARE NOT COMPATIBLE.) ├╥╧╙╙ ╠╔╬╦
IS SIMPLE TO USE, JUST FOLLOW THE PROMPTS ON THE SCREEN.
╧NE WORD OF CAUTION, HOWEVER. ┬ECAUSE THE 1571 IS NOT A TRUE
╨├-─╧╙ DISK DRIVE, NEVER WRITE ╨├-─╧╙ FILES TO AN ORIGINAL,
IRREPLACEABLE DISK. ╨LAY IT SAFE, ALWAYS USE SCRATCH DISKS FOR WRITING
FILES. (┴LTHOUGH ╔ HAVE HAD NO PROBLEMS WITH DISKS FROM THREE
DIFFERENT ╔┬═-╨├S AND TWO ╨├ COMPATIBLES, THE POSSIBILITY DOES EXIST
FOR MIS-MATCHED SECTOR TIMING, ETC. ╘HIS COULD HOPELESSLY CORRUPT THE
DISK BEING WRITTEN TO.)
├╥╧╙╙ ╠╔╬╦ USES BURST MODE ON THE 1571 TO READ AND WRITE ╨├-─╧╙
AND ├╨/═ FILES, CONSEQUENTLY IT IS QUITE FAST. (┴ DETAILED DESCRIPTION
OF 1571 BURST MODE AND HOW TO USE IT IS PRESENTED IN A SERIES OF
ARTICLES BY THIS AUTHOR IN ╘╨╒╟ MAGAZINE, STARTING IN ═AY 1986.) ┴
TYPICAL CONVERSION OF A 16K (65 ╙┼╤ BLOCK) TEXT FILE FROM ╙┼╤ ╨┼╘╙├╔╔
TO ╨├-─╧╙ TAKES ABOUT 65 SECONDS, INCLUDING ABOUT 25 SECONDS OF
"OVERHEAD" REQUIRED TO DECODE AND RECODE THE ╨├-─╧╙ DIRECTORY AND FILE
ALLOCATION TABLE (╞┴╘).
╬OTICE THAT ╔ SPECIFY THE CONVERSION OF A TEXT FILE. ╘HIS BRINGS
UP A GENERAL CAVEAT: PROGRAM FILES WRITTEN TO RUN UNDER ╨├-─╧╙ (I.E.
WITH A FILE TYPE OF .┼╪┼ OR .├╧═) WILL NOT WORK IN ├-128 MODE OR ├╨/═
MODE (THE ├╨/═ EXECUTABLE FILE ALSO HAS A FILE TYPE OF .├╧═, BUT THE
TWO ARE NOT INTERCHANGEABLE) OR VICE VERSA. ╚OWEVER, IF YOU DOWNLOAD A
├╨/═ PROGRAM TO A ╨├-─╧╙ DISK AND THEN CONVERT THE FILE TO ├╨/═ FORMAT,
THE PROGRAM WILL WORK IN ├╨/═ MODE ON THE ├-128.
╘HIS IS USEFUL, FOR EXAMPLE, IF YOU DO NOT HAVE A MODEM ON YOUR
├-128 BUT HAVE ACCESS TO ONE ON AN ╔┬═-╨├ WHERE YOU WORK. ╘HE SAME
GOES FOR DOWNLOADING TO A ├-128 PROGRAM TO ╨├-─╧╙ THEN CONVERTING TO A
╨╥╟ ┴╙├╔╔ FILE OR DOWNLOADING TO ╙┼╤ FORMAT IN ├-128 MODE AND THEN
CONVERTING TO ├╨/═ FORMAT. (╘HE ORIGINAL ├╨/═ SYSTEM FILES FOR THE
├-128 DID NOT SUPPORT A MODEM. ╘HE UPGRADED VERSION NOW DOES.)
╘EXT AND DATA FILES, ON THE OTHER HAND, FROM ONE MACHINE CAN
USUALLY BE USED WITHOUT TROUBLE ON THE OTHER. ╘EXT FILES TRANSFERRED
USING SCREEN CODE ╨╥╟ FILES MAY REQUIRE REFORMATTING ON THE TARGET WORD
PROCESSOR. ╙CREEN CODE FILES WRITTEN BY ├╥╧╙╙ ╠╔╬╦ MAY NOT WORK WITH
ALL ├-128 WORD PROCESSORS.
╪-╠INK 2.1
╙OME ╫.╨.'S, SUCH AS ╨APERBACK ╫RITER 128, INCLUDE A HEADER BLOCK
AT THE BEGINNING OF THE FILE. ╘HE HEADER CONTAINS INFO ON THE FILE
CHARACTERISTICS SUCH AS MARGINS ETC. ╔F IT IS NOT PRESENT, THE ╫.╨.
MAY NOT BE ABLE TO READ THE FILE CORRECTLY. ╘HESE ╫.╨.'S CAN USUALLY
READ ╙┼╤ FILES AS WELL, HOWEVER, SO IT IS BETTER TO WRITE A ╙┼╤ FILE
WITH ├╥╧╙╙ ╠╔╬╦ FOR USE ON MOST ╫.╨.'S.
├╥╧╙╙ ╠╔╬╦ CAN READ ╨╥╟ TEXT FILES WITH HEADERS, BUT YOU MUST
DELETE THE HEADER BLOCK WITH THE TARGET ╫.╨.. ╠╔╙╘╔╬╟ 1 IS A ┬┴╙╔├
LOADER FOR THE MACHINE LANGUAGE PORTION OF THE PROGRAM. ╔T WILL CREATE
A PROGRAM FILE NAMED "╪╠.═╠3" WHICH IS AUTOMATICALLY LOADED BY THE MAIN
PROGRAM. ╘HE ═╠ ROUTINE, WHICH IS LOCATED IN THE CASSETTE AND ╥╙ 232
BUFFERS, CONTAINS SEVERAL ENTRY POINTS. ╘HESE ARE:
╚EX ─EC ╞UNCTION
----------------------------------------------------------------------
0B69 2921 BURST SECTOR READ (FOR ├╨/═ AND ╨├-─╧╙)
0B9C 2972 READ ╙┼╤ OR ╨╥╟ FILE, NO CONVERT
0BD0 3024 WRITE ╙┼╤, ╨╥╟ FILE OR PRINTER, NO CONVERT
0C02 3074 BURST SECTOR WRITE (FOR ├╨/═ AND ╨├-─╧╙)
0C45 3141 WRITE ╙┼╤ OR PRINTER , CONVERT ┴╙├╔╔ TO
╨┼╘╙├╔╔
0CE0 3296 READ ╙┼╤ FILE, CONVERT ╨┼╘╙├╔╔ TO ┴╙├╔╔
0D7D 3453 READ ╨╥╟ FILE, CONVERT SCREEN CODE TO ┴╙├╔╔
0DDF 3551 WRITE ╨╥╟ FILE, CONVERT ┴╙├╔╔ TO SCREEN.
╔F YOU ARE INTERESTED, YOU CAN DISASSEMBLE THE MACHINE LANGUAGE
WITH THE ├-128'S BUILT IN MONITOR. ╘HE BURST MODE READ AND WRITE
ROUTINES ARE SIMILAR TO THOSE DESCRIBED IN PARTS 2 AND 3 OF THE ╘╨╒╟
SERIES. ╠╔╙╘╔╬╟ 2 IS THE MAIN ┬┴╙╔├ PROGRAM. ┴S YOU CAN SEE, THERE
ARE NO ╥┼═ STATEMENTS. ┬ESIDE THE FACT THAT ╔ DON'T LIKE ╥┼═S (THEY
CLUTTER UP THE LISTING AND SERVE NO REAL PURPOSE ANYWAY), THEY ALSO
TAKE UP A CONSIDERABLE AMOUNT OF ╥┴═. ╔N TRYING TO MAXIMIZE THE BUFFER
SPACE, ╔ CHOSE TO LEAVE THEM OUT. ╞OR THE BENEFIT OF THOSE WHO ARE
INTERESTED THE FOLLOWING TABLE SUMMARIZES ITS MAIN PARTS.
LINE FUNCTION
----------------------------------------------------------------------
10-80 OPENING DISPLAY, DEFAULT PARAMETERS, ETC.
90-120 CALCULATE ├╨/═ SECTOR FILLING TABLE
130-150 ─┬=START OF DIRECTORY BUFFER,
╘┬=START OF DATA BUFFER IN BANK 0 ╥┴═
─╓() AND ╘┘$() ARE THE SUPPORTED DEVICES
AND FILE TYPES.
160 MAIN MENU SELECT
170-200 READ ╙┼╤ OR ╨╥╟ FILE
210-240 WRITE ╙┼╤ OR ╨╥╟ FILE OR PRINTER
250-300 READ ├╨/═ FILE
310-380 WRITE ├╨/═ FILE
390 READ ╙┼╤ DIRECTORY
400-420 READ ├╨/═ DIRECTORY
440-450 READ A SPECIFIC ├╨/═ SECTOR
460-470 WRITE A SPECIFIC ├╨/═ SECTOR
480-540 ANALYZE ├╨/═ DIRECTORY AND ╞┴╘
550-560 EXIT AND ERROR ROUTINES
╪-╠INK 2.1
570 LOG IN CURRENT DISK
580-600 READ ╨├-─╧╙ DIRECTORY
610-620 READ A SPECIFIC ╨├-─╧╙ SECTOR
630-650 ANALYZE ╨├-─╧╙ ╞┴╘ AND DIRECTORY
660-720 READ ╨├-─╧╙ FILE
730-770 WRITE ╨├-─╧╙ FILE
780-820 RECODE AND WRITE ╨├-─╧╙ DIRECTORY AND ╞┴╘
830-840 WRITE A SPECIFIC ╨├-─╧╙ SECTOR
850 FIND FREE SPACE ON ╨├-─╧╙ DISK
860-870 NORMALIZE ╨├ ─╧╙ AND ├╨/═ FILENAMES
880 DISPLAY FILE STATS
890- ENTER MENU OPTIONS
╘HE MAXIMUM FILE SIZE THAT CAN BE TRANSFERRED IN ANY DIRECTION IS
45.5K BYTES. ╠ONGER FILES WILL BE TRUNCATED TO THIS LENGTH. ╘HIS IS
EQUIVALENT TO 183 ╙┼╤ BLOCKS OR NEARLY 3 FULL ├╨/═ DIRECTORY EXTENTS.
┴LL FILES IN MEMORY ARE ASSUMED TO BE IN ┴╙├╔╔ FORMAT. ╙┼╤ FILES READ
WITH THE CONVERSION OPTION ARE ASSUMED TO BE ╨┼╘╙├╔╔ ON THE DISK AND
ARE TRANSLATED TO ┴╙├╔╔ AS THEY ARE READ IN. ╙┼╤ FILES WRITTEN WITH
THE CONVERSION OPTION ARE ASSUMED TO BE ┴╙├╔╔ IN MEMORY AND ARE
CONVERTED TO ╨┼╘╙├╔╔ AS THEY ARE WRITTEN TO DISK. ╙IMILARLY,
CONVERSIONS ARE MADE WHEN READING FROM OR WRITING TO ╨╥╟ SCREEN CODE
FILES. ┴LL OTHER TRANSFERS ARE DONE IN A BINARY WHAT-YOU-SEE-IS-WHAT-
YOU-GET FASHION.
├╥╧╙╙ ╠╔╬╦ CAN BE USED FOR SIMPLE ┴╙├╔╔ <> ╨┼╘╙├╔╔ CONVERSION OF
╙┼╤ FILES WITH EITHER A 1571 OR 1541 (OR OTHER COMPATIBLE ) DRIVE IN
THE FOLLOWING MANNER:
╨┼╘╙├╔╔ TO ┴╙├╔╔ - READ THE FILE IN ╨┼╘╙├╔╔ <> ┴╙├╔╔ CONVERSION
MODE, THEN WRITE IT IN BINARY MODE.
┴╙├╔╔ TO ╨┼╘╙├╔╔ - READ THE FILE IN BINARY MODE, THEN WRITE IT IN
╨┼╘╙├╔╔ <> ┴╙├╔╔ CONVERSION MODE.
╧NE WORD OF CAUTION FOR ╨┼╘╙├╔╔ <> ┴╙├╔╔ CONVERSIONS. ├╥╧╙╙ ╠╔╬╦
PASSES CONTROL CODES (┴╙├╔╔ VALUE LESS THAN 32) AND CERTAIN OTHER
SPECIAL CODES THROUGH IN BOTH DIRECTIONS UNCHANGED. ╔T ALSO ADDS A
LINE FEED CHARACTER (┴╙├╔╔ ├╚╥$(10)) AFTER EACH CARRIAGE RETURN WHEN
CONVERTING TO ┴╙├╔╔ AND REMOVES ALL LINEFEEDS WHEN CONVERTING TO
╨┼╘╙├╔╔. ╘HE PRESENCE OF THESE CODES IN, FOR EXAMPLE, TEXT FORMATTED
ON A ├╨/═ WORD PROCESSOR MAY REQUIRE THE TEXT TO BE REFORMATTED WITH A
├-128 WORD PROCESSOR BEFORE IT CAN BE USED IN ├-128 MODE.
╔N ADDITION, DOCUMENTS ORIGINALLY WRITTEN OR EDITED WITH SOME WORD
PROCESSORS (SUCH AS ╫ORD╙TAR - EITHER ├╨/═ OR ╨├-─╧╙ VERSION) SHOULD BE
HANDLED IN NON-DOCUMENT MODE (I.E. STANDARD ┴╙├╔╔) ON THESE WORD
PROCESSORS IF THEY ARE INTENDED TO BE SUBSEQUENTLY USED IN ├-128 MODE.
╫ORD╙TAR SETS THE HIGH BITS IN THE LAST CHARACTER OF EACH WORD IN
DOCUMENT MODE. ╘HIS RESULTS IN AN INCORRECT ┴╙├╔╔ TO ╨┼╘╙├╔╔
CONVERSION. ╘HE HIGH BIT CAN ALSO BE STRIPPED OUT USING THE ┌ OPTION
(ZERO THE PARITY BIT) OF ├╨/═'S ╨╔╨ COMMAND TO COPY THE ORIGINAL FILE
TO AN ┴╙├╔╔ COMPATIBLE FILE.
┴ SIMILAR ROUTINE CAN BE USED FOR CONVERTING BETWEEN ╙┼╤ AND ╨╥╟
TEXT FILES. ╫HEN READING THE DIRECTORY, ├╥╧╙╙ ╠╔╬╦ IGNORES THE FILE
ATTRIBUTE (BYTE 11) EXCEPT FOR THE VOLUME LABEL AND SUBDIRECTORY
╪-╠INK 2.1
ATTRIBUTES WHICH DO NOT REPRESENT VALID FILES. ╘HUS YOU CAN DISPLAY
AND ACCESS HIDDEN AND SYSTEM FILES WHICH DO NOT SHOW UP ON AN ╔┬═-╨├
─╔╥ COMMAND. ├╥╧╙╙ ╠╔╬╦ SETS DIRECTORY BYTES 11-25 AND 30-31 TO 0 WHEN
IT IS WRITING A NEW FILE. ╘HIS IS EASIER THAN TRYING TO CALCULATE A
FILE CREATION TIME, DATE, ATTRIBUTE, ETC. ┌ERO BYTES IN THESE
LOCATIONS ARE ACCEPTED BY ╨├-─╧╙. ╞OR A MORE DETAILED DESCRIPTION OF
╨├-─╧╙ FILE FORMATS, SEE ╨ART ╔ OF THIS ARTICLE. ├╥╧╙╙ ╠╔╬╦ WILL
RECOVER UNUSED AND SCRATCHED DIRECTORY AND DATA SPACE FOR BOTH ├╨/═ AND
╨├-─╧╙ DISKS. ╘HIS IS HANDLED AUTOMATICALLY BY ├OMMODORE ─╧╙ WHEN
WRITING TO ╙┼╤ FILES.
├╥╧╙╙ ╠╔╬╦ ╓2.1 IS CURRENTLY CONFIGURED TO WORK WITH UP TO TWO
DRIVES AND A PRINTER. ╞OR ├╨/═ AND ╨├-─╧╙ FILES, AT LEAST ONE OF THE
DRIVES MUST BE A 1571. ╘HE DEVICE CONFIGURATION CAN BE CHANGED BY
ALTERING THE DEFINITIONS OF ARRAYS ─╓() AND ─╓$() IN LINE 130-150. ╘O
USE THE PRINTER FOR A FILE DUMP, SELECT ╙┼╤ ┴╙├╔╔ (FOR AN ┴╙├╔╔
PRINTER) OR ╙┼╤ ╨┼╘╙├╔╔ AS THE TARGET FILE TYPE WITH THE "╙┼╘ ╘┴╥╟┼╘"
OPTION ON THE MAIN MENU. (╘HERE IS NO NEED TO SPECIFY A FILENAME FOR
THE PRINTER. ┴ <RETURN> AT THE FILENAME PROMPT IS SUFFICIENT.) ┘OU CAN
THEN SELECT THE PRINTER AS THE TARGET DEVICE. ╧F COURSE, THE 1541 OR
COMPATIBLE CAN ONLY BE USED TO READ OR WRITE ╙┼╤ FILES, SINCE IT DOES
NOT SUPPORT BURST MODE.
┴LTHOUGH IT IS NOT AN ╔┬═-╨├ EMULATOR, YOU WILL FIND ├╥╧╙╙ ╠╔╬╦ AN
INVALUABLE UTILITY FOR TRANSFERRING FILES FROM ONE MACHINE TO ANOTHER
(AND BETWEEN MODES ON THE ├-128 ALSO) IF YOU USE BOTH AN ╔┬═-╨├ AND A
├-128. ╔T IS ALSO POSSIBLE WITH A LITTLE DETAILED KNOWLEDGE OF THE
DISK FORMATS TO USE THE SAME PRINCIPLES FOR TRANSFERRING FILES TO/FROM
OTHER COMPUTERS AND OPERATING SYSTEMS THAT USE ═╞═ TYPE DISKS, SUCH AS
╘╥╙─╧╙ USED ON THE ╥ADIO ╙HACK COMPUTERS OR POSSIBLY ╥╙ ├O├O ╧╙/9 DISKS
TO ╨┼╘ ╧╙/9 FORMAT.