GS
C1
n1
[Function]
Setting the numbering counter mode (A)
[Code]
<1D>H<43>H<31>H<n1><n2><n3><n4><n5><n6>
0 ≤ n1, N2, N3, N4, N5, N6 ≤ 255
[Range]
[Outline]
This command sets the numbering (serial number counter) mode.
[Default]
n1 + n2
n3 + n4
n5 = 1
n6 = 1
[See Also]
GS
[Sample Program]
LPRINT CHR$ (&H1D) ; "C0" ;
LPRINT CHR$ (3) ; CHR$ (0) ;
LPRINT CHR$ (&H1D) ; "C1" ;
LPRINT CHR$ (50) ; CHR$ (0) ;
LPRINT CHR$ (0) ; CHR$ (0) ;
LPRINT CHR$ (5) ; CHR$ (2) ;
GOSUB * CNT
LPRINT CHR$ (&H1D) ; "C2" ;
LPRINT CHR$ (5) ; CHR$ (0) ;
GOSUB * CNT
END
[Print Result]
n2
n3
n4
×
n1 + n2
256 (n1 = remainder, n2 = quotient)
×
n3 + n4
256 (n3 = remainder, n4 = quotient)
n5
n6
×
(n1 + n2
256) < (n3 + n4
×
(n1 + n2
256) > (n3 + n4
×
(n1 + n2
256) = (n3 + n4
×
256 = 1
×
256 = 65535
C0,
GS
C2,
GS
n5
n6
×
256)
×
256)
×
256) or n5 = 0 or n6 = 0 : Counter stop
c,
GS
C ;
* CNT
FOR I=1 TO 6
LPRINT CHR$ (&HA) ;
When setting a count-down range = 0 to 50, step value
= 5, repeat count = 2, and start value = 5 to print a
counter value.
When setting a count-down range = 0 to 50, step value
= 5, repeat count = 1, and start value = 50 to print a
counter value.
69
CBM-270 User's Manual
: Counter default
: Counter final value
: Counter step value
: Identical counter print count
: Count-up system
: Count-down system
LPRINT CHR$ (&HID) ; "c" ;
NEXT I
RETURN
(The repeat count is cleared)
CITIZEN