Appendix D
Formatting and Data Conversion
121
Example:
5B14... Indicates five binary words of 14 bits each.
A Format (mAn)
This format is used for ASCII characters:
m: number of words
A: ASCII format designator
n: the nth byte of the word
Digit n
Bit
15 14 13 12 11 10 9 8
7 6 5 4 3 2 1 0
1
---
ASCII code
2
ASCII code
---
3
ASCII code
ASCII code
Example:
6A2... Indicates six ASCII words of two characters each.
A maximum of 255 words can be transferred at one time when the A format is used because many PC words can
be represented by one BASIC variable.
Example:
PC READ “50A3, 100A2, 30A1, 75A3”; A$, B$, C$, D$
A$: Fifty PC words (50 words x 2 characters = 100 characters) indicated by 50A3 are assigned to this variable.
B$: One hundred PC words (100 words x 1 character = 100 characters) indicated by 100A2 are assigned to this
variable.
C$: Thirty PC words (30 words x 1 character = 30 characters) indicated by 30A1 are assigned to this variable.
D$: Seventy-five PC words (75 words x 2 characters = 150 characters) indicated by 75A3 are assigned to this
variable.
S Format (SmIn, SmHn, SmOn, SmBn)
This format is used for array variables.
S: format designator
m: number of words
n: the nth bit/byte of the word
Format
Meaning
SmIn
Indicates an array in decimal format.
SmHn
Indicates an array in hexadecimal format.
SmOn
Indicates an array in octal format.
SmBn
Indicates an array in binary format.
Each S Format designator corresponds to one variable from the variable list: the first designator corresponds to
the first variable in the list, etc.
The array variables must be one dimensional. Each array variable in the list must indicate (with a subscript) a
specific element within the array. The number of words to be written to or read from the array will be incremented
from the specified element. For example: if the array variable T(4) is specified in a READ statement and the corre-
sponding format is S100I4, then 100 words will be read from the array, starting at T(4) and ending at T(104).
Example:
PC READ “S100I4, S75H2, S80O3”; A(1), B(11), C(51)
A(1) to A(100): A hundred words of 4-digit decimal data indicated by S100I4 are read to these variables.
B(11) to B(85): Seventy-five words of 2-digit hexadecimal data indicated by S75H2 are read to these variables.
C(51) to C(130): Eighty words of 3-digit octal data indicated by S80O3 are read to these variables.
Examples of PC READ Format Conversion
I Format
Содержание C500-ASC04
Страница 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Страница 5: ...iv ...
Страница 7: ...vi ...