01.03.2014 Views

Section 2 - Commodore Computers

Section 2 - Commodore Computers

Section 2 - Commodore Computers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11A 114 COMPUTE! Mov,W82.lssue May, 1982. Issue 24<br />

counting for one error in a transfer of 10,240<br />

bytes, the transfer time would be about six minutes.<br />

I If f the records were 256 bytes long, the transfer<br />

time would be about 5.9 minutes, and with 1024<br />

byte records it would be about 6.5 minutes. It<br />

would seem that the 256 byte format would be the<br />

best choice, but another factor must be taken into<br />

account: the error detection method used.<br />

In the method used for the CP/M system, it is<br />

very simple, and the more bytes it is required to<br />

check, the greater the chance is that it will miss an<br />

error. r. Because of this, the 128 byte format is a<br />

better choice even though there is a small increase<br />

in m the transfer time. Ifa a beller better error detection<br />

method were to be used, it would probably be<br />

beller better to use the 256 byte record format.<br />

A Transfer Format<br />

The actual structure re of the record that is transfen'ed<br />

ferred varies from system to system as well. In [n fact,<br />

it is even less standardized than most other pans parts of<br />

the data transfer format.<br />

Since there is no' real standard forr the record<br />

format, I will describe one of the more heavily<br />

used formats. This s format got its start on CP/M·<br />

CP/M-<br />

based systems and originally appeared in a program<br />

written by Ward Christensen called, appropriately<br />

enough, "MODEM." The first problem when<br />

dealingg with CP/M is its refusal to acknowledge the<br />

existence of a modem. So a transfer program must<br />

provide its own link to the modem.<br />

To begin the transfer, the receiving computer<br />

sends an ASCII NAK K (15H) signal every couple of<br />

seconds until unlilthe sending computer sends an ASCII<br />

ACK (06H). This is the synchronization part of the<br />

transfer. TheT original modem program assumed<br />

that the program was predefined at both ends, so,<br />

once synchronization ni was achieved, the data was<br />

immediately sent.<br />

The record format that is used consists of a<br />

header, the data, and finally y a checksum character<br />

for error detection. The header consists of an<br />

ASCII SOH character (OIH) (0 I followed by the current<br />

record number (starting with number one) o which is an eight bit value. That is followed owed by the<br />

same number, but inverted. (That is, if record 01H0 I H<br />

is being sent, then the second number sent will be<br />

FEH.) This is then followed by the data itself for<br />

the next 128 bytes. Finally, one more character is<br />

sent which is the checksum.<br />

The checksum is an eight bit value e that is the<br />

sum m (without carry) of alla the data bytes sent. The<br />

sending computer compuLer then waits for the receiving recei\' in g<br />

computer to acknowledge that it received the e data. daLa.<br />

The l ~ h e receiving g computer compares cOlllpares its own calculated<br />

checksum against the one that Lhat the one that Lhat<br />

the sending computer sent and, if they match, it<br />

sends an ASCII ACK character (06H).<br />

If they<br />

don't match, it sends an ASCII N NAKA K character<br />

((15H), indicating that it il didn't receive the data<br />

correcLl y. IfLhesending compute r receives a NA K.<br />

correctly. If the sending computer receives a NAK,<br />

it will send the record again. . I If, r. afLer after Len ten tries it is<br />

unable to send the record it gives up and aborts the<br />

unable to send the record it gives up and aborts the<br />

transfer. After all off the recordss have been sent, a<br />

final ASC II EOT (04 H) is sent indicating that the<br />

transmissio n is completed.<br />

final ASCII EOT (04H) is sent indicating that the<br />

transmission is completed.<br />

Some Problems<br />

There are several problems wi th the format that is<br />

There are several problems with the format that is<br />

used and some of the later versions attempted to<br />

correct for this. Unfortunately, this created a new<br />

problem since any change in the basic format meant<br />

it was incompatible with the old format. This tended<br />

to lead towards a real mess with patches to allow<br />

for compatibility to the old programs. Discounting<br />

the versions which were simply adaptations for<br />

the versions wh ich were simply adaptations for<br />

different modems, some of the differences that<br />

to specify it. T here was also change from the check­<br />

different modems, some of the differences that<br />

have occurred are the addition of the program<br />

identifier so that the sending computer cann tell the<br />

receiving computer the progl'am program name instead of<br />

requiring the operator r at the receiving compuLer<br />

computer<br />

to specify it. There was also change from the check<br />

sum format to a CRC format. The identifier has<br />

been implemented several ways, but bUL the most<br />

popular version is also one of the sLrangesL<br />

strangest<br />

i implementations.<br />

III Lations.<br />

A After I' LeI' synchronization has been achieved, , the<br />

currently popular program (MODEM7) (MODEM?) sends the<br />

filename e nanle a character at a titlle time. . That is, it sends a<br />

character and then wails waits<br />

for an acknowledge<br />

(ASCII<br />

ACK) from the receiving g computer. compuLer. Then<br />

it iL sends the next character of the filename and<br />

repeats this until the entire filename has been sent.<br />

After AfLer that, thaL, it iL waits for the receiving computer to<br />

send the checksum of the filename and then Lhen compares<br />

the received checksum against againsL its iLs own inter­<br />

nally calculated checksum. If they are equal, the<br />

nall y calculaLed checksum. If Lhey are equal, the<br />

sending computer se nds an ASC I [ ACK character.<br />

sending computer sends an ASCII ACK character.<br />

The sending computer puLer goes back and waits wailS for<br />

resynchronization. (Waiting (' Na iLing for i'or an ASCII NAK<br />

character.) Ler.) At AL last, lasL, it iL starts sLarts receiving g data normally<br />

y<br />

after the resynchronization ni zalion is achieved.<br />

If there was a checksum error, the sending<br />

If there was a checksum error, the sending<br />

computer sends a bad name character characLer which, for<br />

no particular panicular reason, , was defined as an ASCII // /I<br />

(75H) 1-1 ) and goes back to LU allow resynchronization<br />

ynchronizaLion<br />

and retransmission rCLranslllission of the name. If, I f. after ten len tries<br />

the name cannot not be sent, the transfer is aborted.<br />

Improved Error Detection<br />

Another AnoLher problem that Lhat some versions have corrected correcLed<br />

for fa r is that thaL the checksum method meLhod of error detection deLection<br />

is not t the e most accurate means ofo f detecting an<br />

error. A CRC (cyclic ic redundancy check) is a far

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!