6-4
VL-1225/6 Analog Input/Output Board
004C
isr:
;INTERRUPT SERVICE ROUTINE
004C 50
push
ax
;Save CPU registers
004D 51
push
cx
004E 52
push
dx
004F 1E
push
ds
0050 B8 ---- R
mov
ax,data
;Set data segment register
0053 8E D8
mov
ds,ax
;Read A/D results
0055 BA 0305
mov
dx,idhigh
;Read Data High register first
0058 EC
in
al,dx
0059 8A E0
mov
ah,al
;Mask off unused high-order bits
005B 80 E4 03
and
ah,03h
;(Use ‘ah,07h’ for 11 bit mode)
005E BA 0304
mov
dx,idlow
;Read Data Low register second
0061 EC
in
al,dx
0062
signex:
;Sign extend to fill 16-bit register
;The following 3 instructions are
;optional. They are used in
;two’s complement mode only.
0062 B1 06
mov
cl,6
;Shift count (use ‘cl,5’ for 11-bit mode)
0064 D3 E0
sal
ax,cl
;Shift AD10 or AD11 into bit position D7
0066 D3 F8
sar
ax,cl
;Shift it back, extending sign
0068 A3 0000 R
mov
value,ax
;Store results into variable
006B C7 06 0002 R FFFF
mov
done,0ffffh
;Set flag indicating that ISR has ex-
ecuted
;Additional processing code is
;inserted here if desired.
;This could include mathematic
;manipulation, data storage,
;limit checks, etc.
0071
isr_exit:
0071 BA FF22
mov
dx,eoi
;Issue a Non-Specific End-Of-Interrupt
0074 B8 8000
mov
ax,8000h
;command to 80188 interrupt controller
0077 EF
out
dx,ax
0078 1F
pop
ds
;Restore CPU registers
0079 5A
pop
dx
007A 59
pop
cx
007B 58
pop
ax
007C CF
iret
;Return to interrupted program
007D
code
ends
end
main
Software Examples – Interrupt Mode Analog Input
Содержание STD32 VL-1225
Страница 3: ...ii VL 1225 6AnalogInput OutputBoard ...
Страница 29: ...2 22 VL 1225 6AnalogInput OutputBoard ...
Страница 47: ...4 14 VL 1225 6AnalogInput OutputBoard ...
Страница 55: ...6 6 VL 1225 6AnalogInput OutputBoard ...
Страница 69: ...7 14 VL 1225 6AnalogInput OutputBoard VL 1225 Schematic 03 09 93REV3 Reference VL 1225Schematic ...
Страница 70: ...VL 1225 6AnalogInput OutputBoard 7 15 VL 1225 Schematic 03 09 93REV3 Reference VL 1225Schematic ...
Страница 71: ...7 16 VL 1225 6AnalogInput OutputBoard VL 1225 Schematic 03 09 93REV3 Reference VL 1225Schematic ...
Страница 75: ...7 20 VL 1225 6AnalogInput OutputBoard VL 1226 Schematic 03 09 93REV3 Reference VL 1226Schematic ...
Страница 76: ...VL 1225 6AnalogInput OutputBoard 7 21 VL 1226 Schematic 03 09 93REV3 Reference VL 1226Schematic ...
Страница 77: ...7 22 VL 1225 6AnalogInput OutputBoard VL 1226 Schematic 03 09 93REV3 Reference VL 1226Schematic ...