Download Print this page

Radio Shack TRS-80 Owner's Manual page 118

Mini-disk operation disk operating system disk basic programming language
Hide thumbs Also See for TRS-80:

Advertisement

mm^gimjmmmmmm^mm
Example
CMD"J"
,
"11/30/80"
,
D$
Returns
the
day
of
the
year
in
d$.
CMD"J"
,
"-79/300"
t
D$
Returns
the
month,
day, year,
equivalent
in
d$
(the
date for the
300th day
of
1979).
Sample Program
10
CLEAR
50
20
LINE INPUT"ENTER FIRST DATE (MM/DD/YY)
"5
FD$
30
LINE INPUT"ENTER SECOND DATE (MM/DD/YY) "5SD$
40
CMD"J"
t
FD$> Dl*
50
CMD"J"
,
SD$» D2$
G0
Yl
=
VAL(RIGHT*(FD*»2>
)
70 Y2
=
UAL
(
RIGHT*
(SD$>2)
80
Jl
=
VAL(RIGHT$(D1$*3)
)
90 J2
=
MAL(RIGHT$(D2*»3)
)
100
SI
=
Y1*3G5
+
Jl
110 S2
=
Y2*3G5
+
J2
120
PRINT "THE INTERVAL BETWEEN DATES
IS"
130
PRINT
ABS(S1-S2H
"DAYS
"5
140
PRINT "(IGNORING LEAP-YEARS),"
150
INPUT "<ENTER>
TO
CONTINUE"
I
A$
160
GOTO
20
CMD"L"
Load
Z-8© Routine
Into
MAM
cmd
l
;rov(ine
routine
is
a spring
ajqir^ssior;
eomsmlRe
a
^iie
specification
for
a
i
aa
routine
or
p?o^s<r: c-aEfeo by
'M
t^haf
•czxrmmii.
!r
routine
h
a
sSr!ng
corssra*:!..
!
A
mm'
be
wmhsi
in
quotes
cmd"L"
loads
a
z-80
(machine- language)
routine into
ram.
It
would
normally
be used
to
load a
z-80
subroutine
which
is
to
be accessed
directly
from
basic.
100

Advertisement

loading

This manual is also suitable for:

Model iii