schung@cory.Berkeley.EDU (07/10/87)
I posted a request for a CED 1.0d patch a while ago. Several people gave me clues and pointers. I finally figured out where things are in respect with version 1.0c of the same program. So here is the patch that I adapted to enable ^U and ^W to work in CED 1.0d as they do in c-shell (UN*X). It is exactly the patch for version 1.0c with the addresses changed. Credits, especially for the ^W implementation, should go to Doug Landauer, who would tell you that the patch is in some way related to Colin Kelly. Most important though, it was Steve Grandi who pointed the way to the addresses. Thank's to all. In case you don't know already, CED is a command interpreter for MS-DOS that have some sort of history and aliasing mechanism. It also allows you to edit your present and old commands before executing them. (Do you know of any command interpreter that can do what CED does *and* also supports c-shell's command history substitution? I heard that somebody has written something like that as an extension to the c-shell, and called it ** TC-SHELL **. You have to have c-shell's source code to be able to use tc-shell though. No, I don't know who has it. Refer to comp.questions.unix, and ask them there, if you are interested. I certainly would like to know if there is something similar for MS-DOS.) Again, in case you don't know already, you can download CED1.0D.ARC from simtel20.arpa PD:<MSDOS.KEYBOARD> (There is also a patch there, CEDINS.ARC, that will make insert mode the default and that will preserve the mode you are in when you along the command stack.) Here's an annotated version of the patch. (Annotated by Launder.) Remove the annotations and cut at the line below to get CED1DCUW.DBG. Do "debug ced.com <ced1dcuw.dbg" to patch ced.com and get cedcuw.com. Or if you prefer, hand code the patch yourself: ------------------ CED1DCUW.DBG----------------------------- e 673 15 <-- replace the ESCape with a ^U. a 67f jmp eb4 <-- Replace the "call 7e1" (the "other-characters" subr) with a jump into the patch. e ea0 "ced1.0d(c)CJDunford" 0d <-- shorten the "ced ver" message ... this code is what actually implements ... the word-kill function [due to Landauer]. a eb4 cmp al,17 <-- is input char ^W ? jz ec5 <-- if so, jump down to the "begin-of-line test" call 7e1 <-- not ^W, so call "other-characters" subr. ret call 83e <-- call the "backspace" subr cmp byte -1[di],20 <-- is previous char a space? jz ecb <-- yes, jump down to the RET -- we're done cmp di,[04cd] <-- the "begin-of-line" test jnz ebc <-- not yet back to B.O.L., do a(nother) backspace ret n cedcuw.com w q sugih jamin (schung@cory.Berkeley.EDU) Disclaimer: Use it at your own risk.