; Set CRT Parameters at 40:00 ; Created 1-22-85 by Don Tarbell. ; Last changed 2-12-85 by Don Tarbell. ; Equates. false equ 0 true equ not false datseg equ 40h ; PROM data segment. crtofs equ 15h ; offset within segment for crt codes. keyofs equ 80h ; offset within segment for key codes. pcsbas equ 0f000h ; Duplex 816 i/o port base. stata equ pcsbas+182h ; 2681 port A status/control address. statb equ pcsbas+192h ; 2681 port B status/control address. ; ********** stack area. ************* stack segment para stack 'stack' db 10 dup('stack ') stack ends ; ********** data area. ************** workarea segment page public 'data' ; Record 7 of CB-86 128-byte fixed-length records. ; (covers crt table and crt initialization table.) ; crt table. crttab db 0 ; number of columns. db 0 ; number of rows. dw 0 ; number of characters. db 0 ; video type byte. db 0,0,0,0,0 ; insert line. db 0,0,0,0,0 ; delete line. db 0,0,0,0,0 ; set intensity to dim. db 0,0,0,0,0 ; set intensity to bright. db 0,0,0,0,0 ; clear to end of screen. db 0,0,0,0,0,0,0,0 ; set cursor position. db 0,0,0 ; enter character graphics mode. db 0,0,0 ; exit character graphics mode. db 0,0,0 ; enter point plot graphics mode. db 0,0,0 ; exit point plot graphics mode. crtend label byte ; end of crt table to send. bauda db 0 ; 2681 port A baud rate code. ; crt initialization sequence table. crtist db 77 dup(0) ; first byte is number of bytes. ; Record 8 of CB-86 128-byte fixed-length records. ; keyboard table. keytab db 128 dup(0) ; first byte is number of bytes. ; Record 9 of CB-86 128-byte fixed-length records. ; printer table. baudb db 128 dup(0) ; 2681 port B baud rate code. workarea ends ; ********** code area ********** cseg segment para public 'code' ; main program. start proc far assume cs:cseg, ds:workarea, ss:stack, es:nothing ; set up stack for return to DOS. push ds ; save return segment address. mov ax,0 ; put zero onto stack. push ax ; initialize segment registers. mov ax,datseg ; es = PROM data segment. mov es,ax mov ax,workarea ; ds = work area. mov ds,ax ; move crt table to PROM data area if requested. cmp crttab,0 ; is move requested? jz checka ; hop if not. mov cx,(offset crtend)-(offset crttab) ; cx = number of bytes. mov si,offset crttab ; si = crt table offset. mov di,crtofs ; di = crt table destination. rep movsb ; move the table there. ; set baud rates if requested. checka: cmp bauda,0 ; should we set new baud A rate? jz checkb ; hop if not. mov dx,stata ; dx = port A status address. mov al,bauda ; al = new baud rate code. out dx,al ; set new port A baud rate. checkb: cmp baudb,0 ; should we set new baud B rate? jz checkc ; exit if not. mov dx,statb ; dx = port B status address. mov al,baudb ; al = new baud rate code. out dx,al ; set new port B baud rate. ; send crt initialization sequence if requested. checkc: mov bx,offset crtist ; bx = table address. cmp byte ptr [bx],0 ; was it requested? jz checkd ; hop if not. mov cl,[bx] ; cl = byte count. mov ch,0 ; cx = byte count. inc cx ; extra byte for count. cinitl: inc bx ; bump pointer. mov al,[bx] ; al = byte to send. mov ah,14 ; ah = tty subfunction code. int 10h ; send it. loop cinitl ; loop till done. ; move keyboard table to PROM data area if requested. checkd: mov si,offset keytab ; si = keyboard table address. cmp byte ptr [si],0 ; is it requested? jz termin ; hop if not. mov cl,[si] ; cl = byte count. mov ch,0 ; cx = byte count. inc cx ; add 1 word for count, lead-in. mov di,offset keyofs ; di = destination. rep movsw ; move it. termin: ret ; terminate program. start endp cseg ends end start