03.01.2015 Views

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INTERRUPT CONTROL UNIT<br />

;The following section of code shows the polling process<br />

;for the 8259A modules...<br />

;<br />

;For brevity, the Register EQUates are not shown.<br />

;<br />

POLL_EXAMPLE SEGMENT<br />

ASSUME CS:POLL_EXAMPLE<br />

MOV DX, SPICP0 ;POLL Command issued thru OCW3<br />

MOV AX, 0CH ;POLL=1 and D5:4=01<br />

OUT DX, AL ;Issue POLL Command<br />

;The slave 8259A will deposit the poll status byte on the<br />

;next RD# pulse...<br />

IN DX, AL ;Read the slave 8259A<br />

TEST AL, 80H<br />

;Has there been an interrupt<br />

JNE INTERPT ;If D7=1 --> yes!<br />

;If the code gets to here then there has been no interrupt.<br />

JMP<br />

NO_INTERRUPTS<br />

INTERPT: AND AL, 111B ;Get just the interrupt type.<br />

;At this point the interrupt type is in AL. Your code<br />

;would branch to the appropriate routines...<br />

POLL_EXMPL<br />

ENDS<br />

Example 8-3. Using the Poll Command<br />

8-51

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!