***************************************************************** * * * MORROW 68K SYSTEM boot EPROMT REV 0. * * * * initial coding: 5/15/84 -bjg- * * * ***************************************************************** 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 ********************** * 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 ******************** * SIO4/DMA equates * ******************** * sio port assignments sbase = ioaddr+$20 * SIO4 base I/O address dmaddrl = sbase * low byte dma address dmaddrh = sbase+$1 * high byte dma address dmaddre = sbase+$2 * extended byte of dma address recntrl = sbase+$3 * receiver control port lcount = sbase+$4 * low byte of dma count hcount = sbase+$5 * high byte of dma count enable = sbase+$6 * start / stop enable dmacntl = sbase+$7 * dma control and status sdata = sbase+$8 * uart data port sstatus = sbase+$9 * uart status port smode = sbase+$a * uart mode register scommnd = sbase+$b * uart command register fifost = sbase+$c * fifo status fifoda = sbase+$d * fifo data dmaglbl = sbase+$e * global dma status sselect = sbase+$f * tty select port * sio constants control = $27 * normal async mode ttya = 0 * select byte for ttya ttyb = 1 * select byte for tttb ttyc = 2 * select byte for tttc ttyd = 3 * select byte for tttd divisor = $d * 9600 baud divisor * sio flags and masks done = $40 * DMA idle when port 27 = 40 sro = $1 * transmit buffer empty when high sr1 = $2 * receive buffer full when high sr6 = $40 * carrier detected when low sr7 = $80 * data set ready when low kick = 1 * value to kick controller *************************** * 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 uerr = $4fe ************************* * B E G I N * ************************* * set baud rates for all four SIO4 ports * 9600 baud, async, no parity, 8 data and 2 stop bits sbaud: move.b #ttya,d2 * select uart 0 sbaud1: move.b d2,sselect * select the tty move.b scommnd,d0 * set up for uart mode reg. 1 move.b smode,d1 * read mode register 1 point to 2 move.b smode,d0 * read mode register 2 point to 1 move.b smode,d1 * read mode register 1 setup for 2 andi.b #$f0,d0 * strip baud rate off ori.b #divisor,d0 * lower 4 bits = 9600 baud move.b d0,smode * write register 2 move.b #control,scommnd * set it for normal async rs232 addq.b #1,d2 * next one cmpi.b #4,d2 bne sbaud1 * PRINT SIGNON init1: move.l #signon,a1 * say hello move.l #ramtest,a6 * set up return through a6 bra string * check for good ram before using stack ramtest: move.l #0,a0 * beginning of ram move.w #qpat,d0 * ramtest pattern ramtst1: move.w d0,(a0) * write it cmp d0,(a0) * check it bne ramerr swap.b d0 * complement move.w d0,(a0) * write it cmp d0,(a0) * read it bne ramerr addq.l #1,a0 * increment ram address bra ramtst1 ramerr: cmpi.l #0,a0 * check for no memory bne ramer2 move.l #ramer1,a6 move.l #rerr1,a1 * no ram message bra string ramer1: halt ramer2: move.l a0,a7 * set up stack bsr paddr * print address move.l $rerr2,a1 * move.l #main,a6 * return to main bra string main: jmp main ************************************************* * * * M O N I T O R * * * ************************************************* warm: move.l #100,sp * memory dump mdump: move.l mstart,a0 move.l mend,a1 move.b #1,d7 * init address counter mdump1: cmpa.l a1,a0 * check for start = end bhi.s mdump2 move.b (a0)+,d0 bsr prnthex bra mdump1 * loop till finished mdump2: rts * format and print the data in d0 at address a0 * check console keyboard after every line prnthex: subq.b #1,d7 * decrement byte counter cmpi.b #0,d7 bne prnhx1 bsr constat * check for key pressed cmpi.b #0,d1 * non zero if pressed bne warm bsr crlf * send carriage return bsr paddr * print address move.b #17,d7 prnhx1: bsr pdata * print data rts * convert and print byte in d1 pdata: bsr hexbyte * convert to ascii bsr space rts * convert and print 24 bit address in a0 paddr: move.b d0,-(sp) move.b a0,a1 * save for later lsr.l #16,a0 move.b a0,d0 bsr hexbyte move.b a1,a0 lsr.l #8,a0 move.b a0,d0 bsr hexbyte move.b a1,d0 bsr hexbyte bsr space bsr space move.b (sp)+,d0 rts * Convert a hex nibble to ascii * byte comes in the d0 register * and is printed from d1. hexnib: andi.b #$0f,d0 * mask upper nibble cmp.b #$0a,d0 * is it > 9 blt.s hexnib1 add.b #'A'-$a,d0 * offset to upper case letters bra hexnib2 hexnib1: add.b #'0',d0 * make it an ascii number hexnib2: move.b d0,d1 bsr conout * print it rts * convert hex byte in d0 from hex to ascii word in d1 hexbyte: move.b d0,d2 * save it for later lsr.b #4,d0 * high nibble first bsr hexnib move.b d2,d0 * low nibble next bsr hexnib rts ************************************************* * * * E N D M O N I T O R * * * ************************************************* ************************************************* * * * S I O 4 C O N S O L E R O U T I N E S * * * ************************************************* * routine gets character from SIO4 board * return with character in d1, d0 preserved conin: move.b d0,-(sp) * stash move.b #0,sselect conin1: move.b sstatus,d0 andi.b #sr1,d0 * check uart rda flag beq conin1 * loop till char rcd conin2: move.b sdata,d1 * send the data andi.b #$7f,d1 * strip msb move.b (sp)+,d0 * retreive rts * check console status-- return with * 0 in d1 if no character ready else * return with the character constat: move.b d0,-(sp) move.b #0,sselect move.b sstatus,d0 andi.b #sr1,d0 * check uart rda flag bne conin2 * go get it if char rcd move.b #0,d1 * else return 0 in d1 move.b (sp)+,d0 * retreive rts * routine sends serial output via direct I/O * to the SIO4 board print character in d1 * d0 preserved. conout: move.b #0,sselect * write select port move.b #0,-(sp) conout1: move.b sstatus,d0 andi.b #1,d0 * check uart tbe flag beq conout1 * loop till empty move.b d1,sdata * send the data move.b (sp)+,d0 * restore rts * routine sends serial output string via direct I/O * to the SIO4 board prints string pointed to by a0. * Return is through a6 to elimnate need for ram string: move.b #0,d2 move.b d2,sselect * write select port string1: move.b sstatus,d0 andi.b #1,d0 * check uart tbe flag beq conout1 * loop till empty move.b +(a0),d1 cmpi.b #'$',d1 * check for end of string beq strnglv move.b d1,sdata * send the data bra string1 strnglv: jmp (a6) * PRINT A SPACE through via conout aspace: move.w #asp,d1 bsr conout rts * PRINT A CARRIAGE RETURN / LINE FEED via conout acrlf: move.w #acr,d1 bsr conout move.w #alf,d1 bsr conout rts signon: .dc.b $d,$a,$a,$a,$a,$a,$a,$a,$a,$a,$a,$a,$a .dc.b $a,$a,$a,$a,$a,$a,$a,$a,$a,$a,$a,$a .dc.b ' Welcome to Morrow Designs 68k system ' .dc.b $0a, $0a, $a, $a, $d .dc.b ' Testing memory, please stand by... ' .dc.b $0a, $0a, $a, $a, $d, '$' rerr1: .dc.b ' No memory in system or incorrectly addressed!! $ ' rerr2: .dc.b ' bytes of system RAM available. (UNIPLUS+ requires ' .dc.b $0a,$0d,$0a,$0a, .dc.b ' at least 7ffffh bytes for operation.) ' .dc.b $0a,$0d,$0a,$0a, '$', mstart: ds.l 1 * memory dump beginning address mend: ds.l 1 * memory dump ending address mfill: ds.w 1 * memory fill character char0: ds.b 1 * ascii value of lowest nibble char1: ds.b 1 char2: ds.b 1 char3: ds.b 1 char4: ds.b 1 char5: ds.b 1 * ascii value of uppermost nibble .end