EasyManua.ls Logo

Radio Shack TRS-80 Model III - Page 36

Radio Shack TRS-80 Model III
274 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
4
[
j|
B
TRS-80
MODEL
III
Space
Compression
Characters
When you start BASIC, characters 1 92 through 255 are defined as space compression
codes: 192 generates zero spaces:
193,
one space; and so forth,
up
to
255,
which
generates 63 spaces.
These codes are useful for storing Video Display text in a minimal amount of
memory. For example, the following line contains 55 characters (superior numbers
indicate the number of blank spaces between letters):
21 spaces
78 spaces
NAME ADDRESS PHONE
There are two sequences of blanks containing a total of 39 characters. By replacing
the two space-sequences with two compression codes, we can save 39
-
2
=
37
characters
.
When the data is displayed, the space compression codes
will be
'
'expanded" into
the appropriate number of
spaces
.
The following BASIC program illustrates this example:
:j
C5
10
POKE
16526, 105
' LSB OF
*INITIO ENTRY
ADDRESS
20 POKE 16527,
'MSB
30 X
=
USR(0> 'CALL
*
I
N I T I
40 CLEAR
100
50
A*
=
"NAME" +
CHR*< 192+21)
+
"ADDRESS"
+
CHR*< 192+18)
"PHONE"
60
PRINT
"THE LENGTH OF THE STRING
IS"; LEN<A*>
70 PRINT
"HERE IT IS:"
80 PRINT
A*
Special Characters
The Model III also features 96 special characters. The first 32 may be displayed
by
POKEing
the
appropriate code into video RAM (addresses 15360 to 1
6383);
the
remaining 64 may be displayed via the PRINT statement.
This program will display the first 32:
10 CLS
20 FOR
I
=
TO 31
30
POKE
15360
+
I
*
16,
I
40 NEXT
I
50
PRINT
a 640,
""
;
26

Other manuals for Radio Shack TRS-80 Model III

Related product manuals