Silicon ChipComputer Bits - April 1991 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Customer service - opportunity knocks
  4. Feature: The World Solar Challenge by Gerry Nolan
  5. Feature: Canon's New Still Video System by Bernard Malone
  6. Project: Build The SteamSound Simulator by Darren Yates
  7. Project: Remote Controller For Garage Doors, Pt.2 by Branko Justic
  8. Vintage Radio: Converting an Airzone to AGC by John Hill
  9. Serviceman's Log: Mystery, mystery & frustration by The TV Serviceman
  10. Project: Simple 12/24V Light Chaser by Darren Yates
  11. Project: A Synthesised Stereo AM Tuner, Pt.3 by John Clarke & Greg Swain
  12. Feature: A Practical Approach To Amplifier Design; Pt.2 by David Eather
  13. Review: Hewlett Packard's Model 54600 100MHz CRO by Leo Simpson
  14. Feature: Computer Bits by Jennifer Bonnitcha
  15. Feature: Amateur Radio by Garry Cratt, VK2YBX
  16. Feature: Remote Control by Bob Young
  17. Back Issues
  18. Order Form
  19. Market Centre
  20. Advertising Index
  21. Outer Back Cover

This is only a preview of the April 1991 issue of Silicon Chip.

You can view 49 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Electric Vehicles: The State Of The Art (January 1991)
  • Electric Vehicles: The State Of The Art (January 1991)
  • Electric Vehicles; Pt.2 (February 1991)
  • Electric Vehicles; Pt.2 (February 1991)
  • Electric Vehicles; Pt.3 (March 1991)
  • Electric Vehicles; Pt.3 (March 1991)
  • The World Solar Challenge (April 1991)
  • The World Solar Challenge (April 1991)
  • Motors For Electric Vehicles (May 1991)
  • Motors For Electric Vehicles (May 1991)
  • Electric Vehicle Transmission Options (June 1991)
  • Electric Vehicle Transmission Options (June 1991)
Articles in this series:
  • Remote Controller For Garage Doors, Pt.1 (March 1991)
  • Remote Controller For Garage Doors, Pt.1 (March 1991)
  • Remote Controller For Garage Doors, Pt.2 (April 1991)
  • Remote Controller For Garage Doors, Pt.2 (April 1991)
Articles in this series:
  • A Synthesised Stereo AM Tuner, Pt.1 (February 1991)
  • A Synthesised Stereo AM Tuner, Pt.1 (February 1991)
  • A Synthesised Stereo AM Tuner, Pt.2 (March 1991)
  • A Synthesised Stereo AM Tuner, Pt.2 (March 1991)
  • A Synthesised Stereo AM Tuner, Pt.3 (April 1991)
  • A Synthesised Stereo AM Tuner, Pt.3 (April 1991)
Articles in this series:
  • A Practical Approach To Amplifier Design (February 1991)
  • A Practical Approach To Amplifier Design (February 1991)
  • A Practical Approach To Amplifier Design; Pt.2 (April 1991)
  • A Practical Approach To Amplifier Design; Pt.2 (April 1991)
