Lec3_System_Intercon - 1 Lecture 3 Computer Instruction and Interconnection(Continued… 2 Last Week and This Week • We learnt — Program and

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Lecture 3 Computer Instruction and Interconnection (Continued…) 2 Last Week and This Week • We learnt — Program and Instruction — Interrupt • We will learn — Intel Processor Instructions — Bus Structure — Timing Diagram 3 What is an instruction set? • The complete collection of instructions that are understood by a CPU • Representation — Machine Codes (Binary only 0 and 1) — Usually represented by assembly codes • Elements of an Instruction — Operation code (Op code) – Do this — Source Operand reference – To this — Result Operand reference – Put the answer here — Next Instruction Reference – When you have done that, do this... 4 Instruction Cycle State Diagram • Recall the State Diagram 5 Instruction Representation • In machine code each instruction has a unique bit pattern • For human consumption (well, programmers anyway) a symbolic representation is used — e.g. ADD, SUB, LOAD • Operands can also be represented in this way — ADD A,B • Problem :How many operands/addresses should be contained in ONE instruction? Simple Instruction Format 6 Instruction length • How many bits for an instruction • Most basic design issue • Affected by and affects: — Memory size Memory size : length of an address — Memory organization Memory organization : word size — Bus structure Bus structure : transfer rate — CPU complexity CPU complexity : more instructions need => more complex CPU — CPU speed CPU speed : gap between CPU speed and memory transfer rate • Long instruction vs. short instruction — Trade off between powerful instruction set and saving space 7 INTEL Processor Machine Language (Executed And Inspected) • An assembler may used to convert the source code (mnemonics) MOV [0400], AL into the object code A2 0400. • Executable program can be created in memory via DOS utility- debug.exe • Using the debug assembler. — Instruction mnemonics are entered into memory. — The debug assembler generates the HEX. Code equivalent for execution immediately from DOS — A disk object file was created. — Automatically selects default values for IP, program code, data and stack etc. • E.g. Debug can be used to generate object code from an instruction’s source code. 8 Common Instructions: Addressing (MOV) • Immediate addressing mode Mov, HR , Data8 <----- Moves 8 bits of data (bytes) directly into the specified H alf R egister: Source code Object code content MOV AH, 07 B4 07 AH = 07 MOV CH, 28 B5 28 CH = 28 Source code Object code Mov AX, 52B7 B8 B7 52 <------- Moves 52 B7 into AX REG. 52 (1st Byte) Moved into AH and B7 (2nd Byte ) into AL 9 Common Instructions: Addressing (MOV) • Direct memory addressing mode — Moves the contents of the 16 bit offset of data byte into specified half register: – Mov Hr, [addr] – Mov [ADDR], HR Source CODE OBJECT CODE MOV AH, [0200] 8A260002 MOV BL, [0400] 8A1E0004 Hence it would load data value 5A into AH, if the content of cell 200 is 5A 10...
View Full Document

This note was uploaded on 08/18/2011 for the course COMP 3868 taught by Professor Keithchan during the Summer '97 term at Hong Kong Polytechnic University.

Page1 / 39

Lec3_System_Intercon - 1 Lecture 3 Computer Instruction and Interconnection(Continued… 2 Last Week and This Week • We learnt — Program and

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

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