%OP%TNT %OP%BON %OP%PL64 %OP%AMM %OP%DPF %OP%TM1 %OP%HM2 %OP%FM2 %OP%BM1 %OP%LM05 %OP%HE/%H2%Z88 Users' Club Software Library%H2%/ %OP%FO/Z185/@P@// %CO:A,12,70% %R%%H2%SXX%H2% Shubunkinsoft XModem Transfer %R%by Tom Hawkins and Phil Wheeler %R%Instructions %H2%SXX%H2% is an XModem file transfer package intended as a simpler alternative to a "Link" package such as PC-Link, for transferring files between the Z88 and a desktop computer. Because the standard XModem protocol is used, the desktop machine only needs to run a communications package (as found in many integrated software packages such as MS Works) and it is not necessary to load the special Link software. This is an advantage for Z88 users who don't own a desktop PC but have to "borrow" one to do their file backups, as it eliminates the risk of spreading viruses on the software disc. With %H2%SXX%H2% any make and model of computer can be used for backups, whatever the floppy disc format etc., provided it has an XModem package and an appropriate connecting cable. It's also free! The user interface and backup generation code for %H2%SXX%H2% was written by Tom Hawkins (4666). The code for performing the XModem transfer is taken from %H2%Z88COM%H2% by Phil Wheeler, which is available from the Software Library as Z051. %H2%How to use SXX%H2% Before starting %H2%SXX%H2%, go to the Panel with []S and set the appropriate receive and transmit rates. Set 'Parity' to None and 'Xon/Xoff' to %H2%No%H2% as %H2%SXX%H2% performs its own handshaking during the transfer. Start %H2%SXX%H2% by CHAINing it, or LOADing it and typing RUN. "Assembling..." is displayed while the machine code is assembled, then the menu is displayed with the following options: Receive Send Send Group of files Set last-backup date To choose an option, use the up and down keys then ENTER, or press the appropriate letter. To exit from the program, press ESC. %H2%Receive%H2% On choosing 'Receive' you are asked for the filename of the file to be received. Tell the sending computer to start sending, then type the filename and press ENTER on the Z88. It isn't critical whether the sender or receiver is started first, as they will synchronise within a few seconds. Once the transfer starts, its progress and the number of 128-byte blocks received is displayed in the bottom half of the screen. If nothing happens within 15 seconds, %H2%SXX%H2% will abandon the transfer. If the transfer is successful, %H2%SXX%H2% will return to the menu. Otherwise, an error message is displayed and you are prompted to press a key to continue. %H2%Send%H2% On choosing 'Send' you are asked for the filename of the file to be sent. Type the filename and press ENTER, then tell the receiving computer to receive. As before, it may be a few seconds before the transfer starts. The length of the file in 128-byte blocks is displayed. Messages in the lower half of the screen describe the progress of the transfer. If nothing happens for 15 seconds, %H2%SXX%H2% will abandon the transfer. If the transfer is successful, %H2%SXX%H2% will return to the menu. Otherwise, an error message is displayed and you are prompted to press a key to continue. If the file you specified could not be found, or couldn't be opened due to an error such as 'In use', %H2%SXX%H2% will beep and display the message "Can't open the file", then ask you for the filename again. After a file has been successfully sent, the date, time and filename are appended to a file called %H4%xfiles.log%H4%. This forms a record of which files have been transferred and when. It can be examined and printed by loading it into Pipedream with the 'Load as plain text' option set to Yes. %H4%xfiles.log%H4% can be erased if it is not required. The full filename is specified by the variable lgf$, which is defined close to the beginning of the program. To change the name of the file, or to specify a different device and directory, change the program line which defines lgf$ and SAVE the program again. %H4%Note:%H4% Avoid pressing ESC during the send or receive operation as this may leave files open, producing the 'In use' error when you later try to access the file. The only way to cure this error is a soft reset. If there is a problem with the transfer, such as the other computer failing to respond, %H2%SXX%H2% will abort after 15 seconds of inactivity. Additionally, %H2%SXX%H2% is unable to detect when a send has been terminated by pressing ESC and will log the filename to %H4%xfiles.log%H4% as though it had been successfully transferred. %H2%Send group of files%H2% This option provides a means of backing-up files from the Z88 to a desktop computer. On choosing 'Send group of files', you are asked for a "file specification". This should be a filename containing wildcards so as to specify all the files you want to send. For example, %H4%/letters//*%H4% would specify all the files in the %H4%letters%H4% directory and its subdirectories. %H2%SXX%H2% then prompts, "Send only files updated since:" and gives the date of the last backup. To accept this date, press ENTER; to specify a different date, use the editing keys to change it, keeping the format (eg) "12-Jun-1992 09:30:27", then press ENTER; to send all files irrespective of date, delete the line with <>D then press ENTER. %H2%SXX%H2% now uses a CLI routine to generate a list of the files you specified. If there are a lot of files, this may take some time. %H2%SXX%H2% then displays "Searching" and goes through the list looking for files updated since the specified date. On finding one, it prompts: "Send %H4%(filename)%H4%?". To send the file, press ENTER. To miss it out and move on to the next file in the list, press N then ENTER. When the end of the list is reached, %H2%SXX%H2% returns to the menu. %H4%Note 1:%H4% The date given at the "Send only files updated since" prompt is stored in a file called %H4%sxxlast.dat%H4%. If this file is missing, no date will be given at the prompt. To create the file, use the 'Set last-backup date' option (see below). %H4%Note 2:%H4% No error checking is done on the "Send only files updated since" date in this version of %H2%SXX%H2%! Type carefully! %H4%Note 3:%H4% To generate the list of files to send, %H2%SXX%H2% uses the []+S CLI sequence to create a file called %H4%s.sgn%H4% in the :RAM.- device. This file is erased at the end of the 'Send group of files' operation. It is not recommended to give a "File specification" which includes :RAM.- as this may cause an error. For example, if you want to back up all files on RAM, don't type %H4%:RAM.?//*%H4% but do a separate 'Send group of files' for each RAM device. If a file called %H4%s.sgn%H4% is present in :RAM.- when %H2%SXX%H2% is started, it will be erased. If %H2%SXX%H2% is interrupted, eg by pressing ESC, while in the middle of a 'Send group of files' operation, the %H4%s.sgn%H4% file will be left in :RAM.- and should be erased using the Filer. %H2%Set last-backup date%H2% Choosing 'Set last-backup date' allows the time and date which appear at the "Send only files updated since" prompt (see above) to be set. You will be prompted with the current time and date; press ENTER to accept this or use the editing keys to change it. (See Note 2 above.) The last-backup date is stored in a file called %H4%sxxlast.dat%H4%. The name of this file is specified by a variable called lxf$, which is defined close to the beginning of the program. To give the file a different name, or to specify a different device and directory, change the program line which defines lxf$ and SAVE the program again. %H2%Exiting from SXX%H2% To exit from %H2%SXX%H2% press ESC while the menu screen is displayed. %H2%SXX%H2% may also be safely <>KILLed from the Index while in this condition. %H2%The XModem protocol%H2% The XModem protocol was written for the public domain by Ward Christiensen in 1977 or so and its intimate details should be fairly easy to find out if you want to know - try a bulletin board for starters. Essentially, the %H4%sending%H4% computer waits until it receives an ASCII NAK character (21) then sends a 128-byte block of data with a header identifying its block number and a checksum byte which the receiving computer uses to detect errors in transmission. If the receiving computer receives the block correctly, it transmits ACK (6) and waits for the next block; if the block was received corrupted, the receiver transmits a NAK and the sender retransmits the block. An upgraded version of XModem uses a cyclic redundancy check (CRC) instead of the checksum to verify that the data is uncorrupted; this has much better immunity to errors going undetected. %H2%SXX%H2% does not use the CRC; however, a computer running XModem-CRC will revert to the ordinary protocol if the machine on the other end doesn't respond. If your transfers always take a few seconds to get started, this is probably what's going on. %H4%Note:%H4% Because XModem does not transmit the actual length of the file, the file as received will contain up to 127 extra characters to make its length up to a multiple of 128 bytes. In the case of a BASIC program received by the Z88 these characters can be ignored and will be lost next time the program is LOADed then SAVEd. In the case of a Pipedream file the extra characters will appear after the lowest occupied slot in the rightmost non-empty column and may be deleted. For other files, such as CLIs and PrinterEds, the extra characters may cause problems. Before using such a file after it has been loaded into the Z88 via %H2%SXX%H2%, it should be loaded into Pipedream as 'Plain text', and the extra characters deleted before saving it, again as 'Plain text'. This problem has been addressed in later updates of XModem such as YModem and ZModem, which send not only the length but also the filename and creation and modification dates of the file. They also allow for sending and receiving batches of files and for using longer blocks to speed up transfer where line conditions are good. I have the details of both these protocols... but for the money for the Developer's Notes and the time to write and debug the code I'd implement them for the Z88... if you're interested in doing this please get in touch, otherwise don't hold your breath, kids! %H2%Wiring the connecting cable%H2% The only connections required between the two computers are: RxD on the Z88 to TxD on the other machine, TxD on the Z88 to RxD on the other, and GND on the Z88 to GND on the other. This is known as a %H4%null modem%H4% cable. Additionally, connections must be made between some pins in the plug at each end to put the correct voltage on each computer's 'handshaking' inputs for data to be sent. %P0% Suggested configurations for connecting cables are: Connect: Also connect: (within the plug) I believe the PC-Link cable should work with %H2%SXX%H2% although I haven't tried it myself. There's only one way of wiring up the BBC port so I assume the BBC-Link cable will work. However (that sounded too simple didn't it?) remember there are two ways of inserting the plug into the BBC! Work out which is correct then LABEL which is the top of your plug! These instructions were written by: Tom Hawkins (4666), 44 Harborough Road, Southampton SO1 2FY 28th April 1992 %CO:B,12,66%%CO:C,12,54% R S G D Z88 2 (TxD) to 3 (RxD) to 7 (GND) to 5 to 8 and 9 %CO:D,12,42% PC/XT (25-pin) 3 2 7 6 to 8 and 20 %CO:E,12,30% PC/AT (9-pin) 2 3 5 1 to 4 and 6 %CO:F,18,18%  BBC B (DIN 5C) A B C D to E %H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%%H3%