; MT70ALT.ASM patch. ; Written by Phil Hess, February 1986. ; Feel free to modify as needed. ; User console output (UCONO) patch code for NewWord ; to allow on-screen display of the Morrow MDT-60/MT-70 ; terminal's alternate character set when within ; the strikeout printer controls (^P^X). ; To print documents containing these alternate ; characters, use the program NewPrint (see elsewhere), ; as NewWord will still print the normal ASCII characters ; entered. ; Assemble with CP/M's ASM assembler and enter using ; NWINSTAL (menu H-2-C) starting at address 042E. ; Also, change address 0378 from 73 to 72 (menu H-1-U) ; so that strikeout characters (now displayed as alternate ; characters) don't display highlighted on screen. ; UCONO replaces the normal NewWord routine which sends ; each character to the terminal for display. ; This patch checks whether character to display has ; strikeout bit set in its attribute byte. If so, ; it sends the escape sequence and substitute character ; necessary to display the alternate character. ; The characters entered are still stored in the document ; as their normal ASCII selves. ; The ASCII characters entered within strikeout controls ; are mapped to and displayed as the alternate characters ; as follows (values given are the identifying hex codes ; on page 1-4 of the MT-70 manual): ; ASCII chars Alternate chars ; 20-4F 80-AF ; 50-5F C0-CF ; 60-7E E0-FE ; Because normal escape sequences sent by NewWord to ; control the screen can also have the strikeout attribute ; bit set, UCONO keeps track of what passes through, ; allowing an ESC followed by a left or right parenthesis ; (commands for bright and dim) or an ESC followed by two ; more characters (e.g., escape sequence to set screen ; attributes) to pass through without attempting to display ; them as alternate characters. ; Easily modified for other terminals with alternate ; character sets by substituting in the appropriate ; escape codes and changing the mapping of ASCII to ; alternate characters. org 42EH ;starting point of patch code bdos equ 5 ;operating system entry point ucono: jmp morpat ;jmp to morpat area of NewWord morpat: mov d,a ;save register a mov a,b ;move attr byte into accum ani 00000001b ;check if strike-out jz chrout ;if not, output char mov a,d ;put char in accum. cpi 1bH ;check if it's ESC jz esc ;if so, send it and set counter lda cnt ;check counter cpi 0 ;if not waiting for the rest of jz altchr ; esc sequence, it's alt char dcr a ;decrement counter sta cnt ;save new value cpi 0 ;if 0, last char of jz chrout ; escape sequence mov a,d ;load char cpi 28H ;compare it against left paren jz short ;if paren, 1-char esc sequence cpi 29H ;compare it against right paren jz short ;if paren, 1-char esc sequence jmp chrout ;ordinary character altchr: mvi c,6 ;bdos function 6 mvi e,1bH ;turn on alt. char set by call bdos ; sending ESC ! mvi c,6 mvi e,21H call bdos mov a,d ;check if need to map char mvi c,50H ;subtract 50H from it sub c jm sub32 ;char is space thru O mov a,d mvi c,60H sub c jm sub16 ;char is P thru _ ;otherwise, ` thru ~ chrout: mvi c,6 ;direct console output mov e,d ;put char in register e call bdos ;call operating system ret ;return to NewWord sub32: mov a,d mvi c,20H ;subtract 32 from it so that sub c ; alt chars can be entered mov d,a ; using the printable chars jmp chrout sub16: mov a,d mvi c,10H ;subtract 16 from it to skip sub c ; over unassigned row of mov d,a ; 16 alt chars jmp chrout esc: mvi a,2 sta cnt ;allow 2 more chars through jmp chrout short: mvi a,0 ;zero counter sta cnt jmp chrout cnt: db 0