; ANSIALT.ASM patch. ; Written by Phil Hess, April 1986. ; Feel free to modify as needed. ; User console output (UCONO) patch code for NewWord with ; ANSI terminal to allow on-screen display of alternate ; character set (ASCII 160-254) when within strikeout ; toggles (^P^X). To print documents containing alternate ; characters, use program NewPrint, 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 037E from 31 to 30 (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 extended ASCII code (char + 128) ; necessary to display the alternate character. ; The characters entered are still stored in the ; document as their normal ASCII selves. ; 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 one or more characters ; terminated by "m" (e.g., ANSI escape sequences ; 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 bit set jz chrout ;if not, output char mov a,d ;put char in accum. cpi 1BH ;check if it's ESC jz esc ;if so, set flag and send it lda flag ;check esc flag cpi 0 ;if not waiting for the rest of jz altchr ; esc sequence, it's alt char mov a,d cpi 6DH ;is char terminating m? jnz chrout ;if not, send as ordinary char mvi a,0 ;zero esc flag sta flag jmp chrout altchr: mov a,d ;put char in accum ori 80H ;add 128 to it mov d,a ;put it back in d reg chrout: mvi c,6 ;BDOS function 6 mov e,d ;put char to send in reg e call bdos ;call operating system ret ;return to NewWord esc: mvi a,1 sta flag ;set flag jmp chrout flag: db 0 ;flag is initially 0