; MT70GRDÉ.ASÍ 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 on the Morrow MDT-60/MT-70 ; terminal of the 7 special German characters appearing ; on the Diablo German Pica 10A print wheel. ; On the wheel, these special characters replace the ; normal ASCII characters [, \, ], {, |, }, and @ ; which are entered in order to print the A, O, U, a, ; o, u with umlauts and the digraph s, respectively. ; Assemble with CP/M's ASM and enter hex codes from ; resulting MT70GRDI.PRN file using NWINSTAL ; (menu H-2-C) starting at address 042E. ; UCONÏ replaces the normal NewWord routine whicè sends ; each character to the terminal for display. ; Thió patcè checks if the character is one of the above 7 ; ASCIÉ characters and if so sends the escape sequence and ; substitute character necessary to display the corresponding ; German character. The characters entered are still stored ; in the document as their normal ASCII selves and are only ; displayed as German characters to show how they will be ; printed. ; Because one of these 7 ASCII characters could appear in ; an escape sequence sent by NewWord to control the screen ; (for example, to address the cursor), UCONO keeps track ; of what passes through, allowing an ESC followed by ; another character or an ESC followed by an = Y X sequence ; to pass through without checking if the character should ; be displayed differently (substituting for a character ; in one of these escape sequences would corrupt the ; display). ; Easily modified for different printers, terminals, and ; languages. For example, on the Gemini 10X printer, ; when the German character set is selected, the digraph s ; replaces the tilde (~) instead of the "at" sign (@). ; Furthermore, the German character set must be selected ; before printing by sending the appropriate escape code ; to the Gemini and the printer should be reset to the ; U.S. ASCII character set after printing. This is easily ; accomplished by patching these codes into ULINI (user list ; device initialization) and ULUNI (user list device ; uninitialization) in the patch area. ; For other terminals capable of on-screen display of ; an alternate character set, simply substitute the ; escape code for displaying one of these characters ; for what appears below in ESCODE and enter the values ; of the characters to be sent to the screen after the ; escape code at LBRKT, BSLASH, etc. ; For other languages, determine what characters must ; be entered and sent to the printer in order to print ; the desired characters and put these in ALTCHK. org 042EH ;starting point of patch code bdos equ 5 ;operating system entry point ucono: jmp morpat ;jmp to morpat area of newword morpat: sta savea ;save char cpi 1bH ;check if ESC jnz notesc ;jump if not ESC mvi a,1 ;set flag to allow next char through sta escflg ; without checking if alt. char jmp resta ;restore char and send it notesc: lda escflg ;check if prev. char was ESC cpi 0 ;if not, okay to check if current char jz altchk ; should be displayed as alt. char lda escnt ;check if in the middle of cursor cpi 0 ; addressing escape code jnz middle lda savea ;restore char cpi 3dH ;check if beginning (=) of cursor jz begin ; addressing escape code mvi a,0 ;must be 2nd char of ordinary esc sta escflg ; code, so zero flag, restore jmp resta ; char and send it altchk: lda savea ;restore char cpi 5bH ;check for [ jz lbrkt cpi 5cH ;check for \ jz bslash cpi 5dH ;check for ] jz rbrkt cpi 7bH ;check for { jz lbrace cpi 7cH ;check for | jz verbar cpi 7dH ;check for } jz rbrace cpi 40H ;check for @ jz atsign outch: mvi c,6 ;bdos function 6: direct console I/O mov e,a ;load char to send call bdos ;send char to screen ret ;return to NewWord lbrkt: mvi a,10H ;display A umlaut instead of [ jmp escode ;first send esc codes for alt. char set bslash: mvi a,11H ;O umlaut jmp escode rbrkt: mvi a,12H ;U umlaut jmp escode lbrace: mvi a,14H ;a umlaut jmp escode verbar: mvi a,15H ;o umlaut jmp escode rbrace: mvi a,16H ;u umlaut jmp escode atsign: mvi a,17H ;digraph s escode: sta savea ;save register a mvi c,6 ;bdos function 6 mvi e,1bH ;turn on alt char set for this call bdos ; char by sending ESC ! mvi c,6 mvi e,21H call bdos resta: lda savea ;restore register a jmp outch ;send substituted char middle: dcr a ;decrement counter cpi 0 ;if this is last char in cursor sta escnt ; addressing escape code, reset jnz resta ; esc flag mvi a,0 sta escflg jmp resta begin: mvi a,2 ;let next 2 chars go through sta escnt ; without checking for alt. char jmp resta ;restore current char and send it savea: db 0 escflg: db 0 escnt db 0