Articles in this series:
  • Computer Bits (July 1989)
  • Computer Bits (July 1989)
  • Computer Bits (August 1989)
  • Computer Bits (August 1989)
  • Computer Bits (September 1989)
  • Computer Bits (September 1989)
  • Computer Bits (October 1989)
  • Computer Bits (October 1989)
  • Computer Bits (November 1989)
  • Computer Bits (November 1989)
  • Computer Bits (January 1990)
  • Computer Bits (January 1990)
  • Computer Bits (April 1990)
  • Computer Bits (April 1990)
  • Computer Bits (October 1990)
  • Computer Bits (October 1990)
  • Computer Bits (November 1990)
  • Computer Bits (November 1990)
  • Computer Bits (December 1990)
  • Computer Bits (December 1990)
  • Computer Bits (January 1991)
  • Computer Bits (January 1991)
  • Computer Bits (February 1991)
  • Computer Bits (February 1991)
  • Computer Bits (March 1991)
  • Computer Bits (March 1991)
  • Computer Bits (April 1991)
  • Computer Bits (April 1991)
  • Computer Bits (May 1991)
  • Computer Bits (May 1991)
  • Computer Bits (June 1991)
  • Computer Bits (June 1991)
  • Computer Bits (July 1991)
  • Computer Bits (July 1991)
  • Computer Bits (August 1991)
  • Computer Bits (August 1991)
  • Computer Bits (September 1991)
  • Computer Bits (September 1991)
  • Computer Bits (October 1991)
  • Computer Bits (October 1991)
  • Computer Bits (November 1991)
  • Computer Bits (November 1991)
  • Computer Bits (December 1991)
  • Computer Bits (December 1991)
  • Computer Bits (January 1992)
  • Computer Bits (January 1992)
  • Computer Bits (February 1992)
  • Computer Bits (February 1992)
  • Computer Bits (March 1992)
  • Computer Bits (March 1992)
  • Computer Bits (May 1992)
  • Computer Bits (May 1992)
  • Computer Bits (June 1992)
  • Computer Bits (June 1992)
  • Computer Bits (July 1992)
  • Computer Bits (July 1992)
  • Computer Bits (September 1992)
  • Computer Bits (September 1992)
  • Computer Bits (October 1992)
  • Computer Bits (October 1992)
  • Computer Bits (November 1992)
  • Computer Bits (November 1992)
  • Computer Bits (December 1992)
  • Computer Bits (December 1992)
  • Computer Bits (February 1993)
  • Computer Bits (February 1993)
  • Computer Bits (April 1993)
  • Computer Bits (April 1993)
  • Computer Bits (May 1993)
  • Computer Bits (May 1993)
  • Computer Bits (June 1993)
  • Computer Bits (June 1993)
  • Computer Bits (October 1993)
  • Computer Bits (October 1993)
  • Computer Bits (March 1994)
  • Computer Bits (March 1994)
  • Computer Bits (May 1994)
  • Computer Bits (May 1994)
  • Computer Bits (June 1994)
  • Computer Bits (June 1994)
  • Computer Bits (July 1994)
  • Computer Bits (July 1994)
  • Computer Bits (October 1994)
  • Computer Bits (October 1994)
  • Computer Bits (November 1994)
  • Computer Bits (November 1994)
  • Computer Bits (December 1994)
  • Computer Bits (December 1994)
  • Computer Bits (January 1995)
  • Computer Bits (January 1995)
  • Computer Bits (February 1995)
  • Computer Bits (February 1995)
  • Computer Bits (March 1995)
  • Computer Bits (March 1995)
  • Computer Bits (April 1995)
  • Computer Bits (April 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • Computer Bits (July 1995)
  • Computer Bits (July 1995)
  • Computer Bits (September 1995)
  • Computer Bits (September 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits (December 1995)
  • Computer Bits (December 1995)
  • Computer Bits (January 1996)
  • Computer Bits (January 1996)
  • Computer Bits (February 1996)
  • Computer Bits (February 1996)
  • Computer Bits (March 1996)
  • Computer Bits (March 1996)
  • Computer Bits (May 1996)
  • Computer Bits (May 1996)
  • Computer Bits (June 1996)
  • Computer Bits (June 1996)
  • Computer Bits (July 1996)
  • Computer Bits (July 1996)
  • Computer Bits (August 1996)
  • Computer Bits (August 1996)
  • Computer Bits (January 1997)
  • Computer Bits (January 1997)
  • Computer Bits (April 1997)
  • Computer Bits (April 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Computer Bits (July 1997)
  • Computer Bits (July 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits (September 1997)
  • Computer Bits (September 1997)
  • Computer Bits (October 1997)
  • Computer Bits (October 1997)
  • Computer Bits (November 1997)
  • Computer Bits (November 1997)
  • Computer Bits (April 1998)
  • Computer Bits (April 1998)
  • Computer Bits (June 1998)
  • Computer Bits (June 1998)
  • Computer Bits (July 1998)
  • Computer Bits (July 1998)
  • Computer Bits (November 1998)
  • Computer Bits (November 1998)
  • Computer Bits (December 1998)
  • Computer Bits (December 1998)
  • Control Your World Using Linux (July 2011)
  • Control Your World Using Linux (July 2011)
Articles in this series:
  • Amateur Radio (November 1987)
  • Amateur Radio (November 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (February 1988)
  • Amateur Radio (February 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (January 1989)
  • Amateur Radio (January 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (February 1990)
  • Amateur Radio (February 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (July 1990)
  • Amateur Radio (July 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (January 1991)
  • Amateur Radio (January 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (January 1992)
  • Amateur Radio (January 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (January 1993)
  • Amateur Radio (January 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (February 1994)
  • Amateur Radio (February 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (January 1995)
  • Amateur Radio (January 1995)
  • CB Radio Can Now Transmit Data (March 2001)
  • CB Radio Can Now Transmit Data (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • Stressless Wireless (October 2004)
  • Stressless Wireless (October 2004)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Dorji 433MHz Wireless Data Modules (January 2012)
  • Dorji 433MHz Wireless Data Modules (January 2012)
Articles in this series:
  • Remote Control (October 1989)
  • Remote Control (October 1989)
  • Remote Control (November 1989)
  • Remote Control (November 1989)
  • Remote Control (December 1989)
  • Remote Control (December 1989)
  • Remote Control (January 1990)
  • Remote Control (January 1990)
  • Remote Control (February 1990)
  • Remote Control (February 1990)
  • Remote Control (March 1990)
  • Remote Control (March 1990)
  • Remote Control (April 1990)
  • Remote Control (April 1990)
  • Remote Control (May 1990)
  • Remote Control (May 1990)
  • Remote Control (June 1990)
  • Remote Control (June 1990)
  • Remote Control (August 1990)
  • Remote Control (August 1990)
  • Remote Control (September 1990)
  • Remote Control (September 1990)
  • Remote Control (October 1990)
  • Remote Control (October 1990)
  • Remote Control (November 1990)
  • Remote Control (November 1990)
  • Remote Control (December 1990)
  • Remote Control (December 1990)
  • Remote Control (April 1991)
  • Remote Control (April 1991)
  • Remote Control (July 1991)
  • Remote Control (July 1991)
  • Remote Control (August 1991)
  • Remote Control (August 1991)
  • Remote Control (October 1991)
  • Remote Control (October 1991)
  • Remote Control (April 1992)
  • Remote Control (April 1992)
  • Remote Control (April 1993)
  • Remote Control (April 1993)
  • Remote Control (November 1993)
  • Remote Control (November 1993)
  • Remote Control (December 1993)
  • Remote Control (December 1993)
  • Remote Control (January 1994)
  • Remote Control (January 1994)
  • Remote Control (June 1994)
  • Remote Control (June 1994)
  • Remote Control (January 1995)
  • Remote Control (January 1995)
  • Remote Control (April 1995)
  • Remote Control (April 1995)
  • Remote Control (May 1995)
  • Remote Control (May 1995)
  • Remote Control (July 1995)
  • Remote Control (July 1995)
  • Remote Control (November 1995)
  • Remote Control (November 1995)
  • Remote Control (December 1995)
  • Remote Control (December 1995)
COMPUTER BITS BY JENNIFER BONNITCHA Playing with the ANSI.SYS file This month, we take a close look at the enhanced keyboard and display device driver - ANSI.SYS. This is an extensive list of codes for driver controlling your monitor screen and keyboard. ANSI.SYS is a driver which causes your computer to emulate the American National Standards Institute (ANSI) standard for terminals. Together with the International Standards Organisation (ISO), these bodies originally established an extensive set of console control codes for terminals connected to mainframe computers. The standards provide software portability for hardware interfaces. Note that ANSI.SYS is not a full implementation of the Digital Electronics Corporation (DEC) terminal VT-100 control codes. While the VT100 terminal implements all ANSI control codes, the DOS version of ANSI.SYS lacks the VT-100 terminal codes to: • erase from the current cursor position to the end of screen. • erase from current cursor position to the beginning of screen. • erase from current cursor position to the beginning of line. ANSI.SYS recognises a subset of the control codes defined in the ANSI console standard. Before you can start experimenting with installable device driver ANSI.SYS, you must explicitly configure your system. The driver needs to be somewhere on your boot disc, although it is usually found in the root or DOS directories. If your driver is in the root directory, include the following statement in your CONFIG.SYS file: device=ansi.sys However, if your driver is located in another directory (typically the DOS directory), include this statement: device=c: \dos \ansi.sys Once you include the driver, you must reboot your system for it to take effect. It remains installed until you remove the device line from your CONFIG.SYS file and reboot the computer again. Technically, ANSI.SYS is a console device driver. It oversees the actions of the keyboard and screen which are collectively known as the console. The program was introduced with MS-DOS 2.0 and has some 15 sepa- Before you can start experimenting with ANSI.SYS, you must configure your system. The driver needs to be somewhere on your boot disc, although it is usually found in the root or DOS directories. 74 SILICON CHIP rate functions which can be grouped into five categories: • control of cursor position; • erase all or part of the display screen; • control video mode settings; • control video attribute setting; • reassign character strings to individual keys on the keyboard. Data entered from the keyboard is sent to the computer as a sequence of ASCII (American Standard Code for Information Interchange) characters. ANSI.SYS operates by intercepting special codes sent to the video display and using them to change how the display and keyboard function. ANSI.SYS then recognises certain character sequences as being command sequences which can direct modification of the display screen output. All ANSI commands have the same format; the command is introduced with an escape character and a left bracket. You will often find the word ESC shown in reference manuals to represent the escape sequence. An ANSI escape sequence is a series of characters that you can use to define functions for MS-DOS. Specifically, you can change graphics functions and affect the movement of the cursor. All ANSI.SYS command sequences begin with an escape character whose ASCII value is 27. The escape character doesn't display on the screen, however you will usually see a left arrow or A(. Either way, ASCII character code 2 7 is the escape character and not the Esc key on your keyboard. The escape character and the left bracket are usually followed by a parameter, although there are some escape sequences which can have multiple parameters and some that don't require any at all. You can specify multiple parame-· ters by separating them by semi-colons. Each sequence ends with a letter to indicate the instruction and terminate the sequence. If the function requires any parameters, they are entered between the [ and the letter. A typical ANSI code, Esc[2J is the clear screen instruction. Note that the function code letter is case sensitive - you need to be careful. ANSI.SYS escape sequences The numeric ANSI sequences have three functions: • to represent the co-ordinates or number of columns or lines to move for cursor positions; • to represent the mode (such as the 2 in Esc[2J - the clear entire screen command) for erasing the display or screen settings; • to represent the ASCII character of the extended code for a key when reassigning the keyboard keys. ANSI.SYS & cursor position The most popular use for the commands is to control the cursor's screen location. Although cursor control is limited from the DOS prompt, you can use this type of command in batch files. You could clear the screen then position the cursor in the centre of the screen. Note the appropriate case for each function code letter. Cursor position - ESC[#;#H - Moves the cursor to a position on the display screen specified by the # parameters. The first parameter specifies the line number, the second the column number of the cursor position. The cursor moves to the home position - upper left corner of the screen - if none is specified. ' Horizontal/vertical position - ESC [#;#f - Has the same function as the cursor position command. Again, with no parameters specified, the cursor moves to the home position. Cursor up - ESC[#A - Moves the cursor up a number of lines without changing columns, where # determines the number of lines moved. The default is 1. If the cursor is already on the top line, MS-DOS ignores the sequence. Cursor down - ESC[#B -As for ESC#A with the cursor moving down the screen. If the cursor is already on the bottom line, MS-DOS ignores the sequence. Cursor forward - ESC[#C - This se- quence moves the cursor forward one column without changing lines. The # sets the number of columns moved, where the default is 1. If the cursor is already in the far right column, MSDOS ignores the sequence. Cursor back- ESC[#D -As for ESC[#C and the movement is backwards. If the cursor is already in the far left column, MS-DOS ignores the sequence. Save cursor position - ESC[s - Saves in memory the current position of the cursor. Cursor position is then restored using the following command, Restore Cursor Position. Restore cursor position - ESC[u - This sequence restores the cursor position to the value it had when the console driver received the Save Cursor Position sequence. Device status report - ESC6n - Requests that ANSI.SYS issue a cursor position report. Cursor position report - ESC[#;#R Reports the current position of the cursor. The first parameter is the current line, the second the current column. ANSI.SYS issues this report in response to the request for a Device Status Report. Erase display - ESC[2J - Erases the entire display and positions the cursor at the home position. Erase line - ESC[K - Erases from the cursor to the end of the line, including the cursor position. There's much more but perhaps the obvious has emerged - how to send the ANSI commands to the screen? You can't just type the escape character, since when DOS interprets the Esc key it means erase this line and start over. Fortunately, you have several alternatives. The DOS TYPE command • create a text file using an editor which lets you enter the escape character just by pressing Ctrl [ (note that it may appear as either a left arrow or A[). You can then use the DOS command TYPE to display the file and activate the functions. A good trick to remember is that the escape character is actually Ctrl V (AV). EDLIN, the DOS line editor, is quite happy to receive this key sequence. The Ctrl V tells EDLIN to make the next character in the sequence a control character. Thus, to enter an escape character, use AV[ followed by the required sequence; {ONI 50 MHz Frequency Counter Kit $ 99.00 1 GHz Frequency Counter Kit $299.00 121240V 40 Watt Inverter Kit $ 99.00 121240V 300 Watt Inverter Kit $379.00 Discolite Kit $159.50 Gates 2V 2.SAH's D Cell $ 7.95 Gates 2V SAH's X Cell $ 11.95 Arlec 6V Lantern Battery with 240V charger & 12V Cigarette lighter charger $ 59.00 Arlec variable Power Supply 5-15V DC 2A $ 89.95 100meter Roll Speaker Cable $ 16.95 President AM 40Channel CB Radio $109.00 4 Channel Audio Mixer for VCR's Arista AVM-1 $ 69.95 13.SV 7.4A Transformer $ 16.95 18V 6A Transformer $ 39.95 200 channel handheld scanner 66-88MHz, 118-174MHz, 406-512MHz, 806-956MHz. $499.00 NOW OPEN our new: Electronics Disposal Store 27 The Mall Sth. Croydon, Vic, 3136 Telephone: (03) 723 2699 Please Note: We are interested in purchasing your Surplus components & equipment. M, n Electronic World 30 Lacey St, Croydon VIC, 3136. Telephone: Fax: (03)723 3860 (03)723 3094 (03)725 9443 APRIL 1991 75 TABLE 1 SPECIFY THIS CHARACTER $ b d e g I n p V TO GET THIS PROMPT The $ character The I character The current date Escape character (ASCII code 1b hex, 27 decimal) The The The The The > character < character default drive working directory of the default drive current time The DOS version number Carriage return, linefeed sequence. Note this is the underscore character eg, AV[[1;37;44m. You must use the double square brackets [[ since the first is used with Ctrl V to create the escape character and the second is the normal lead_-in sequence for the ANSI command sequences. When complete, TYPE filename to see the results. The DOS ECHO command • create a batch file using the above methods to enter the escape character and then use the ECHO batch command to activate the functions. Type the same command above using: ECHO AV([1;37;44m At the DOS prompt, type 't he name of the batch file then press Enter. The DOS PROMPT command • you could use the DOS command PROMPT to activate the commands, since the PROMPT code $E is an escape code - and this is possibly the easiest method . Note that the PROMPT codes are NOT case sensitive. Once again, for the same command: PROMPT $e[1;37;44m The PROMPT command lets you change the MS-DOS system prompt using characters and prompt commands to create special prompts. You must precede each character with a dollar sign ($). Table 1 shows the details. The most popular prompt displays the current drive and path followed by the > than sign: PROMPT $P$G. 76 SILICON CHIP Remember that since the PROMPT command can send ANSI command sequences, you can combine the best of both worlds: PROMPT $e[1;37;44m$P$G This tells DOS to change the screen colour display and make the prompt show the current drive and path information. Using BASIC BASIC shelters the user from the operating system and thus intercepts many of the DOS and computer interrupts. The same shelter environment shields the ANSI device driver. You could, however, use compiled BASIC such as QuickBASIC, Turbo BASIC etc. Clever people can use interpretive BASIC (BASIC, BASICA and GWBASIC) together with the DOS command TYPE to print ANSI sequences. For example: OPEN "TEST4.BAT" FOR OUTPUT AS 1 PRINT #1, CHR$(27);"1;37;44m" CLOSE #1 The program can then be used by typing the DOS command: TYPE TEST4.BAT With practice, you can gain valuable experience both with your computer and the ANSI commands. ANSI.SYS escape sequences The main cursor control functions are up (A), down (B), left (D) and right (C). Remember the default is 1, so used without a parameter, each command moves the -cursor one row .or column. You can however specify the cursor position more accurately: ESC[5B ... I'm here This positions the cursor five rows down the screen, while: ESC[12;35H ... Now I'm here! positions the cursor approximately to the centre of the screen. You could try these commands using COPY CON as discussed last month. As a quick memory jogger, note that each line ends with the Enter key and you press function key F6 or AZ (Ctrl Z) at the completion to copy the console contents to a file: COPY CON TEST.BAT <at>echo off cls prompt $e[5B ... I'm here AZ then COPY CON TEST2.BAT <at>echo off cls prompt $e[12 ;35H ... Now I'm here! AZ MS-DOS 3.3 and 4.x allow you to suppress the display of a line in a batch file by preceding the line with the <at> character. Without the <at> sign, the ECHO OFF command would display on the screen. Thus, the above batch files display only what you need. Remember to separate multiple numeric codes with a semicolon and don't use a semicolon just before the command letter in a sequence. The final letter in an ANSI sequence is the command letter; ANSI does not see this letter if a leading semicolon is used; eg, ESC[44;1;37;m is incorrect. Make sure you use the correct case for the ANSI command letter since upper and lowercase letters are significant. Finally, if you omit a numeric parameter, the assumed value is O (zero) or 1. Depending on the sequence used, ANSI makes various assumptions about missing values. The assumed value for cursor positioning is 1, while for screen attributes it is 0. Be aware that in some situations the default value may not work and yet in others will work correctly. If you omit the row and column co-ordinates from the ESC[f command, ESC[1;1f (the home location) is assumed. Next month, we'll have more adventures with the PROMPT command, setting screen colours and customising the keyboard. SC