The experience made me realise how unrealistic it was of me to expect
the people at STOSSER to do this for every listing, quite simply, i found
that it takes far too long. However it gave me an idea for an article that
I could contribute to the diskzine.
This article is all about ASCII.
In order to process characters that do not have a numeric value in the computer, e.g. a,b,c,?,!,+, a code has been devised that assigns a unique bit combination to each character. Characters are held in the computer's memory as bit mapped images, each image being made up of a number of dots.The code identifies which image is to be presented to the screen.
This is the ASCII code. ASCII stands for the American Standard Code for Information Exchange and was developed by the American National StandardsInstitute in 1963.
The ASCII system assigns a code number to :
When a sort is performed on strings, they are sorted into ASCII order
rather than alphabetically, so that capital Z's will be placed before small
a's.
The ASCII code is an seven bit binary code. Using seven bits gives
the range of 0 to 127 ( 000 0000 to 111 1111 ). For convenience of operation
ASCII characters are usually represented with eight bits which makes an
ASCII character one byte wide. Most systems do not make use of the eighth
bit under normal operating modes. This bit, the most significant bit, (The
one at the left hand end) is always set to zero. The eighth bit may be
used for parity checking which is a simple method of checking the integrity
of received data.
Although only codes 0 to 127 are defined many programmes and printers use codes 128 to 255 for special purposes such as graphics output. The portion between 127 and 255 is known as the extended ASCII set. Because it makes use of the most significant bit the extended set cannot be used at the same time as using it for parity checking.
If you load the accessory "ASCII.ACB" into STOS you will see a display of the STOS ASCII table. In STOS the ASCII characters from 192 to 255 are the graphics used to produce the borders of windows.
The use of the ASCII code allows text produced by one application or machine to be read by another, such as an ST to a Macintosh. It enables programmes such as STOS to be written in a word processor and imported into STOS as an .ASC file.
Although it may not immediately seem so, the codes are highly orderly, if one looks at the code in its seven bit binary form. The numerals 0 to 9 start at position 48, 011 000 in binary, to 57, 011 1001. If the top three bits are ignored then the binary pattern corresponds with the decimal integer represented. Similarly the upper and lower cases of the alphabet start with 'A' and 'a' coded as one. 'A' being 65 or 100 0001 and 'a' being 97 or 110 0001.
As mentioned previously the Control Codes cause things to happen such
as carriage return or linefeed on a printer and are not characters printed
to the screen .
If you have a printer manual you should find a list of the ASCII codes
and how the control codes are interpreted by the printer. The normal emulation
modes for printers are Epson and IBM. Examination of the extended ASCII
set , i.e. numbers 128 to 255 shows italics on the standard Epson character
set but graphic symbols on the IBM.
In the STOS manual you can find the following
Control Codes :
chr$(3).............. Cursor Left
chr$(9).............. Cursor Right
chr$(10)............. Cursor Down
chr$(11)............. Cursor Up
Here are some more, as far as I am aware they are not given in the manual.
chr$(4).............. Scroll Up
chr$(5).............. Scroll Down
chr$(12)............. CLS ( Clear Screen )
chrs(20)............. Cursor Off
chr$(21)............. Inverse On
chr$(22)............. Shade on
chr$(30)............. Cursor Home
chr$(31)............. Underline On
The last six are courtesy of the late STOS magazine by Dion Guy.
The main commands used in conjunction with the ASCII code are CHR$ and ASC.
Chrs$(31) is one of the control codes given above and does not print to screen but its effect is seen, the OK and subsequent text is underlined.
Cheers...........10 input " Type in your name : "; NAM$ 15 print 20 for I = 1 to len(NAM$) 30 C$=MID$(NAM$,I,1) 40 Print C$;" is ASCII code number ";asc(C$) 50 next I