|
DataMuseum.dkPresents historical artifacts from the history of: RegneCentralen RC850 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RegneCentralen RC850 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3456 (0xd80) Types: TextFile Names: »LSTDRV.MAC«
└─⟦9f46c4107⟧ Bits:30005988 Sources for TurboDOS ver. 1.30 device drivers └─⟦this⟧ »LSTDRV.MAC«
.Z80 TITLE LIST DRIVER FOR RC-850 SUBTTL COPYRIGHT (C) 1983 BY ASE GMBH 6472 ALTENSTADT, INDUSTRIESTR. 17 ;Version: 08.12.83 ; ;23.08.83 : mod. for BIS3270 ; NAME ('LSTDRV') ; SIO1D EQU 09H ;printer data port address SIO1C EQU 0BH ;printer control port address CTCCH1 EQU 0DH ;ctc channel 1 register (printer baud rate) ; DSEG ;LOCATED IN DATA AREA ; ; CTSBR:: DB 63 ;printer baud rate LSTFF:: DB 0CH ;printer form feed WAITFL: DB 0 ;wait flag (BIS3270 print mode) ; TEVENC: DW 0 ;TIMER VALUE FOR DISPATCHER DW $ ;TRANSMITER INTERRUPT DW $-2 ; ; MUEXSP: DW 1 ; DW $ DW $-2 ; ; COMMON /?INIT?/ ;LOCATED IN INITIALIZE AREA ; LSTNIT:: LD HL,PRTISR ;set transmitter interrupt vector LD (SIO1V##),HL ; LD A,(S1REG5) ;get SIO reg 5 OR 82H ;set DTR and RTS LD (S1REG5),A ; LD HL,SIOCH1 ;init. sio LD B,SIOBPL ; LD C,SIO1C ; OTIR ; ; LD HL,CTSBR LD D,(HL) ;RQUESTED BAUD RATE TO D-REG LD A,47H ;GET CTC CHANNEL CONTROL WORD OUT (CTCCH1),A ;INITIALIZE CTC CHANNEL LD A,D ;GET REQUESTED BAUD RATE CODE AND 0FH ;LIMIT TO 16 BAUD RATES LD E,A ;TO E-REG LD D,0 ;MAKE IT DOUBLE LENGTH LD HL,BRTBL ; ADD HL,DE ;INDEX INTO TABLE LD A,(HL) ;GET TIMER VALUE OUT (CTCCH1),A ;SET CTC CHANNEL TIME CONSTANT LD A,1 ;RESET PRINTER STATUS LAMP OUT (3),A ; RET ;DONE ; SIOCH1: DB 0 ; DB 4 ;SELECT WR4 S1REG4::DB 4FH ;WRITE REGISTER 4 CONTROL WORD DB 5 ;SELECT WR5 S1REG5::DB 28H ;WRITE REGISTER 5 CONTROL WORD DB 3 ;SELECT WR3 S1REG3::DB 20H ;WRITE REGISTER 3 CONTROL WORD DB 1 ;select wr1 DB 02H ;write register 1 control word SIOBPL EQU $-SIOCH1 ;SIO PORT B PROGRAM LENGTH ; BRTBL: DB 0 ;150 BAUD TIMER VALUE DB 128 ;300 BAUD TIMER VALUE DB 64 ;600 BAUD TIMER VALUE DB 32 ;1200 BAUD TIMER VALUE DB 16 ;2400 BAUD TIMER VALUE DB 8 ;4800 BAUD TIMER VALUE DB 4 ;9600 BAUD TIMER VALUE DB 2 ;19200 BAUD TIMER VALUE ; ; CSEG ;LOCATED IN PROGRAM AREA ; LSTDR@:: LD HL,MUEXSP ;lock driver CALL WAIT## ; ; LD A,E ;test function required CP 2 ;on 2 character output CALL Z,CHROUT ; CP 7 ;function number 7 ? CALL Z,EOFPRT ; ; LD HL,MUEXSP ;unlock driver CALL SIGNAL## ; RET ;DONE ; ; EOFPRT: LD HL,LSTFF ;get form feed character LD A,(HL) ; LD C,A ; CHROUT: LD HL,WAITFL ;get wait flag address I LD A,0FFH ; I 3270 mod. LD (HL),A ;set wait-flag I ; LD A,C ;START OUTPUT OUT (SIO1D),A ;send byte to printer LD HL,TEVENC ;get event counter CALL WAIT## ;WAIT FOR INT LD A,1 ;reset printer status lamp OUT (3),A ; XOR A ;A = 0 RET ;DONE ; ; PRTISR:: DI ; LD (INTSP##),SP ; save stack-pointer LD SP,INTSTK## ; set up aux stack-pointer PUSH AF ;SAVE REGISTERS PUSH BC ; PUSH DE ; PUSH HL ; LD A,0 ;set printer status lamp OUT (3),A ; LD A,28H ;RESET TRANSMIT READY INT. OUT (SIO1C),A ; ; LD HL,WAITFL ;---------- LD A,(HL) ;get wait flag CP 0 ;only used during 3270 print output JR Z,NOWAIT ; LD A,0 ;reset wait flag LD (HL),A ;---------- ; LD HL,TEVENC ; CALL SIGNAL## ; NOWAIT: POP HL ; POP DE ; POP BC ; ld a,(rbtflg##) cp 0ffh jr z,rbte POP AF ; LD SP,(INTSP##) ;restore stack ei reti ; rbte: ld a,(bnklst##) cp 0 ;interrupt from bank 1 ? jr z,bk1int ;yes, only return pop af ld sp,(intsp##) ei reti ; bk1int: pop af ld sp,(intsp##) ret ; ; END «eof»