User manual
Controller Programs
F-4 2001-900-01 Rev. K / August 2010
Program 2
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
DEF SEG=&HC400
INITIALIZE=0
SEND=9: ENTER=21
MY. ADDRESS%=21
INST.ADDRESS%=16
CONTROLLER%=0
CALL INITIALIZE (MY.ADDRESS%, CONTROLLER%)
LINE INPUT “Enter Program Message”; CMD$
CALL SEND (INST.ADDRESS%, CMD$, STATUS%)
Length = LEN (CMD$)
FOR I = 1 TO Length
Char$ = MID$ (CMD$, I, 1)
IF Char$ = “?” THEN GOTO 160
NEXT
GOTO 80
RESPONSE$=SPACE$ (80)
CALL ENTER (RESPONSE$, LENGTH%, INST.ADDRESS%, STA-
TUS%)
PRINT RESPONSE$
GOTO 80
END
‘ Memory address.
‘ Offset address of routine.
‘ Set PC<>488 address.
‘ Set 2001 address.
‘ Set for system control.
‘ Initialize system.
‘ Prompt for program message.
‘ Send command message.
‘ Determine length of input string.
‘ Identify character in input string.
‘ If character is “?”, then go to 160.
‘ If message is not a query, go to 80.
‘ Make room for data.
‘
‘ Display response message.
‘Repeat.