80-Bus News

  

November-December 1982, Volume 1, Issue 4











Page 37 of 51











DRIVE ROUTINES FOR THE GEMINI GM822 RTC MODULE

OOAR’ 00B2’ O0B6" OOBT’ OOBB’ OOBF’ o0cs’ ooc7’ oocs’ oocc’ oopo’ oop4’ oops"

OOFO’ ooF2’ OOF4" OOF6’ OoF8’

oor’ OoFB’ ooFD’ OOFF’ o101’

0102" 0104" 0106" 0108" O10A’

O10B’ o1op’ O10F’ ott os" o115? o117"

33 5A 36

34 38 53 or 65 54 72 74 4A 65 72 4D 715 719 53 63 76

38 D3 3 DS og

38 D3 35 D3 cg

35 D3 38 D3 cg

38 D3 38 D3 35 D3 cg

3A

15 68 57 68 69

64 62

44.

61 6E 44 65 74 44

FF iE FF 1B

FF iF FF iF

FF 1B

1B

1D PF iF 10 iF

32

6E 54 65 5 53

68 4D 70 79 4A 75 70 48 65

3A 3A

4D 75 64 46 61

46 61 72 4A 6C 67 4F 6F 63

M-80 14 Sep 1982 14:48 PAGE 1-2

3; Data strings

INVAL: DEF "3:6:4:2:8’ 3; Input validation

DYSTRG: DEFB "SunMonTueWedThuFriSat’

MNSTRG: DEFB ‘JanFebMarAprMay JunJlyAugSep0ctNovDec

HE PIO control subroutines

ae em en

3 Set data port to control mode, all lines input INDATA: LD A, CMODE 3 Control mode ouT (PCDATA) ,A ; Set mode word LD A, ALLIN our (PCDATA) ,A 3 Set direction RET

3 Set command port to control mode, all lines input INADDR: LD A, CMODE ; Control mode our (PCADDR) ,A ; Set mode LD A, ALLIV our (PCADDR),A 3 Set direction RET

3 Set data port to control mode,

OUDATA: LD A, CMODE : our (PCDATA), A ; LD A, ALLOUT

ouT (PCDATA), A ; Set direction RET

all lines output Control mode Set mode

; Set command port to control mode, all lines output : EXCEPT the INT line (OB4H)

3; Ensure all data lines ... out (PADDR) ,A : ;

«ee Will be t’s LD A, CMODE Set mode

our (PCADDR),A

LD A, INTOUT 3 Set direction our (PCADDR),A

RET

DRIVE ROUTINES FOR THE GEMINI GM822 RTC MODULE

0118’ O11A’ o1ic’ O11E o120’

o121’ 0123’ 0126’ 0128" O12a’ ot2c’

o12E* ost 0134" 0137" 0139’ O13B’ O13D’ O13F 0142! o144’ 0146" 0148’ O14a’ O14B’ o14ac’ o14p’ O14R’ 0150’

0151" 0154"

ED ED DB ED cg

D3 cD ED ED ED 18

cD cD ai 06 16 iE On cp E6 FE 28 C6 77 25 15 1D

cg

cep cD

34 59

51

1c 0102" 51 59 54 c2

oO10B’ ooFro’ O2BB’ oc EC 8c 4D o11s’ OF OF E6 30

EF

O10B’ 0102"

M-80 14:48

REE IN IEEE BEE HHH RAHM EE IE

##** Subroutines to read/write to the RIC KeRH ##88 Called with:- Hee wee C=PADDR – data port for command **#* HeEE D’RTC register address HE

whee EeRTC reg. + strobe (R or W) HRH JHE HHI H EEE HEI HEHEHE HEHEHE HHH:

14 Sep 1982 PAGE 1-3

a

; Read a RTC regiater READ: OUT (c),D ouT (c),8

IN A, (PDATA) our (c),D RET

3; Write <A> to a RIC register WRITE: ouT (PDATA),A CALL OUDATA out (c),D our (c),E our (c),D JR INDATA

RRER HE

a on em ae

RDRTC: CALL OUADDR

CALL INDATA

LD HL, WSPACE

LD B12

LD D, TMONTH+NOSTRB LD B, THONTH+RDSTRB LD C, PADDR

CALL READ

AND OFH

cP OFH

me %,RDRTC

ADD A, 30H

LD (HL),A

INC HL

DEC D

DEC E

DINZ RDRTCL

RET

RDRTCL:

Y c

CALL CALL

OUADDR OUDATA

en se en om

Wm ee Rem tom

a eS es

Write workspace to RTC (Used when initializing the RTC)

Set up address Read strobe on Read a nibble Strobe off

Put data in PIO register Set to output

Address the RTC

WR strobe on

WR strobe off

Set back to input

KEEREEREEE REE EEE EEE ENE EEE EER EDR ERNE ION EEE EEN

Routine to read the RIC registers to work space in RAM

REED (HL) RERK

at Set command port to o/p

Set data port to i/p

Read into here

12 registers to read

10’s of months + no strobe 10’s of months + read strobe € = control port address Get the data

Tsolate the lower nibble Valid?

No, so start again

Yes, so make it ASCII

Store in workspace

Next RIC register

Loop if more Done

HABE SHEE

Set command port to o/p Set data port to o/p


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 37 of 51