ch3 part C - EEL 3801 EEL Computer Organization Spring 2010...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
EEL 3801 EEL 3801 Computer Organization Computer Organization Spring 2010 Spring 2010 Chapter 3 Chapter 3 Intel Instruction Sets Intel Instruction Sets Hamacher et al , Computer Organization Acknowledgment and appreciation for various slide materials from Dr. Philip Wilsey, Dr. Randy Katz, Dr. Philip Leong
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
I/O Operations ± Suppose that keyboard and display devices have their synchronization flags SIN and SOUT stored in bit 3 of device status registers INSTATUS and OUTSTATUS, respectively. ± READWAIT BT INSTATUS,3 JNC READWAIT MOV AL,DATAIN - BT transfers INSTATUS bit 3 to the carry flag CF - JNC (jump if no carry) ± WRITEWAIT BT OUTSTATUS,3 JNC WRITEWAIT MOV DATAOUT,AL
Background image of page 2
MEMORY MAPPED I/O LEA EBP,LOC EBP points to memory area. READ: BT INSTATUS,3 Wait for characterto be JNC READ entered into DATAIN. MOV AL,DATAIN Transfer character into AL. MOV [EBP],AL Store the character in memory INC EBP and increment pointer. ECHO: BT OUTSTATUS,3 Wait for display to JNC ECHO be ready. MOV DATAOUT,AL Send characterto display. CMP AL,CR If not carriagereturn, JNE READ read more characters. Figure 3.44. An IA-32 program that reads a line of characters and displays it.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ISOLATED I/O ± IN and OUT instructions used only for I/O ± Addresses for these instructions are in a separate address space to other instructions ± IN REG,DADDR and OUT DEVADDR,REG ± REG must be AL (8-bit operand transfer) or EAX (32-bit operand transfer) ± 16-bit address space, if 0-255, specified directly using an 8-bit field in the In and Out instructions ± Otherwise, use DX for DADDR e.g. IN REG,DX and OUT DX,REG ± 16-bit device address is contained in DX register (IN REG,300 is not allowed because 300 > 255 and doesn’t fit in 8-bits)
Background image of page 4
Block Transfers ± ± Transfer block of items between memory and I/O ± “S” suffix means string ± “REP” prefix means repeat ± Additional suffix “B” or “D” indicates the item size (byte or doubleword length, REPINSB/REPINSD) ± DX contains a 16-bit I/O device address ± EDI contains a 32-bit address for the start of the block in memory ± ECX contains the number of data items to be transferred ± After each data item is transferred ± EDI is incremented (by 1 or 4 depending on “B” or “D” suffix) ± ECX decremented by 1 ± This is repeated until ECX=0
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Example LEA EDI,MEMBLOCK MOV DX,DISKDATA MOV ECX,128 REPINSD - Suppose that a block of 128 doublewords is to be transferred from a disk storage device into the memory - Assume that the addressable data buffer register in the disk
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 22

ch3 part C - EEL 3801 EEL Computer Organization Spring 2010...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online