˜hCLS DOC =CLS-ANY ASM ÅICLS-^Z COM!ë³CLS.COM - A "SCREEN" DOCUMENTARY. Dear Friends: I suspect that most of us have wished that the earlier versions of CP/M had a clear screen - home cursor command. I know I have. For that matter, I also always wanted the command in early versions of Microsoft (TM) Basic. Remember though, when Gary Kildall wrote CP/M and Bill Gates wrote the first versions of Altair Basic, (for you young folks - this was in the Dark Ages - 1975 and 1976), most of the micro-computer community used as their terminals the terrible, noisy, 'leaks oil like some cars', MONSTER called a Teletype (TM) Model 33. I built an Altair (TM) 8800B, (like the one Steve Jobs and Steve Wozniak could not afford) which started this whole thing, from the kit in early 1977 and had such a terminal. If anyone ever knew how to 'home the cursor and clear the screen' on a Teletype (TM), I never heard of it here in Mississippi and I doubt somehow that anyone else did either. Therefore, please "forgive" Gary Kildall and Bill Gates for not including these commands in their early programming 'works of art'. I certainly have. Still, I have always wanted this command and it is not even present on my version of CP/M vers. 2.2G (for my Kaypro 4 84). Therefore, in an uncharacteristic 'fit' of energy recently, I came up with the enclosed 'life work epic' which must run at least 15 or 20 bytes of 'dreaded' machine language code. If you study it carefully, it is a bit more elegant than you might, at first, suspect. Not surprisingly, I call it CLS.COM. I have used this little program with great pleasure for the past few months and now I would like to share it with you. I know, because of that 'feature' of CP/M, that any program, no matter how small, takes up 2K of disk space; but I think it is worth the space - even if it's on every disk. I find that it is my third most used program, right behind SD.COM and NSWEEP.COM. I like it so much that my 'pride of authorship' and ego want me to stamp it with my name - or initials, at the very least - especially since I am sure that it is the only program I have ever written that amounts to a 'hill of beans'. Alas! If I did that, it would defeat the whole purpose of it, wouldn't it? Sometimes, "life is not always fair" as President Kennedy once reminded us. Oh, well, for what it's worth, here it is and I really do hope you enjoy it but, please... If you ever see my name again, just mumble, "I've seen that name somewhere before, but I don't remember where!" Regards, ERNEST SPENCER of Jackson, Ms., W5PQY. 06/06/85;CP/M PROGRAM TO CLEAR SCREEN AND HOME CURSOR (SETUP FOR ^Z) ; ;COPYRIGHT (C) 1985 BY ERNEST SPENCER OF JACKSON, MS. ; ;*** THIS PROGRAM MAY BE USED FREELY BY THE CP/M USER COMMUNITY FOR ;NON-COMMERCIAL PURPOSES - ERNEST SPENCER - 06/06/85 *** ; ;ASSEMBLE WITH ASM.COM ; ;USE WITH ANY CP/M COMPUTER BY CHANGING THE CLEAR EQUATE TO ;THAT COMPUTER'S CLEAR SCREEN & HOME CURSOR ASCII CHARACTER CODE. ; ;RETURNS TO CP/M PROMPT WITHOUT DOING A WARM BOOT. ; ;WORKS WITH ANY SIZE CP/M SYSTEM SINCE IT INITIALLY DETERMINES ;PROMPT AREA OF CCP BY SAVING ITS ADDRESS ON STACK AND ;THEN RETURNS TO IT WHEN THROUGH INSTEAD OF DOING WARM BOOT. ; ORG 100H ;BEGINNING OF TPA FOR STANDARD CP/M ; CONOUT EQU 02H ;SYSTEM CALL TO OUTPUT A CHAR. TO CONSOLE CLEAR EQU 026 ;CLEAR SCREEN CHAR. (^Z FOR KAYPRO 4) ENTRY EQU 05H ;CP/M ENTRY POINT ; START: LXI H,0 ;ZERO HL REGISTER DAD SP ;GET OLD CP/M CCP PROMPT STACK POINTER SHLD STACK ;SAVE IT LXI SP,STACK;SET NEW STACK POINTER ; MVI E,CLEAR ;LOAD CLEAR SCREEN CHAR. INTO E REG. MVI C,CONOUT;LOAD SYSTEM CALL TO OUTPUT A CHAR. CALL ENTRY ;CALL CP/M TO OUTPUT CLEAR CODE & CLEAR SCREEN ; EXIT: LHLD STACK ;GET OLD CP/M CCP PROMPT STACK SPHL ;RESTORE OLD STACK POINTER RET ;RETURN TO CCP & DO PROMPT W/O WARM BOOT ; DS 2 ;ROOM FOR 1 LEVEL STACK PLUS OLD STACK STACK DS 2 ;OLD CP/M STACK SAVED HERE ; END !9"1Í*ùÉ