Intel Computer Architecture Presented By Jessica Graziano.

Slides:



Advertisements
Similar presentations
Registers of the 8086/ /2002 JNM.
Advertisements

Slides created by: Professor Ian G. Harris Efficient C Code  Your C program is not exactly what is executed  Machine code is specific to each ucontroller.
There are two types of addressing schemes:
Introduction to 8086 Microprocessor
SOFTWARE ARCHITECTURE OF THE 8088 AND 8086 MICROPROCESSORS
Assembly Language :CSC 225 (Lec#4: Flag Register and Conditional Statements) By Dr. Syed Noman.
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
8-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file).
ICS312 Set 3 Pentium Registers. Intel 8086 Family of Microprocessors All of the Intel chips from the 8086 to the latest pentium, have similar architectures.
Gursharan Singh Tatla Block Diagram of Intel 8086 Gursharan Singh Tatla 19-Apr-17.
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
The 8086 Microprocessor The 8086, announced in 1978, was the first 16-bit microprocessor introduced by Intel Corporation 8086 is 16-bit MPU. Externally.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 18: 0xCAFEBABE (Java Byte Codes)
An Introduction to 8086 Microprocessor.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
Electrical Engineering Department Engineering College Prince Sattam bin Abdul Aziz University Text Book: - Triebel and Singh, "The 8088 and 8086 Microprocessors",
1 Fundamental of Computer Suthida Chaichomchuen : SCC
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR1 Addressing Mode.
Types of Registers (8086 Microprocessor Based)
LAB Flag Bits and Register
Lecture 4 ( Assembly Language).
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#5) By Dr. Syed Noman.
Dr. José M. Reyes Álamo 1.  Review: ◦ of Comparisons ◦ of Set on Condition  Statement Labels  Unconditional Jumps  Conditional Jumps.
Arithmetic Flags and Instructions
Executing and Linking an assembly program. Lesson plan Review Program logic and control Practice exercise Assembling, Linking and Executing Programs Practice.
1 ICS 51 Introductory Computer Organization Fall 2009.
Microprocessors The ia32 User Instruction Set Jan 31st, 2002.
Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.
LEA instruction The LEA instruction can be used to get the offset address of a variable Example ORG 100h MOV AL, VAR1 ; check value of VAR1 by moving it.
October 1, 2003Serguei A. Mokhov, 1 SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003.
3.4 Addressing modes Specify the operand to be used. To generate an address, a segment register is used also. Immediate addressing: the operand is a number.
Microprocessor MA Rahim Khan Computer Engineering and Networks Department.
6-4 CPU-Registers, effective address General registers vs Segment registers Computer Studies (AL)
Introduction to Microprocessors Chapter 3. Programming Model (8086)  Shows the various internal registers that are accessible to the programmer.
Microprocessor & Assembly Language Arithmetic and logical Instructions.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
SOFTWARE ARCHITECTURE OF THE 8088 AND 8086 MICROPROCESSORS
7-Nov Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Oct lecture23-24-hll-interrupts 1 High Level Language vs. Assembly.
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
Computer Architecture CST 250
Format of Assembly language
Gunjeet Kaur Dronacharya Group of institutions
Introduction to 8086 Microprocessor
8086 Microprocessor.
Instruksi Set Prosesor 8088
Introduction of microprocessor
Microprocessor and Assembly Language
EE3541 Introduction to Microprocessors
Microprocessor and Assembly Language
Assembly Language Programming Part 2
Intel 8088 (8086) Microprocessor Structure
(The Stack and Procedures)
CS-401 Assembly Language Programming
Introduction to Assembly Language
Lecture 4 ( Assembly Language).
Fundamentals of Computer Organisation & Architecture
(The Stack and Procedures)
Shift & Rotate Instructions)
Shift & Rotate Instructions)
(The Stack and Procedures)
Chapter 8: Instruction Set 8086 CPU Architecture
Computer Operation 6/22/2019.
Presentation transcript:

Intel Computer Architecture Presented By Jessica Graziano

C Language versus Assembly Language C Language: An upper-level programming language that is used for implementing software in various computer architectures. Assembly Language: The basic low-level language used for computers and microprocessors. It is specific to a particular architecture. Relationship: The compiler converts the C code into assembly code in order to communicate to the microprocessor. Source Program (Written in C) Compiler (Assembly Program) Assembler (Machine Codes)

Pointer Instruction In assembly language, there are a few ways of setting a pointer, but the most common is using the command LEA (load effective address) This command loads a memory location into a register instead of loading the contents of the memory location LEA register, variable Example: LEA ax, EA The command allows programmers to manipulate memory addresses and does so without setting off any flags

Call Instruction Call instructions make it possible to implement a subroutine and later return to the current executing code. The call instruction is executed in a series of steps 1. When the call command occurs, it pushes the current code location onto the stack in memory before executing the subroutine. 2. It then jumps to the location indicated by the operand. [call operand] 3. When the execution reaches the return instruction, the code location is popped from the stack and a jump allows it to go back to the point in the code where the call command was executed.

