Intel 9800758-02 Webcam User Manual


 
BASIC-80
USER TERMINAL HANDLER
TO
OUTPUT
FOR
FILE
:L1:
NAME
PUBLIC
EXTRN
CSEG
BQUSER
BQUSER
BQOPNX,RQSEND,RQWAIT,RQOUTX
; WAIT
FOR
MESSAGE
AT
BQOPNX
; OPEN AND CLOSE ARE IGNORED
BQUSER:
LXI
B,BQOPNX :EXCHANGE
FOR
USER
OPEN
LXI
0,0 ;WAIT FOREVER
CALL RQWAIT
PUSH
H ;MESSAGEADOR
LXI
0,4 ;OFFSET
OF
TYPE
DAD
0
MOV A,M
LXI
D,S
DAD
0
;MESSAGE TYPE
;STATUS
IS
AT OFFSET 9
CPI
14
;CLOSE TYPE
JZ ZSTAT ;ZEROSTATUSANOQUIT
CPI
15
;OPEN STAT
JNZ NOTOPN ;NOT
AN
OPEN REQUEST
PUSH H ;SAVE STATUS
ADOR
LXI
0,6
ADD
6
TO
GET LOCATION
DAD
0 ;OFAFREXCHANGE
RMX/80
BASIC-SO
LXI
O,BQOPNX ;OPEN EXCHANGE ALSO
USED
FOR
WRITE
MESSAGES
MOV
M,E ;LOW BYTE AFR
INX H ,
MOV M,O ;HI
BYTE
AFR
POP
H ;RESTORE STATUS POINTER
JMP ZSTAT ;AND ZERO STATUS
NOTOPN:
CPI
12
;WRITETYPE
JZ WRITE
; BAD MESSAGE TYPE - RETURN
ERROR
STATUS
MVI
M,18 ;STATUS-UNRECOGNIZEDTYPE
JMP ERRRET ;RETURN MESSAGE AND QUIT
; PASS MESSAGE
ON
TO TH
WRITE: LXI B,RQOUTX ;TH OUTPUT
EXCH
POP
0 ;MESSAGE
AOOR
CALL
RQSEN~SENOMESSAGE
JMP BQUSER ;WAIT
FOR
MORE
,
;
ZERO
STATUS AND RETURN MESSAGE
ZSTAT:
XRA
A
MOV M,A ;
LOW
BYTE
OF
STATUS
ERRRET: INX H
MOV M,A ;HI BYTE
OF
STATUS
; RETURN MESSAGE
DCX
H
OCX
H
MOV B,M
DCX
H
;BACKUPTO
RESPONSE
EXCH
;HI BYTE
OF
RESP
EXCH
MOV C,M ;LOW BYTE
POP
0 ;MESSAGEAODR
CALL
RQSENO
RETURN MESSAGE
JMP BQUSER ;WAIT
FOR
MORE
END
Figure F-S. Sample User-Written
1/0
Driver Routine
F-15