College of Software Engineering Undergraduate Course Syllabus Course ID 31111730 Course Name Microcomputer Principle and Interface Technology Course █Compulsory □Selective Course Language □English █Chinese Attribute Credit Hour Semester Instructors Instructors Description Prerequisites 3 Period 48 □First Fall □First Spring □Second Fall █Second Spring □Third Fall □Third Spring □Fourth Fall □Fourth Spring Li Zheng, He Xianjiang Microcomputer Principle is the basic theory about architecture and operation mechanism of CPU and system bus; Interface Technology is the technology about connection criterion of device and system bus, and about interaction mechanism of device and CPU. All applications of hardware operation, such as microcomputer architecture design, device interface design, driver development, are based on these theories. Then, understanding content of this course is crucial for application development concerned. This course is mainly about the basic theory of microcomputer and classic application of interface. Because the detail architecture and mechanism of modern microcomputer and interface are updated very quickly, understanding how to learn these technologies is much more important than understanding detail technologies in this course. So, the core content of this course is about most stable theories of microcomputer, most classic applications of interface, and study ways for these contents. Lecture will be the main activity in this course, and assignments are demanded to be completed after school. The content of this course includes internal architecture and basic mechanism of CPU, instruction system and assembler language, external architecture of CPU, architecture and sequential operation of system bus, memory architecture, general interface architecture and operation mechanism, 8255 programmable peripheral interface, 8259 programmable interrupt controller, and 8237 DMA controller. Debug tool of assembler language based program is also introduced in this course for practice requirement. After learning student would have a good grasp of the basic theory of microcomputer and interface, the basic study way in applications concerned, and be able to practice them in application development. C Language for Program Design The Intel Microprocessors, 7th ed., Barry B. Brey, China Machine Press, 2006, ISBN Textbook Textbook 7-111-19609-0 1. 8086/8088 assembler language programming, Wang Zhengzhi, Gou Daju, etc., UESTC Publishing House, 2000.5 2. Assembler language programming – from DOS to Windows, Zhang xuelan, etc., TSINGHUA Resource University Press, 2006.4 3. 16/32 bit microcomputer principle, assembler language, and interface technology, Qian Xiaojie, Chen Tao, China Machine Press, 2001.7 Assignments, attendance rate (30%) and final exam (70%) Grading 1. Introduction Topics • Describe basic architecture of microcomputer. • Introduce five essential parts of microcomputer. • Introduce three essential types of storage cell in microcomputer. • Describe the machine view of program execution. • Explain address of storage cell. • Describe basic operation mechanism of microcomputer. • Introduce five basic control signals in microcomputer. • Describe two essential sequential operations in microcomputer. • Explain the concept of machine instruction. • Explain the loading and execution cycle of machine instruction. • Introduce the concept of instruction system. • Introduce the concept of assembler instruction and assembler Language. Key Points & Difficulties: System Bus; Interface; Storage Cell; Address; Machine View of Program Execution; Clock and Clock cycle; Sequential Operation; Machine Instruction Lecture: 3 2. Internal Architecture of 8086/8088 CPU • Introduce two essential parts of CPU, which are EU and BIU. • Introduce Instruction queue and explain basic pipeline in CPU. • Introduce logic and physic address, and explain address transformation in address adder. • Explain the correspondence between execution control and sequential operation. • Describe Arithmetic and logic operation in ALU (Arithmetic and Logic Unit). • Describe the sequential operation about loading and executing instructions. • Introduce segment registers, and explain their relationship with segment base value. • Introduce address pointer registers, and explain their relationship with offset. • Introduce data Registers, and explain their relationship with arithmetic and logic operation. • Introduce status flags of flag register. • Explain status flags are crucial for branch and cycle structure in programming. • Introduce control flags of flag register, and explain they can change operation mode of CPU. 2 • Explain implied usage of registers and possible logic errors caused by ignoring them. • Explain restricted usage of Registers and possible syntax errors caused by ignoring them. Key Points & Difficulties: Instruction Queue and Pipeline; Logic Address and Physic Address; Address Transformation; Meaning of Status Flags; Implied and Restricted Usage of Register Lecture: 4 3. General principles of Instruction System of 8086/8088 CPU • Explain correspondence between syntax and machine architecture. • Analyze general composition of instruction. • Explain general rules for instructions with two, one, or no operation data. • Explain the concept of addressing mode. • Introduce register addressing, and describe its features. • Introduce immediate addressing, and describe its features. • Introduce memory addressing, and describe its features. • Introduce three components of offset (Effective Address, EA). • Explain different composition of offset correspond to different memory addressing. • Introduce five memory addressing modes, and analyze their EA composition. • Introduce string addressing, and describe its features. • Explain why different instructions used for memory and I/O port operation. • Introduce I/O port addressing, and describe its features. Key Points & Difficulties: Correspondence between syntax and machine architecture; Concept of Addressing Mode; Memory Addressing and EA composition Lecture: 3 4. General memory management of 8086/8088 CPU • Explain why segment management is the basic technology for protected mode in x86 CPU. • Explain the converse storage of Intel tradition. • Describe the general usage of stack segment. • Describe the procedure call and return mechanism, and explain the LIFO rule in it. • Explain why stack segment is crucial for procedure call and return mechanism. • Describe the interrupt call and return mechanism, and explain the LIFO rule in it. • Explain what CPU execution scene is, and why a called procedure must protect it. • Conclude the usage of stack segment. Key Points & Difficulties: Converse Storage; Correspondence between procedure call and stack structure; Usage of Stack Segment Lecture: 1 5. Transfer Instruction • Explain transfer instruction affects flags only when flag register is destination. • Introduce and explain MOV and XCHG instruction. • Analyze classic false usages of these instructions. • Introduce LAHF and SAHF instruction, and analyze an example for their classic usage. • Introduce PUSH, POP, PUSHF, and POPF instructions. 3 • Analyze a detail example about stack operation. • Introduce LEA instruction, and explain the difference between LEA and MOV instruction. • Analyze an example about LEA usage. • Introduce IN and OUT instruction, and describe general I/O port operation. Key Points & Difficulties: Operation Dada Rules in Transfer Instructions; Stack Operation; Difference between LEA and MOV; Lecture: 1 6. Arithmetic Instruction • Introduce ADD and ADC instruction, and explain the meaning of corresponding status flags. • Analyze an example of long binary addition. • Explain the meaning of CF and OF in different cases. • Explain why CF is crucial for long binary operation. • Introduce SUB and SBB instruction, and explain the meaning of corresponding status flags. • Compare addition and subtraction instruction, and conclude long binary operation. • Introduce INC and DEC instruction, and analyze an example about INC usage. • Introduce NEG instruction, and analyze an example. • Introduce CMP instruction, and explain unsigned and signed comparison. Key Points & Difficulties: Multiple Meanings of One Binary Code; Meaning of CF and OF in Different Cases; Theory about Unsigned and Signed Comparison Lecture: 2 7. Bit Manipulation Instruction • Explain the meaning of bit manipulation. • Explain the correspondence between bit manipulation and I/O port operation. • Introduce AND instruction, and explain its bit exaction and clearing function. • Introduce OR instruction, and explain its bit setting function. • Introduce XOR instruction, and explain its bit inverting function. • Analyze examples about logic operation instructions. • Introduce SHL and SHR instruction, and explain their unsigned operation function. • Introduce SAL and SAR instruction, and explain their signed operation function. • Explain the difference between SAR and SHR. • Introduce ROL and ROR instruction, and describe their application. • Introduce RCL and RCR instruction. • Analyze an example about shift operation of a long binary. Key Points & Difficulties: Meaning of Bit Manipulation; CF, OF, and AF flag in Bit Manipulation; Shift Operation of Long Binary Lecture: 2 8. Program Transfer Instruction • Explain why program transfer instruction only checks flags, but not affect them. 4 • Introduce label in source code, and explain its meaning. • Introduce JMP instruction, and explain it is necessary for branch or cycle program structure. • Introduce transfer instructions based on single flag, and describe their applications. • Introduce unsigned and signed transfer instructions, and explain their difference. • Analyze some examples about design of branch and cycle program structure. • Introduce LOOP instruction, and explain its implied operation to CX. • Describe LOOP only checks CX, not ZF. • Analyze some examples about count cycle structure. • Introduce CALL and RET instruction, and analyze an example about procedure design. • Introduce INT and IRET instruction, and describe the general interrupt call and return. Key Points & Difficulties: Branch and Cycle Structure in Assembler Language; Status Flags Used in Program Transfer Instruction; Correspondence between Binary Code and Flag Selection; Procedure Call and Return Mechanism Lecture: 3 9. External Pins of 8088 CPU and PC System Bus • Explain three basic properties of pins, which are direction, high-impedance, valid signal. • Explain three pin types, which are data, address, and control pins. • Introduce all pins of 8088 CPU, and explain their meaning and properties. • Introduce the clock generating principle in 8284A clock generator. • Introduce the wait timing principle in 8284A clock generator. • Explain the minimum mode 8088 bus and the bus timing. • Introduce the basic principle of 8288 bus controller. • Explain the maximum mode 8088 bus and the bus timing. • Explain the PC system bus and the bus timing. Key Points & Difficulties: Properties of Pins; Multiplexed Pins; Clock Generating; Address Latching; Architecture of PC System Bus; Concept of Bus Timing; Function of Ready Pin and Wait Timing; Lecture: 6 10. Memory Interface • Introduce memory chip types, and explain their general application. • Explain the address decoding in memory chips. • Introduce the pins of classic memory chips, and explain their meanings. • Explain two classic connections between memory chips and system bus. • Explain four chip selection decoding types, and the corresponding memory structures. • Analyze some examples of memory structure designs. • Explain the timing match between CPU and memory chips. Key Points & Difficulties: Address Decoding; Connections between Memory and System Bus; Chip Selection Decoding Types; Designs of Memory Structure; Timing Match between CPU and Memory Chips Lecture:3 5 11. Basic I/O Interface • Explain two aspects of interface, which are bus interface and device interface. • Narrate three register types in general interface, and explain their meanings. • Explain how CPU interacts with general I/O interface. • Narrate four basic interaction modes between CPU (or Memory) and I/O interfaces. • Compare different interaction modes, and explain their applications. • Describe examples about interactions between CPU (or Memory) and input/output interfaces. Key Points & Difficulties: Meaning of Three Register Types; Basic Interaction Principle between CPU and I/O Interface; Direct Transfer Mode; Status Query Mode; Interrupt Interaction Mode; DMA Interaction Mode Lecture: 5 12. The 8255 Programmable Peripheral Interface • Introduce pins of 8255, and explain their meanings. • Describe the internal architecture of 8255. • Explain the basic interaction principle between CPU and 8255. • Narrate three operation modes of 8255, and explain their general applications. • Describe the timing of three operation modes. • Analyze the signal connection and programming in application examples of 8255. Key Points & Difficulties: Meanings of 8255 I/O ports; Operation modes of 8255; How to select suited operation mode for different devices; Programming for 8255 application Lecture: 3 13. The 8259 Programmable Interrupt Controller • Introduce the interrupt system of 8088 CPU, and explain all interrupt types in it. • Describe the interrupt accept procedure of 8088 CPU. • Explain the concept of interrupt vector and interrupt vector table. • Analyze the interrupt routine programming of internal interrupt with an example. • Introduce pins of 8259, and explain their meanings. • Describe the internal architecture of 8259, and explain the registers concerned. • Describe the timing in interrupt accept procedure for 8259. • Explain operation modes in 8259. • Introduce the ICWs of 8259, and explain the initialization of 8259. • Introduce the OCWs of 8259, and explain the interaction between CPU and 8259. • Conclude the addressing of ICWs and OCWs in 8259. • Analyze the interrupt routine programming of external interrupt with an example. Key Points & Difficulties: Interrupt System of 8088; Interrupt Accept Procedure of 8088; Timing in Interrupt Accept Procedure for 8259; ICWs and OCWs of 8259; Addressing in 8259; Interrupt Routine Programming Lecture: 6 14. The 8237 DMA Controller • Describe the general DMA request and accept procedure. 6 • Introduce the pins of 8237, and explain their meanings. • Describe the timing of 8237. • Explain four operation modes and three transfer types of 8237. • Introduce registers in 8237, and explain the software commands. • Conclude the interaction between 8237 and CPU. • Analyze some examples of 8237 programming and DMA application. Key Points & Difficulties: DMA Request and Accept procedure; 8237 Timing; Operation Modes in 8237; Software Commands; Lecture:3 15. Review of This Course Lecture:3 Total: Lecture: 48 Tools & MASM 5.0 Environment 7