Loop Instruction There are various ways to create a loop in assembly language. The most common way is to invoke jump commands. Jump commands work with compare statements to produce the same effect as a while loop in the C language. Sample Code: mov ax, 16 mov bx, 15 cmp ax, bx jne Sample Code

The Stack The stack is implemented in memory. Its mainly used for temporary storage of information such as data or addresses. Sample Code: mov ax, 100h mov bx, 102h PUSH ax PUSH bx POP cx POP dx

Flag Registers Flag registers are also referred to as status registers, they are used to indicate conditions produced as the result of an executing instruction. Carry flag (CF): Set if there is a carry-out or borrow-in for the most significant bit Parity flag (PF): Set if a produced result has even parity Auxiliary flag (AF): Set if there is a carry-out from the low into the high nibble Zero flag (ZF): Set if a produced result is equal to zero Sign flag (SF): Set if a produced result is negative Overflow flag (OF): Set if a produced signed result is out of range

I/O Devices Assembly code can also be used to access the input/output ports of a microprocessor. These ports can lead to special- purpose interfaces such as keyboards and displays or core interfaces such as direct memory access controls. The access to these interfaces uses the INPUT and OUTPUT commands.

C Code Explained 1. #define DEV_REG_BASE 0xDF void main () { 2. unsigned int value = 0; // Turn on the device 3. value = *(unsigned int *)(DEV_REG_BASE + 0x0); 4. value = (value | (0x1 << 31)); 5. *(unsigned int *)(DEV_REG_BASE + 0x0) = value; 6. waitOnDevice(); } void waitOnDevice() { 7. while(!(*(unsigned int *)(DEV_REG_BASE + 0x4) & (0x1 << 8))) { 1. Defines DEV_REG_BASE as a memory location 1. Defines value as an unsigned integer 0 1. Value equals the contents of the memory location pointed to by DEV_REG_BASE + 0x0 (points to register) 2. New value equals the old value OR’d with (making bit 31 of the device equal 1, therefore turning on the device) 1. Loading a 1 into bit 31 of register 1. Subroutine waitOnDevice is called 2. The loop will wait for bit 8 of the register to go to one in order to enable the device

Compiled Assembly Code Main:pushrbp;base pointer pushed onto stack movrbp, rsp;stack pointer moved into base pointer subrsp, 16;subtract 16 from stack pointer movDWORD PTR [rbp-4], 0;0 is moved into PTR variable moveax, ;0xDF80400 moved into AX register moveax, DWORD PTR [rax];contents of memory location moved into AX register movDWORD PTR [rbp-4], eax;contents of AX register moved into variable orDWORD PTR [rbp-4], ;Bit 31=1 moved into AX register moveax, ;0xDF80400 moved into AX register movedx, DWORD PTR [rbp-4];contents of location moved into DX register movDWORD PTR [rax], edx;DX register moved into variable moveax, 0;0 is moved into AX register callwaitOnDevice;subroutine is called leave waitOnDevice:pushrbp;base pointer pushed onto stack movrbp, rsp;stack pointer moved into base pointer.L4:moveax, ;0xDF80400 moved into AX register moveax, DWORD PTR [rax];contents of memory location moved into AX register andeax, 256;Bit 8=1 moved into AX register testeax, eax;compare the values of the ax register je.L4;if ax=ax, jump back to.L4 leave

8086 Assembly Code Explained DEV_REG_BASE DW ? BIT31 DW ? BIT8 DW ? VALUE DW ? lea AX, DEV_REG_BASE ;memory address of DEV_REG_BASE PUSH AX ;save address on stack lea BX, BIT31 ;memory address of BIT 31 add AX,BX ;offsetting from DEV_REG_BASE to BIT 31 PUSH AX ;save offset address on stack mov BX, [00202h] ;points to contents from memory location 202 or BX, 1h ;old value OR'd with bit 31=1 ( ) mov VALUE, BX ;store new value in memory location call waitOnDevice ;call subroutine waitOnDevice ret waitOnDevice: lea AX, DEV_REG_BASE ;memory address of DEV_REG_BASE lea BX, BIT8 ;memory address of BIT 8 add BX, AX ;offsetting from DEV_REG_BASE to BIT 8 PUSH BX ;save offset address on stack mov BX, [00204h] ;points to contents from memory location 204 and BX, 1h ;value in memory location 204 AND'D with bit 8=1 (256) jz waitOnDevice ;if BIT 8=0, code jumps back to wait on device ret

8086 Emulator Execution

Summary It is very important to understand the transition from C Language to Assembly Language. The compiler can be used to generate the assembly code given a C program but the basic understanding aids in the ability to follow along wit what is happening in the code. The commands and instructions are the fundamentals of these languages. Knowing the function of each command allows for effective and efficient coding in all languages. The 8086 Emulator is a great tool that enables the programmer to visually see the registers and the stack as it steps through the code.