***************************************************************** * * * MORROW 68K SYSTEM dumb terminal . * * * * initial coding: 5/9/84 -bjg- * * * ***************************************************************** .text .org $5000 ioaddr = $ff0000 * compupro i/o address space * Compupro interfacer IV equates sio = ioaddr+$10 * interfacer base address siostat = sio+$1 * uart status siodat = sio * uart data select = sio+$7 * group select port console = 7 * interface left port aux = 6 * interfacer middle port * mult i/o equates base = ioaddr+$48 * standard base address grpctl = base+$7 * select port dll = base * divisor latch lsb dlm = base+$1 * divisor latch msb ier = base+$1 * interrupt enable register lcr = base+$3 * line control register mcr = base+$4 * modem control register lsr = base+$5 * line status register rbr = base * receive buffer register thr = base * trasnmitter holding register dlab = $80 * divisor latch access bit thre = $20 * transmitter hold reg empty status dr = $1 * received data ready status * miscellaneous equates alf = $a * ascii line feed acr = $d * ascii carriage return asp = $20 * ascii space acs = $1a * ascii clear for ADM31 qpat = $AA55 * initial ram test pattern spat = $00ff * marching pattern stop = $F0000 * end of 2 Meg ramtest area page = 1024 * 2K X 8 ram chips image = 0 init: move.b #aux,select * select middle UART move.b #$ee,$ff0012 * set up uart protocol mode move.b #$7e,$ff0012 * set up baud rate = 9600 move.b #$27,$ff0013 * set up command mode right move.b #acr,d1 * send a carriage return bsr auxout main: bsr constat * check for key pressed on terminal cmpi #0,d0 beq main1 * if none, check data from host cmpi.b #$1b,d0 * check for terminal escape bne main0 rts * go back to CP/M on break main0: move.b d0,d1 bsr auxout * send it out to host main1: bsr auxstat * check for input from host cmpi #0,d0 beq main * if none check keyboard move.b d0,d1 bsr conout * else send to terminal bra main constat: move.b #console,select * select uart move.b siostat,d0 * get status andi.w #2,d0 * check for data available bne conin * branch if data available moveq.l #0,d0 * else set result false rts * return with character in the d0 register conin: move.b #console,select * select uart move.b siostat,d0 * read status andi.w #2,d0 * check for data available beq conin * loop till key pressed move.b siodat,d0 * get the character and.l #$7f,d0 * strip bit 7 rts * send character in the d1 register conout: move.b #console,select * select uart move.b siostat,d0 * read status and.b #$1,d0 * check for tbe flag true beq conout * loop till true move.b d1,siodat * send the data rts auxstat: move.b #aux,select * select uart move.b siostat,d0 * get status andi.w #2,d0 * check for data available bne auxin * branch if data available moveq.l #0,d0 * else set result false rts auxin: move.b #aux,select * select uart move.b siostat,d0 * read status andi.w #2,d0 * check for data available beq auxin * loop till key pressed move.b siodat,d0 * get the character and.l #$7f,d0 * strip bit 7 rts auxout: move.b #aux,select * select uart move.b siostat,d0 * read status and.b #$1,d0 * check for tbe flag true beq auxout * loop till true move.b d1,siodat * send the data rts .end