Path: utzoo!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!uunet!mcsun!hp4nl!eurtrx!euraiv1!reino From: reino@cs.eur.nl (Reino de Boer) Newsgroups: comp.lang.pascal Subject: Re: Turbo Vision (editors flaw) Message-ID: <1991Mar18.132958.13056@cs.eur.nl> Date: 18 Mar 91 13:29:58 GMT References: <1981@pdxgate.UUCP> Reply-To: reino@cs.eur.nl Organization: Erasmus University Rotterdam Lines: 47 In <1981@pdxgate.UUCP> mwizard@eecs.cs.pdx.edu (Craig Nelson) writes: > Craig, here (you already knew that). I ran across a small glitch in >Turbo Vision's EDITORS.TPU unit. Seems the speedy routines someone optimized >in the EDITORS.PAS source code have a bug. I refer to the ScanKeyMap routine >in specific. Try running the TVEDIT program and type $10.00, or maybe >100%, or how about #00. You notice what I did. The $,%,#, and ^ symbols are >filtered out due to the algorithm being used. May also be the structure it >references (the KeyMap) but it looks pretty sound. Those characters mentioned >earlier filter out to be such nice things as ShiftIns, CtrlIns, etc... Nice >little addition, but it kinda screws up the project I was working on. I'm >working on the fix right now. The assembly code is pretty straight foreward >so it shouldn't take too long. > If anyone out there already has a fix I could use the extra typing time >to do bigger and better things (like hunt for more bugs) function ScanKeyMap(KeyMap: Pointer; KeyCode: Word): Word; assembler; asm PUSH DS LDS SI,KeyMap MOV DX,KeyCode CLD LODSW MOV CX,AX @@1: LODSW MOV BX,AX LODSW { The next line used to be OR BL,BL } OR DL,DL { BL, BL : WAS THIS A BUG ??????????? } { I think it does the right thing now ? } JE @@2 CMP BL,DL JNE @@3 OR BH,BH JE @@4 @@2: CMP BH,DH JE @@4 @@3: LOOP @@1 XOR AX, AX @@4: POP DS end; Hope this fixes the editors -- Reino -- Reino R. A. de Boer "We want to build the right product right, right?" Erasmus University Rotterdam ( Informatica ) e-mail: reino@cs.eur.nl