Measurement-computing Personal488 rev.3.0 For DOS & Windows 3.Xi Uživatelský manuál Strana 118

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 400
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 117
II. SOFTWARE GUIDES - 8. Driver488/DRV 8K. Other Languages
Personal488 Users Manual, Rev. 3.0 II-103
ARM Condition Detection
It is sometimes desirable to be able to easily check for asynchronous bus conditions, such as Service
Request (
SRQ
), without having to use the Driver488/DRV
STATUS
command. This can be
accomplished by using the light pen interrupt emulation feature of Driver488/DRV. When this feature
is enabled, Driver488/DRV preempts the normal function of the light pen BIOS status request interrupt.
Instead of returning the light pen switch status, this interrupt returns an indicator that is non-zero if any
of the
ARM
conditions are true. See the
ARM
command in Section III: Command References for more
details about the conditions that can be checked.
There are two items to notice about this routine: it uses the BIOS video interrupt
10h
rather than the
DOS function call interrupt
21h
, and it checks twice to see if a condition has been detected. The test
must be repeated if
IOCTL Read
is used to check the Driver488/DRV status.
IOCTL Read
causes the
light pen interrupt emulation to return
no interrupt
status on the next status read, regardless of the
actual
ARM
condition status. This allows the BASIC function
ON PEN
to operate properly, but requires
the status to be checked twice in other languages.
Sample Program
name DB IEEE, 0 ;Driver488/DRV device name
ieee DWO ;Place to hold Driver488/DRV file
handle
ioctlbufDB 0 ;IOCTL Read response buffer
ioctllenEQU $-ioctllen ;Length of buffer
cr EQU 0Dh ;Carriage-return
lf EQU 0Ah ;Line-feed
hello DB HELLO,,cr,,lf ;HELLO command with terminators
hellolen EQU $-hello ;HELLO command length
response DB 256 DUP (?) ;Place to put Driver488 response
responselen EQ $-response ;Length of response buffer
;
recvdlen DW ? ;Place to keep # chars in response
start mov Ah, 3Dh ;Open function
mov AL, 02 ;Access code = read/write
mov DX, offset name ;DS:DX-name
int 21h ;Execute DOS function
jc error ;Error if carry set
mov ieee,AX ;Save file handle
mov AH, 3Eh ;Close function
mov BX, ieee ;File handle
int 21h ;Execute DOS function
jc error ;Check for error
mov AX, 4400h ;DOS GetDeviceData Function
mov BX, ieee ;File handle for Driver488/DRV
int 21h ;Execute DOS function
mov DH, 0 ;Must clear
or DL, 20h ;Set dont check for control
characters bit
mov AX, 4401h ;DOS SetDeviceData Function
mov BX, ieee ;File handle
int 21h ;Execute DOS function
Checking the Driver488/DRV light pen emulation status is straight forward, as illustrated by the
following table.
mov AX,0400h ;Test light pen function
int 10h ;BIOS video interrupt
or AH,AH ;Check AH
jnz GotInt ;Non-zero means interrupt
mov AX,0400h ;Repeat the test
int 10h
or AH,AH
jnz GotInt
Zobrazit stránku 117
1 2 ... 113 114 115 116 117 118 119 120 121 122 123 ... 399 400

Komentáře k této Příručce

Žádné komentáře