30.12.2013 Views

May June 1980 - Commodore Computers

May June 1980 - Commodore Computers

May June 1980 - 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.

MAY/JUNE. MAY/JUNE, <strong>1980</strong>. ISSUE 4.<br />

COMPUTE.<br />

113<br />

order data bit, so I let programming convenience<br />

override generality, and output the highest order<br />

bit always as a mark, followed by sufficient marks to<br />

act as stop bits and marks until the next data come<br />

along.<br />

along.<br />

Table 2 Output parameters<br />

A. The frequency output by the 6522 shin shift register is given<br />

by the formula<br />

Frequency = System clock frequency,<br />

4 •* (contents ts of T2 low + 2)<br />

assuming that the shift register contains 01010101 or 10101010. 10.<br />

The PET sys tem clock appears to be spot on 1 MHz,<br />

The PET system clock appears to be spot on 1 MHz,<br />

and we calculate<br />

use T2 low<br />

For frequency<br />

use T2 low<br />

2225 Hz<br />

6E hex -= 110 decimal answer mark<br />

2025 Hz<br />

79 hex -= 121 decimal answer space<br />

t270 1270 Hz<br />

C3 hex R = 195 decimal originate mark<br />

1070 Hz<br />

E8 hex '"" = 232 decimal originate space<br />

If desired, frequencies may be halved by usingg 00110011<br />

in the shift register, and divided by four by using 00001111.<br />

Depending on the equipment used, , a certain amount of<br />

inaccuracy can be tolerated. I found no equipment that<br />

would give errors in the following ranges:<br />

69 to 71 instead of 6E 8B55 to D3 instead of C3<br />

76 to 80 instead of 79 DA to 10 F8 instead of E8<br />

B. The timing loop as given by the present machine e code yields yictds<br />

Bit time = 1284 XR + YR - 1257<br />

clock cycles between successive loads of 6522 T22 low,<br />

give or take one cycle due to the difference in execution<br />

times between n mark and space caused by the branch at 0347.<br />

With the e PET's one microsecond dock clock period, period. we have<br />

XR = - INT( Bit time + 1257 ) ,<br />

1284<br />

1284<br />

YR = _ Bit time + 1257 - 1284 XR<br />

XR<br />

For baud rate<br />

one data bit time XR YR SB S8<br />

110 0<br />

9091 1 us.<br />

08<br />

OF( ( = - 15)<br />

16 (=22)( - 300<br />

3333 us.<br />

03<br />

93( ( = . 147)<br />

07<br />

4% error seems to be tolerable. For for 110 I ill baud, we can<br />

range from XR.YR XR, =07,CO= to 08,60; for 300 baud we can<br />

range from 03,70 to 10 03,B8.<br />

1 GOTO 1000 Bl00<br />

2 LIST 99<br />

3 SS="8.03 S$; S14: 11 4: CHEEP PRINT MASTER WITH -. ~<br />

YR<br />

-.DISASSEMBLER"<br />

~DISASSEMBLER~<br />

4 RETURN<br />

5 LINE FUNCTION: 23 LIST STYLE: : 43 BOLL ROLL -. ~<br />

-nPAPER:50, ~PAPER:50,63 63-66 - 66<br />

BAUD RATE<br />

6 LINE FUNCTION: 55 PAGE FORMAT FORHAT FROM -. ~<br />

i85-86: ~8S - 86 : 56 CRLF FROM 87-88<br />

7 P=LEN(PS):IF P:LEN(P$) : P THEN FOR P0=1 PO:1 TO P:<br />

-.P=ASC(MID$(PS,P0,l) ~P:ASC (MID$(P$ , PO,l)) ) ;GOSUB8: :GOSUB8 :<br />

-.NEXT ~NEXT P0: : RETURN<br />

8 POKE 10 IB23,P: 23,P:EYS(M0) SYS(M0) :RETURN:REM : RE~! POKE -> .,<br />

-dB23,0:SYS{M0) :RETURN:REM FILL -.<br />

.,1023 , O: SYS(MO):RETURN : REM FILL ~<br />

.,NUL LS<br />

-.NULLS<br />

10 GOSUB 70:GOSUB : 3:PRINT 3 : SS:INPUT S$:INPUT -. ~<br />

-."LIST .,"LIST_~~~- «F=(F+(Q=3 4} ) AND1:C=C-(F*Q=5 8) : NEXT<br />

25 IF PY+OPV-PB PY+C>PV-PB THEN TI.IEN GOSUB 41<br />

26 F=1:FOR F:1:FOR J=Y TO Z:Q=PEEK(J):F=(F+(Q=34<br />

Z:O=PEEK(J) :F:(F+(O;J4<br />

i) .,)IAN01<br />

)AND1<br />

27 IF Q*F=58 O·F=58 THEN GOSUB GaSUS 45:GOSUB :GOSUS 46:<br />

:<br />

-.GOSUB -.cOSUB 39:SS=" 39:S$. " :":GOTO 30<br />

28 GOSUB GaSUB 32:IF PL+LEN(S$)+LEN(A$) (£5) (AS) >= >:., -i<br />

.,PH-PR THEN GOSUB 45 : GOSUB 46:<br />

-.PH-PR THEN GOSUB 45:GOSUB 46:<br />

-.GOSUB ,casus 39:S$=" 39 : S$="<br />

29 SS=SS+A$ S$=S$+AS<br />

30 NEXT J:GOSUB J : 45:GOSUB 45:GOSUS 46:GOSUB 46 39:<br />

-.GOSUB -.cOS US 39:GOSUB 40:GOTO 16<br />

32 AS="":IF A$="":IF Q>127 0 >127 THEN AS=CHRS(114}:<br />

A$=CIIR$(114):<br />

-.Q=Q-128 "0"'0-128<br />

33 IF Q>63 0 >63 THEN A$=A$+CHR$(115):Q=Q-64<br />

A$. A$+CHR$(l 1S ) :0=0-64<br />

3344 AS=AS+CHRS(Q-64*(Q

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

Saved successfully!

Ooh no, something went wrong!