Advanced Microprocessors

Size: px
Start display at page:

Download "Advanced Microprocessors"

Transcription

1 Advanced Microprocessors Notes #2 Software Architecture & Instruction Set Architecture Part 1 EE 467/567 Winter 2012 by Avinash Kodi SWA.1 Background Materials Textbook: 2.1, 2.2, 3.1 Other: IA-32 Intel Architecture Software Developer s Manual Volume 1: Basic Architecture Sections 3.4.1, 3.4.2, 3.4.3, 3.5 IA-32 Intel Architecture Software Developer s Manual Volume 3A: System Programming Guide Sections 3.1, 3.2, 3.3, 3.4, SWA.2 1

2 Computer Architecture Software Application Operating System Compiler & Assembler Control Unit Program Storage Data Storage Memory Hardware Datapath Input Output Micro Processor Unit (MPU) Input/Output (I/O) SWA.3 Software Architecture Basic Hardware Knowledge the User (Programmer) Needs to Program Assembly Registers, Instruction Set Architecture, Addressing Modes, SWA.4 2

3 Datapath Address Bus 20 General Registers AH BH CH DH SP AL BL CL DL Registers CS Data Bus 16 BP DI SS SI ES ALU Data Bus 16 IP Internal Communications Registers Bus Control Logic 8086 Bus Temporary Registers Control Unit ALU EU Control System Q Bus Flags Execution Unit (EU) Bus Interface Unit (BIU) Intel 8086 SWA.5 Intel Evolution Internal Data Bus Pentium P Pro P II P III Year Introduced Clock rate (Hz) # Transistors Physical Memory Internal Data Bus External Data Bus Address Bus Data type (bits) G 4.5k 6.5k 29k 29k 130k 275k 1.2M 3.1M 5.5M 7.5M 8.2M 64k 64k 1M 1M 16M 4G 4G 4G 64G 64G 64G ,16 8,16 8,16 8,16,32 8,16,32 8,16,32 8,16,32 8,16,32 8,16,32 SWA.6 3

4 Software Architecture Register Width IA-16 & IA bits 32-bits AH AL AX AH AL EAX General Purpose Registers (GP) Segment Registers BH BL CH CL DH DL SP BP DI SI CS SS ES IP FLAGS BX CX DX code segment data segment stack segment extra segment BH CH DH EIP EFLAGS SP BP DI SI CS SS ES FS GS BL CL DL EBX ECX EDX ESP EBP EDI ESI Pentium Pentium Pro Pentium II Pentium III Pentium 4 Pentium 4 HT Pentium M Pentium D Core Core 2 16-bit Architectures 32-bit Architectures SWA.7 SWA.8 4

5 Software Architecture Register Width IA-64 (EMT*) 64-bits EAX RAX EBX RBX ECX RCX General Purpose Registers (GP) R8 R9 EDX ESP EBP EDI ESI RDX RSP RBP RDI RSI R14 R15 RIP EFLAGS Xeon Extreme Edition Pentium 4 Core 2 *EMT = Extended memory 64 Technology SWA.9 Software Architecture Register Width IA-64 (Itanium) 64-bits General Registers GR0 GR1 GR2 GR3 GR4 GR5 GR6 GR7 GR126 GR127 Instruction Bundle Itanium 128-bits SWA.10 5

6 Software Architecture Register Width AMD64 64-bits EAX RAX EBX RBX ECX RCX General Purpose Registers R8 R9 EDX ESP EBP EDI ESI RDX RSP RBP RDI RSI R14 R15 RIP EFLAGS AMD64 SWA.11 Instruction Pointer Contains the address of the next word/byte of instruction code to be fetched from the current code segment of memory, SWA.12 6

7 Intel Evolution Internal Data Bus Pentium P Pro P II P III Year Introduced Clock rate (Hz) # Transistors Physical Memory Internal Data Bus External Data Bus Address Bus Data type (bits) G 4.5k 6.5k 29k 29k 130k 275k 1.2M 3.1M 5.5M 7.5M 8.2M 64k 64k 1M 1M 16M 4G 4G 4G 64G 64G 64G ,16 8,16 8,16 8,16,32 8,16,32 8,16,32 8,16,32 8,16,32 8,16,32 SWA.13 Software Architecture Address Space Address Bus CPU For example: For example: 80x86 20 bit wide address bus 2 20 = 1MBytes Pentium II 36 bit wide address bus 2 36 = 64GBytes The physical address space is defined as the range of addresses that the processor can generate on its address bus. SWA.14 7

8 Software Architecture Example AX BX CX DX IP CS SS ES AH AL BH BL CH CL DH DL SP BP SI DI FLAGS FFFFF 16 External memory Address space Code segment (64 k) Data segment (64 k) Stack segment (64 k) Extra segment (64 k) IP = Instruction Pointer SP = Stack Pointer BP = Base Pointer SI = Source Index DI = Data Index SR = Status Register Memory Address Space: FFFFF = 1,048,576 bytes (1 Mbyte) Input / Output address space FFFF SWA.15 Data Storage Address Memory (Binary) Memory (Hexadecimal) 0062A Nibble Byte Word Double word 4 bits 8 bits 16 bits (2 bytes) 32 bits (4 bytes) Memory (Hexadecimal) Word { Most significant byte Least significant byte } Word: Word: two consecutive bytes Word { 47 3F Most significant byte Least significant byte } Word: 473F 16 Decreasing addresses (same for double words) SWA.16 8

9 Data Storage Endians Big Endian: Least Significant higher address Most Significant lower address Little Endian: Least Significant lower address Most Significant higher address Little Endian processors: Intel 80x86, Pentium II/III/IV, VAX, Alpha Big Endian processors: 680x0, Sun SPARC PowerPC: Alter the Endian-ness using instructions SWA.17 Aligned and Misaligned Data Data words: Data double words: Aligned Words Misaligned Words Aligned Double Words Byte Byte F E D C B A 1 6 Byte 7 Byte 6 Byte 5 Byte 4 Byte 3 Byte 2 Byte 1 Byte 0 Word 6 Word 4 Word 2 Word 0 Word 5 Word 3 Word 1 Aligned byte: Least Significant Byte at an even address Misaligned byte: Least Significant Byte at an odd address 0062F E D C B A Byte 7 Byte 6 Byte 5 Byte 4 Byte 3 Byte 2 Byte 1 Byte 0 Double Word 4 Double Word 0 Double Word 5 Double Word 1 Double Word 2 Misaligned Double Words Double Word 3 SWA.18 9

10 Examples Address Memory (Hexadecimal) Instruction 1: read a address A A A7 C E Instruction 2: read a double address D Instruction 3: read a address SWA.19 Memory Management Addressing Methodologies Real Mode Logical Address Physical Address Space Segment register Offset (4 nibbles) 0 0 nibble + Segment Physical Address Segment Base Address Segment Register : Offset SWA.20 10

11 Real Mode Addresses Example: The Old 8086 Physical address: 20-bit value (remember: 20-bit address bus) Logical address: 16-bit base pointer (CS,SS,,ES) + an offset (IP, SP, BP, SI, DI) How do we obtain a physical address from the logical address: Notation: segment register : offset Offset value* 0 Segment Register Example: = 123A 16 = 123AH BX = = 2234H Logical Address: :BX Adder bit Physical memory Address Physical address: :BX = 123AH:2234H = 123A0H H = 145D4H *a.k.a. displacement SWA.21 Memory Management Segments 8086/8088 Segments are 2 16 = 64kbytes Note that segment can be contiguous, adjacent, disjointed, and overlapping. Fully Overlapped Partially Overlapped Contiguous Segment D Segment C Disjoint Logical segments Segment A Segment B Segment E Physical memory SWA.22 11

12 Logical Address Segment Selector Offset (8 nibbles) Memory Management Segmentation IA-32 Linear Address Space + Segment Linear Address Segment Base Address Segment Table (Global or Local Descriptor Table) (located in memory) SWA.23 Memory Management Protected-Mode Protected-Mode operation allows memory above the first 1Mbytes to be accessed by the through the latest Pentium, Protected-mode introduces protection: 8088/86 is unable to block general functions from accessing the kernel of the operating system (a program can go from any code segment to any other code segment). In protected mode the OS is given a mechanism to prevent the user from accidentally taking over the core of the OS and thus crashing your computer. SWA.24 12

13 Memory Management Paging Linear Address Directory Table Offset Page Tables + Physical Address Space Page Page Directory Phys. Address Entry Entry Page Directory Base Address (from CR3) SWA.25 Memory Management Segmentation & Paging IA-32 Logical Address Linear Address Selector Offset Directory Table Offset Physical Address Space + Page Tables + Page Page Directory Phys. Address Entry Entry Segment Table (Global or Local Descriptor Table) (located in memory) Page Directory Base Address (from CR3) Segmentation Paging SWA.26 13

14 Instruction Set Architecture SWA.27 Programming Languages Source Code: High-level Language (C, C++, Pascal, BASIC,FORTRAN) Assembly Language Compile & Link Assemble Tool: Compiler & Linker Tool: Assembler Machine Code (Bytes stored in memory) Machine Code (Bytes stored in memory) A mix of assembly and a high-level language can be used: inline-assembly SWA.28 14

15 Assembly Language Assembly Statements Mnemonic Label Argument Comments START: MOV AX,34EH ; Move 34EH into the AX register MOV DX,[1234H] ; Move the contents of the memory location ; with offset 1234H into the DX register ADD DX,AX ; Add AX to DX and store the result into DX END MOV AX, 34EH Destination Source SWA.29 Register Transfer Language (RTL) Intro RTL is machine independent!!!! ( ) = Contents of = Move operand on right-hand-side source to the left-hand-side destination & = AND = OR ^ = Exclusive-OR + = Addition - = Subtraction * = Multiplication / = Division VHDL and Verilog are also machine independent description languages but they differ from RTL SWA.30 15

16 Assembly Language Assembly Statements - RTL START: MOV AX, 34EH AX 34Eh MOV DX, [1234H] DX (1234h) Effective Address 1234h ADD DX, AX DX (DX) + (AX) SWA.31 Machine Code Listing Address Program bytes in memory 00C00 B8 4E 03 START: MOV AX,34EH 00C03 8B MOV DX,[1234H] 00C07 01 C2 ADD DX,AX END Byte located at memory location (ML) 00C05 16 Generated automatically by the Assembler or manually using the instruction information sheets as can be found in Volumes 2a and 2b. SWA.32 16

17 Machine Code In Memory Assembly will be converted to machine code for machine interpretation. As a result the program consists of a bunch of bytes in memory! A x86 Assembly RTL mov ax,[1234] ax ( ) D E mov bx,[0456] bx ( ) A B B D8 16 inc ax ax (ax) + 1 dec bx bx (bx) - 1 add ax,bx ax (ax) + (bx) 0063C D E OF 16 OF 16 and ax,0f0f ax (ax) & 0F0F 16 SWA.33 Instruction Set Architecture IA-32 General purpose Arithmetic, Logic, Shift Control and Branch, Data movement. FPU MMX SSE extensions SSE2 extensions SSE3 extensions SSE4 extensions System instructions IA-32 Intel Architecture Software Developer s Manual Volumes 2a & 2b SWA.34 17

18 The Elements of an Instruction Operation code (opcode): Binary code that specifies the operation to be performed. Operands Source operand reference: Operand that is the input for the operation Result (destination) operand reference: Operand that is the result for the operation Next instruction reference: Tells the CPU where to fetch the next instruction SWA.35 The Elements of an Instruction MOV CX, [013AH] Mnemonic Destination Source RTL: CX (0123A) or Text: Move the contents of address :013A to register CX SWA.36 18

19 IA-32 Intel Architecture Software Developer s Manual, Volume 2a, pp SWA.37 The operands can be: Addresses Register contents Numbers Integer or fixed-point Floating point Decimal Characters ASCII etc. Logical data The Operand SWA.38 19

20 Operands IA-32 Intel Architecture Software Developer s Manual, Volume 2a, pp SWA.39 Addressing Modes Memory Addressing Modes Immediate Register Direct Register Indirect Based Indexed Based-Indexed Scaled Based-Indexed SWA.40 20

21 Instructions Immediate & Register Addressing Immediate Addressing The source or destination field is the operand Examples: MOV AX,88 AX 88 Note: CS cannot be used as the destination Register* Addressing The source or destination field is a register Examples: MOV AX,88 (Intel) AX 88 *Also register direct addressing SWA.41 Instructions Register Indirect & Direct Addressing Register Indirect Addressing The source or destination address is stored in a register. Examples: MOV [BX],CL (Intel) :(BX) (CL) Direct* Addressing The source or destination address is explicitly given Examples: MOV [124A],CL (Intel) :124A (CL) *Also displacement addressing SWA.42 21

22 Instructions Based & Indexed Addressing* Based Addressing The source or destination address is determined by the contents of a base register plus an absolute displacement Examples: MOV [BX]+0123H,CL :(BX)+0123H (CL) Indexed Addressing The source or destination address is determined by the contents of a index register plus an absolute displacement Examples: MOV [DI]+0123H,CL :(DI)+0123H (CL) *these are forms of so-called relative addressing SWA.43 Instructions Based - Indexed Addressing* Based Indexed Addressing The source or destination address is determined by the contents of a base register plus the contents of an index register plus an absolute displacement Examples: MOV [BX][SI]+0123H,CL :(BX)+(SI)+0123H (CL) *these are forms of so-called relative addressing SWA.44 22

23 Addressing Effective Address Effective Address: Offset within a segment Example 1: MOV AX, [BX]+123H -> (BX)+123H is the effective address or offset within the data segment (). Example 2: ADD CX, [BP][SI]+12H -> (BP+SI)+12H is the effective address or offset within the stack segment (SS). One can override the default segment by explicitly indicating the segment within which the data can be found. Example 3: MOV AX, ES:[BX]+123H -> (BX)+123H is the effective address or offset within the extra segment (ES). SWA.45 Addressing Effective Address/Offset Segment Base Index Displacement CS SS ES : none BP SI 8- bits BX DI 16 - bits (a) 16-bit x86 Architectures Segment Base ( Index * Scale) Displacement CS SS ES FS GS ( E) AX ( E) AX ( E) CX ( E) CX ( E) DX 1 none ( E) DX ( E) BX 2 8 bits : ( E) BX * ( E) SP 4 16 bits ( E) BP ( E) BP 8 32 bits ( E) SI ( E) SI ( E) DI ( E) DI (a) 32-bit x86 Architectures Note 1: Right-hand side of the colon is referred to as the effective address Note 2: Each component can be positive or negative (2s complement). SWA.46 23

24 Constructing Addresses Default combinations 16-bit segment and offsets (Table 2-3 in textbook) Segment Offset Special Purpose CS IP Instruction address SS SP and BP Stack address BX, DI, SI, 8-bit number, 16-bit number Data address ES DI String destination address 32-bit segment and offsets (Table 2-4 in textbook) Segment Offset Special Purpose CS EIP Instruction address SS ESP and EBP Stack address EAX, EBX, ECX, EDX, ESI, EDI, 8-bit number, 32-bit number Data address ES EDI String destination address FS No default General address GS No default General address SWA.47 Instruction Format Machine Code SWA.48 24

25 Operands Volumes 2a & 2b IA-32 Intel Architecture Software Developer s Manual, Volume 2a, pp SWA.49 Operands SWA.50 25

26 Operands SWA.51 Operands SWA.52 26

27 SWA.53 SWA.54 27

28 SWA.55 Example 1 Ex 1 (286): MOV AX, [BP] H r16 m16 MOV r16, m16 Volume 2a pp (631) SWA.56 28

29 SWA.57 Example 1 Ex 1 MOV AX, [BP] H 8B Displacement: low-byte first SWA.58 29

30 Example 2 Ex 2 (286): ADD [BP][DI]+1234H, CX Machine Code: 01 8B SWA.59 SWA.60 30

31 Example 3 Ex 5 (Pentium/Core): MOV EAX,[EBX+4*ECX] Result: 8B 04 8B H SWA.61 SWA.62 31

32 SWA.63 Others Ex 4 : SUB BX, 03EFH Result: 81 EB EF 03 H Ex 5 : MOV [1234H], Result: 8C 1E H SWA.64 32

33 Operand Table Examples MOV r/m32, r32 Destination Source MOV [ H], EAX Memory direct Register direct MOV EDX, EAX Register direct Register direct MOV [EBP],ECX Based Register direct MOV r/m16, imm16 Destination Source MOV [ H], A432H Memory direct Immediate MOV DX, A432H Register direct Immediate MOV [EBP], A432H Based Immediate SWA.65 Utilization of registers or displacements Type Base Index Scale Displacement Register Operand Immediate Operand Addressing Modes IA-16 & IA32 No memory address required No memory address required Direct X Register indirect X or X - - Based X - - X Index X - X Based-Index X X - X Scaled-Index 1 - X X X Based Scaled-Index 1 X X X X 1 Only available in the through Pentium 2 Or displacement addressing SWA.66 33

34 Addressing Modes Notation Type Register Operand Immediate Operand Direct Register indirect Based Indexed Based-Indexed Scaled-Indexed Based Scaled-Indexed Instruction MOV AX,BX MOV CH, 3AH MOV [1234H],AX MOV [BX],CL MOV [BX]+10ABH,AL MOV CH, [SI]+88H MOV AX, [BP][DP]+2001H MOV [SI]*2+234H,AX MOV [BX][SI]*4,AH SWA.67 Register Operand Addressing Mode MOV AX,BX IP 008A IP 008C CS SS ES AX BX CX DX 00A0 AB CD 00A8AH 00A8BH 00A8CH 00A8DH 8B C3 CS SS ES AX BX CX DX 00A0 AB CD AB CD 00A8AH 00A8BH 00A8CH 00A8DH 8B C3 SP BP SI DI SP BP SI DI (a) Before execution of instruction (b) After execution of instruction SWA.68 34

35 Immediate Operand Addressing Mode MOV AL,2AH IP 008A IP 008C CS SS ES AX BX CX DX 00A0 00A8AH 00A8BH 00A8CH 00A8DH B0 2A CS SS ES AX BX CX DX 00A0 2A 00A8AH 00A8BH 00A8CH 00A8DH B0 2A SP BP SI DI SP BP SI DI (a) Before execution of instruction (b) After execution of instruction SWA.69 Direct Addressing Mode MOV CX,[10ABH] IP 008A IP 008E CS SS ES AX BX CX DX 00A0 01C0 00A8AH 00A8BH 00A8CH 00A8DH 8B 0E AB 10 CS SS ES AX BX CX DX 00A0 01C0 DA 23 00A8AH 00A8BH 00A8CH 00A8DH 00A8EH 8B 0E AB 10 SP BP SI DI 02CABH 02CACH 23 DA SP BP SI DI 02CABH 02CACH 23 DA (a) Before execution of instruction (b) After execution of instruction SWA.70 35

36 Register Indirect Addressing Mode MOV AX,[SI] IP 008A IP 008C CS SS ES AX BX CX DX 00A0 01C0 00A8AH 00A8BH 00A8CH 00A8DH 8B 04 CS SS ES AX BX CX DX 00A0 01C0 DA 23 00A8AH 00A8BH 00A8CH 00A8DH 8B 04 SP BP SI DI 10AB 02CABH 02CACH 23 DA SP BP SI DI 10AB 02CABH 02CACH 23 DA (a) Before execution of instruction (b) After execution of instruction SWA.71 Based Addressing Mode MOV [BX]+00ACH, AL IP 008A IP 008E CS SS ES AX BX CX DX 00A0 01C0 10 A A8AH 00A8BH 00A8CH 00A8DH 00A8EH AC 00 CS SS ES AX BX CX DX 00A0 01C0 10 A A8AH 00A8BH 00A8CH 00A8DH 00A8EH AC 00 SP BP SI DI 02CABH 02CACH SP BP SI DI 02CABH 02CACH A8 (a) Before fetch and execution of instruction (b) After execution of instruction SWA.72 36

37 Indexed Addressing Mode MOV AL,[SI]+1000H IP 008A IP 008E CS SS ES 00A0 01C0 00A8AH 00A8BH 00A8CH 00A8DH 8A CS SS ES 00A0 01C0 00A8AH 00A8BH 00A8CH 00A8DH 8A AX BX CX DX 00A8EH AX BX CX DX 88 00A8EH SP BP SI DI 00AB 02CABH 02CACH SP BP SI DI 00AB 02CABH 02CACH (a) Before fetch and execution of instruction (b) After execution of instruction SWA.73 Other Examples XOR EAX, [ECX+8*ESI]+1234H PUSH [1426H] ADD BP,[1234H] SUB EAX,[BP] INC [BP]+68H SWA.74 37

Instruction Set Architectures

Instruction Set Architectures Instruction Set Architectures Computer Systems: Section 4.1 Suppose you built a computer What Building Blocks would you use? Arithmetic Logic Unit (ALU) OP1 OP2 OPERATION ALU RES ALU + Registers R0: 0x0000

More information

Assembly Language Each statement in an assembly language program consists of four parts or fields.

Assembly Language Each statement in an assembly language program consists of four parts or fields. Chapter 3: Addressing Modes Assembly Language Each statement in an assembly language program consists of four parts or fields. The leftmost field is called the label. - used to identify the name of a memory

More information

We can study computer architectures by starting with the basic building blocks. Adders, decoders, multiplexors, flip-flops, registers,...

We can study computer architectures by starting with the basic building blocks. Adders, decoders, multiplexors, flip-flops, registers,... COMPUTER ARCHITECTURE II: MICROPROCESSOR PROGRAMMING We can study computer architectures by starting with the basic building blocks Transistors and logic gates To build more complex circuits Adders, decoders,

More information

EEM336 Microprocessors I. The Microprocessor and Its Architecture

EEM336 Microprocessors I. The Microprocessor and Its Architecture EEM336 Microprocessors I The Microprocessor and Its Architecture Introduction This chapter presents the microprocessor as a programmable device by first looking at its internal programming model and then

More information

Computer Processors. Part 2. Components of a Processor. Execution Unit The ALU. Execution Unit. The Brains of the Box. Processors. Execution Unit (EU)

Computer Processors. Part 2. Components of a Processor. Execution Unit The ALU. Execution Unit. The Brains of the Box. Processors. Execution Unit (EU) Part 2 Computer Processors Processors The Brains of the Box Computer Processors Components of a Processor The Central Processing Unit (CPU) is the most complex part of a computer In fact, it is the computer

More information

6/20/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:

6/20/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to: Introduction Efficient software development for the microprocessor requires a complete familiarity with the addressing modes employed by each instruction. This chapter explains the operation of the stack

More information

6/17/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:

6/17/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to: Chapter 2: The Microprocessor and its Architecture Chapter 2: The Microprocessor and its Architecture Chapter 2: The Microprocessor and its Architecture Introduction This chapter presents the microprocessor

More information

Chapter 2: The Microprocessor and its Architecture

Chapter 2: The Microprocessor and its Architecture Chapter 2: The Microprocessor and its Architecture Chapter 2: The Microprocessor and its Architecture Chapter 2: The Microprocessor and its Architecture Introduction This chapter presents the microprocessor

More information

Introduction to IA-32. Jo, Heeseung

Introduction to IA-32. Jo, Heeseung Introduction to IA-32 Jo, Heeseung IA-32 Processors Evolutionary design Starting in 1978 with 8086 Added more features as time goes on Still support old features, although obsolete Totally dominate computer

More information

INTRODUCTION TO IA-32. Jo, Heeseung

INTRODUCTION TO IA-32. Jo, Heeseung INTRODUCTION TO IA-32 Jo, Heeseung IA-32 PROCESSORS Evolutionary design Starting in 1978 with 8086 Added more features as time goes on Still support old features, although obsolete Totally dominate computer

More information

Lecture (02) The Microprocessor and Its Architecture By: Dr. Ahmed ElShafee

Lecture (02) The Microprocessor and Its Architecture By: Dr. Ahmed ElShafee Lecture (02) The Microprocessor and Its Architecture By: Dr. Ahmed ElShafee ١ INTERNAL MICROPROCESSOR ARCHITECTURE Before a program is written or instruction investigated, internal configuration of the

More information

The Microprocessor and its Architecture

The Microprocessor and its Architecture The Microprocessor and its Architecture Contents Internal architecture of the Microprocessor: The programmer s model, i.e. The registers model The processor model (organization) Real mode memory addressing

More information

EEM336 Microprocessors I. Addressing Modes

EEM336 Microprocessors I. Addressing Modes EEM336 Microprocessors I Addressing Modes Introduction Efficient software development for the microprocessor requires a complete familiarity with the addressing modes employed by each instruction. This

More information

CS 16: Assembly Language Programming for the IBM PC and Compatibles

CS 16: Assembly Language Programming for the IBM PC and Compatibles CS 16: Assembly Language Programming for the IBM PC and Compatibles Discuss the general concepts Look at IA-32 processor architecture and memory management Dive into 64-bit processors Explore the components

More information

Reverse Engineering II: Basics. Gergely Erdélyi Senior Antivirus Researcher

Reverse Engineering II: Basics. Gergely Erdélyi Senior Antivirus Researcher Reverse Engineering II: Basics Gergely Erdélyi Senior Antivirus Researcher Agenda Very basics Intel x86 crash course Basics of C Binary Numbers Binary Numbers 1 Binary Numbers 1 0 1 1 Binary Numbers 1

More information

Instruction Set Architecture (ISA) Data Types

Instruction Set Architecture (ISA) Data Types Instruction Set Architecture (ISA) Data Types Computer Systems: Section 4.1 Suppose you built a computer What Building Blocks would you use? Arithmetic Logic Unit (ALU) OP1 OP2 OPERATION ALU RES Full Adder

More information

Complex Instruction Set Computer (CISC)

Complex Instruction Set Computer (CISC) Introduction ti to IA-32 IA-32 Processors Evolutionary design Starting in 1978 with 886 Added more features as time goes on Still support old features, although obsolete Totally dominate computer market

More information

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM EXPERIMENT WRITE UP AIM: Assembly language program for 16 bit BCD addition LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM TOOLS/SOFTWARE

More information

Reverse Engineering II: The Basics

Reverse Engineering II: The Basics Reverse Engineering II: The Basics Gergely Erdélyi Senior Manager, Anti-malware Research Protecting the irreplaceable f-secure.com Binary Numbers 1 0 1 1 - Nibble B 1 0 1 1 1 1 0 1 - Byte B D 1 0 1 1 1

More information

Registers. Ray Seyfarth. September 8, Bit Intel Assembly Language c 2011 Ray Seyfarth

Registers. Ray Seyfarth. September 8, Bit Intel Assembly Language c 2011 Ray Seyfarth Registers Ray Seyfarth September 8, 2011 Outline 1 Register basics 2 Moving a constant into a register 3 Moving a value from memory into a register 4 Moving values from a register into memory 5 Moving

More information

Hardware and Software Architecture. Chapter 2

Hardware and Software Architecture. Chapter 2 Hardware and Software Architecture Chapter 2 1 Basic Components The x86 processor communicates with main memory and I/O devices via buses Data bus for transferring data Address bus for the address of a

More information

UNIT 2 PROCESSORS ORGANIZATION CONT.

UNIT 2 PROCESSORS ORGANIZATION CONT. UNIT 2 PROCESSORS ORGANIZATION CONT. Types of Operand Addresses Numbers Integer/floating point Characters ASCII etc. Logical Data Bits or flags x86 Data Types Operands in 8 bit -Byte 16 bit- word 32 bit-

More information

Assembly Language Programming 64-bit environments

Assembly Language Programming 64-bit environments Assembly Language Programming 64-bit environments October 17, 2017 Some recent history Intel together with HP start to work on 64-bit processor using VLIW technology. Itanium processor is born with the

More information

CS 31: Intro to Systems ISAs and Assembly. Martin Gagné Swarthmore College February 7, 2017

CS 31: Intro to Systems ISAs and Assembly. Martin Gagné Swarthmore College February 7, 2017 CS 31: Intro to Systems ISAs and Assembly Martin Gagné Swarthmore College February 7, 2017 ANNOUNCEMENT All labs will meet in SCI 252 (the robot lab) tomorrow. Overview How to directly interact with hardware

More information

The von Neumann Machine

The von Neumann Machine The von Neumann Machine 1 1945: John von Neumann Wrote a report on the stored program concept, known as the First Draft of a Report on EDVAC also Alan Turing Konrad Zuse Eckert & Mauchly The basic structure

More information

Assembly I: Basic Operations. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Assembly I: Basic Operations. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Assembly I: Basic Operations Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Basic Execution Environment RAX RBX RCX RDX RSI RDI RBP RSP R8 R9 R10

More information

MODE (mod) FIELD CODES. mod MEMORY MODE: 8-BIT DISPLACEMENT MEMORY MODE: 16- OR 32- BIT DISPLACEMENT REGISTER MODE

MODE (mod) FIELD CODES. mod MEMORY MODE: 8-BIT DISPLACEMENT MEMORY MODE: 16- OR 32- BIT DISPLACEMENT REGISTER MODE EXERCISE 9. Determine the mod bits from Figure 7-24 and write them in Table 7-7. MODE (mod) FIELD CODES mod 00 01 10 DESCRIPTION MEMORY MODE: NO DISPLACEMENT FOLLOWS MEMORY MODE: 8-BIT DISPLACEMENT MEMORY

More information

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86 Lecture 15 Intel Manual, Vol. 1, Chapter 3 Hampden-Sydney College Fri, Mar 6, 2009 Outline 1 2 Overview See the reference IA-32 Intel Software Developer s Manual Volume 1: Basic, Chapter 3. Instructions

More information

Addressing Modes on the x86

Addressing Modes on the x86 Addressing Modes on the x86 register addressing mode mov ax, ax, mov ax, bx mov ax, cx mov ax, dx constant addressing mode mov ax, 25 mov bx, 195 mov cx, 2056 mov dx, 1000 accessing data in memory There

More information

Basic Execution Environment

Basic Execution Environment Basic Execution Environment 3 CHAPTER 3 BASIC EXECUTION ENVIRONMENT This chapter describes the basic execution environment of an Intel Architecture processor as seen by assembly-language programmers.

More information

UMBC. A register, an immediate or a memory address holding the values on. Stores a symbolic name for the memory location that it represents.

UMBC. A register, an immediate or a memory address holding the values on. Stores a symbolic name for the memory location that it represents. Intel Assembly Format of an assembly instruction: LABEL OPCODE OPERANDS COMMENT DATA1 db 00001000b ;Define DATA1 as decimal 8 START: mov eax, ebx ;Copy ebx to eax LABEL: Stores a symbolic name for the

More information

x86 Programming I CSE 351 Winter

x86 Programming I CSE 351 Winter x86 Programming I CSE 351 Winter 2017 http://xkcd.com/409/ Administrivia Lab 2 released! Da bomb! Go to section! No Luis OH Later this week 2 Roadmap C: car *c = malloc(sizeof(car)); c->miles = 100; c->gals

More information

The von Neumann Machine

The von Neumann Machine The von Neumann Machine 1 1945: John von Neumann Wrote a report on the stored program concept, known as the First Draft of a Report on EDVAC also Alan Turing Konrad Zuse Eckert & Mauchly The basic structure

More information

The x86 Architecture

The x86 Architecture The x86 Architecture Lecture 24 Intel Manual, Vol. 1, Chapter 3 Robb T. Koether Hampden-Sydney College Fri, Mar 20, 2015 Robb T. Koether (Hampden-Sydney College) The x86 Architecture Fri, Mar 20, 2015

More information

SYSC3601 Microprocessor Systems. Unit 2: The Intel 8086 Architecture and Programming Model

SYSC3601 Microprocessor Systems. Unit 2: The Intel 8086 Architecture and Programming Model SYSC3601 Microprocessor Systems Unit 2: The Intel 8086 Architecture and Programming Model Topics/Reading SYSC3601 2 Microprocessor Systems 1. Registers and internal architecture (Ch 2) 2. Address generation

More information

Binghamton University. CS-220 Spring x86 Assembler. Computer Systems: Sections

Binghamton University. CS-220 Spring x86 Assembler. Computer Systems: Sections x86 Assembler Computer Systems: Sections 3.1-3.5 Disclaimer I am not an x86 assembler expert. I have never written an x86 assembler program. (I am proficient in IBM S/360 Assembler and LC3 Assembler.)

More information

T Reverse Engineering Malware: Static Analysis I

T Reverse Engineering Malware: Static Analysis I T-110.6220 Reverse Engineering Malware: Static Analysis I Antti Tikkanen, F-Secure Corporation Protecting the irreplaceable f-secure.com Representing Data 2 Binary Numbers 1 0 1 1 Nibble B 1 0 1 1 1 1

More information

Assembler Programming. Lecture 2

Assembler Programming. Lecture 2 Assembler Programming Lecture 2 Lecture 2 8086 family architecture. From 8086 to Pentium4. Registers, flags, memory organization. Logical, physical, effective address. Addressing modes. Processor Processor

More information

Instruction Set Architectures

Instruction Set Architectures Instruction Set Architectures! ISAs! Brief history of processors and architectures! C, assembly, machine code! Assembly basics: registers, operands, move instructions 1 What should the HW/SW interface

More information

Module 3 Instruction Set Architecture (ISA)

Module 3 Instruction Set Architecture (ISA) Module 3 Instruction Set Architecture (ISA) I S A L E V E L E L E M E N T S O F I N S T R U C T I O N S I N S T R U C T I O N S T Y P E S N U M B E R O F A D D R E S S E S R E G I S T E R S T Y P E S O

More information

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. 8086 Microprocessor Microprocessor Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions. It is used as CPU (Central Processing Unit) in computers.

More information

CMSC Lecture 03. UMBC, CMSC313, Richard Chang

CMSC Lecture 03. UMBC, CMSC313, Richard Chang CMSC Lecture 03 Moore s Law Evolution of the Pentium Chip IA-32 Basic Execution Environment IA-32 General Purpose Registers Hello World in Linux Assembly Language Addressing Modes UMBC, CMSC313, Richard

More information

Introduction to Machine/Assembler Language

Introduction to Machine/Assembler Language COMP 40: Machine Structure and Assembly Language Programming Fall 2017 Introduction to Machine/Assembler Language Noah Mendelsohn Tufts University Email: noah@cs.tufts.edu Web: http://www.cs.tufts.edu/~noah

More information

The Instruction Set. Chapter 5

The Instruction Set. Chapter 5 The Instruction Set Architecture Level(ISA) Chapter 5 1 ISA Level The ISA level l is the interface between the compilers and the hardware. (ISA level code is what a compiler outputs) 2 Memory Models An

More information

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 2: IA-32 Processor Architecture Included elements of the IA-64 bit

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 2: IA-32 Processor Architecture Included elements of the IA-64 bit Assembly Language for Intel-Based Computers, 4 th Edition Kip R. Irvine Chapter 2: IA-32 Processor Architecture Included elements of the IA-64 bit Slides prepared by Kip R. Irvine Revision date: 09/25/2002

More information

Chapter 3: Addressing Modes

Chapter 3: Addressing Modes Chapter 3: Addressing Modes Chapter 3 Addressing Modes Note: Adapted from (Author Slides) Instructor: Prof. Dr. Khalid A. Darabkh 2 Introduction Efficient software development for the microprocessor requires

More information

IA32 Intel 32-bit Architecture

IA32 Intel 32-bit Architecture 1 2 IA32 Intel 32-bit Architecture Intel 32-bit Architecture (IA32) 32-bit machine CISC: 32-bit internal and external data bus 32-bit external address bus 8086 general registers extended to 32 bit width

More information

The x86 Architecture. ICS312 - Spring 2018 Machine-Level and Systems Programming. Henri Casanova

The x86 Architecture. ICS312 - Spring 2018 Machine-Level and Systems Programming. Henri Casanova The x86 Architecture ICS312 - Spring 2018 Machine-Level and Systems Programming Henri Casanova (henric@hawaii.edu) The 80x86 Architecture! To learn assembly programming we need to pick a processor family

More information

Q1: Multiple choice / 20 Q2: Memory addressing / 40 Q3: Assembly language / 40 TOTAL SCORE / 100

Q1: Multiple choice / 20 Q2: Memory addressing / 40 Q3: Assembly language / 40 TOTAL SCORE / 100 16.317: Microprocessor-Based Systems I Summer 2012 Exam 1 July 20, 2012 Name: ID #: For this exam, you may use a calculator and one 8.5 x 11 double-sided page of notes. All other electronic devices (e.g.,

More information

A4 Sample Solution Ch3

A4 Sample Solution Ch3 A4 Sample Solution Ch3 2. AL, AH, BL, BH,CL,CH,DLl, DH 3. AX, BX, CX, DX, SP, BP, SI, DI, CS, DS, ES, SS, FS, GS 4. EAX, EBX, ECX, EDX, ESP, EBP, EDI, ESI 5. RAX, RBX, RCX, RDX, RSP, RBP, RSI, RDI and

More information

Credits and Disclaimers

Credits and Disclaimers Credits and Disclaimers 1 The examples and discussion in the following slides have been adapted from a variety of sources, including: Chapter 3 of Computer Systems 3 nd Edition by Bryant and O'Hallaron

More information

8086 INTERNAL ARCHITECTURE

8086 INTERNAL ARCHITECTURE 8086 INTERNAL ARCHITECTURE Segment 2 Intel 8086 Microprocessor The 8086 CPU is divided into two independent functional parts: a) The Bus interface unit (BIU) b) Execution Unit (EU) Dividing the work between

More information

History of the Intel 80x86

History of the Intel 80x86 Intel s IA-32 Architecture Cptr280 Dr Curtis Nelson History of the Intel 80x86 1971 - Intel invents the microprocessor, the 4004 1975-8080 introduced 8-bit microprocessor 1978-8086 introduced 16 bit microprocessor

More information

Intel 8086 MICROPROCESSOR. By Y V S Murthy

Intel 8086 MICROPROCESSOR. By Y V S Murthy Intel 8086 MICROPROCESSOR By Y V S Murthy 1 Features It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 2 20 memory locations (1 MB). It can support up to 64K I/O ports. It provides 14,

More information

RISC I from Berkeley. 44k Transistors 1Mhz 77mm^2

RISC I from Berkeley. 44k Transistors 1Mhz 77mm^2 The Case for RISC RISC I from Berkeley 44k Transistors 1Mhz 77mm^2 2 MIPS: A Classic RISC ISA Instructions 4 bytes (32 bits) 4-byte aligned Instructions operate on memory and registers Memory Data types

More information

Intel 8086 MICROPROCESSOR ARCHITECTURE

Intel 8086 MICROPROCESSOR ARCHITECTURE Intel 8086 MICROPROCESSOR ARCHITECTURE 1 Features It is a 16-bit μp. 8086 has a 20 bit address bus can access up to 2 20 memory locations (1 MB). It can support up to 64K I/O ports. It provides 14, 16

More information

MACHINE-LEVEL PROGRAMMING I: BASICS COMPUTER ARCHITECTURE AND ORGANIZATION

MACHINE-LEVEL PROGRAMMING I: BASICS COMPUTER ARCHITECTURE AND ORGANIZATION MACHINE-LEVEL PROGRAMMING I: BASICS COMPUTER ARCHITECTURE AND ORGANIZATION Today: Machine Programming I: Basics History of Intel processors and architectures C, assembly, machine code Assembly Basics:

More information

Interfacing Compiler and Hardware. Computer Systems Architecture. Processor Types And Instruction Sets. What Instructions Should A Processor Offer?

Interfacing Compiler and Hardware. Computer Systems Architecture. Processor Types And Instruction Sets. What Instructions Should A Processor Offer? Interfacing Compiler and Hardware Computer Systems Architecture FORTRAN 90 program C++ program Processor Types And Sets FORTRAN 90 Compiler C++ Compiler set level Hardware 1 2 What s Should A Processor

More information

Introduction to Microprocessor

Introduction to Microprocessor Introduction to Microprocessor The microprocessor is a general purpose programmable logic device. It is the brain of the computer and it performs all the computational tasks, calculations data processing

More information

Reverse Engineering II: The Basics

Reverse Engineering II: The Basics Reverse Engineering II: The Basics This document is only to be distributed to teachers and students of the Malware Analysis and Antivirus Technologies course and should only be used in accordance with

More information

Memory Models. Registers

Memory Models. Registers Memory Models Most machines have a single linear address space at the ISA level, extending from address 0 up to some maximum, often 2 32 1 bytes or 2 64 1 bytes. Some machines have separate address spaces

More information

CC411: Introduction To Microprocessors

CC411: Introduction To Microprocessors CC411: Introduction To Microprocessors OBJECTIVES this chapter enables the student to: Describe the Intel family of microprocessors from 8085 to Pentium. In terms of bus size, physical memory & special

More information

Machine-level Representation of Programs. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Machine-level Representation of Programs. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Machine-level Representation of Programs Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Program? 짬뽕라면 준비시간 :10 분, 조리시간 :10 분 재료라면 1개, 스프 1봉지, 오징어

More information

Computer System Architecture

Computer System Architecture CSC 203 1.5 Computer System Architecture Department of Statistics and Computer Science University of Sri Jayewardenepura Instruction Set Architecture (ISA) Level 2 Introduction 3 Instruction Set Architecture

More information

EC-333 Microprocessor and Interfacing Techniques

EC-333 Microprocessor and Interfacing Techniques EC-333 Microprocessor and Interfacing Techniques Lecture 3 The Microprocessor and its Architecture Dr Hashim Ali Fall - 2018 Department of Computer Science and Engineering HITEC University Taxila Slides

More information

1. Introduction to Assembly Language

1. Introduction to Assembly Language www.vchowk.com 1. Introduction to Assembly Language Solved EXERCISE 1 Note: Dear fellows I tried my best to solve this exercise questions if there s any mistake or doubt in any question correct it and

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 03, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 03, SPRING 2013 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 03, SPRING 2013 TOPICS TODAY Moore s Law Evolution of Intel CPUs IA-32 Basic Execution Environment IA-32 General Purpose Registers

More information

Practical Malware Analysis

Practical Malware Analysis Practical Malware Analysis Ch 4: A Crash Course in x86 Disassembly Revised 1-16-7 Basic Techniques Basic static analysis Looks at malware from the outside Basic dynamic analysis Only shows you how the

More information

16.317: Microprocessor Systems Design I Fall 2013

16.317: Microprocessor Systems Design I Fall 2013 16.317: Microprocessor Systems Design I Fall 2013 Exam 1 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

Assembly Language. Lecture 2 - x86 Processor Architecture. Ahmed Sallam

Assembly Language. Lecture 2 - x86 Processor Architecture. Ahmed Sallam Assembly Language Lecture 2 - x86 Processor Architecture Ahmed Sallam Introduction to the course Outcomes of Lecture 1 Always check the course website Don t forget the deadline rule!! Motivations for studying

More information

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-11: 80x86 Architecture

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-11: 80x86 Architecture ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-11: 80x86 Architecture 1 The 80x86 architecture processors popular since its application in IBM PC (personal computer). 2 First Four generations

More information

IA-32 Architecture COE 205. Computer Organization and Assembly Language. Computer Engineering Department

IA-32 Architecture COE 205. Computer Organization and Assembly Language. Computer Engineering Department IA-32 Architecture COE 205 Computer Organization and Assembly Language Computer Engineering Department King Fahd University of Petroleum and Minerals Presentation Outline Basic Computer Organization Intel

More information

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2018 Lecture 4

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2018 Lecture 4 CS24: INTRODUCTION TO COMPUTING SYSTEMS Spring 2018 Lecture 4 LAST TIME Enhanced our processor design in several ways Added branching support Allows programs where work is proportional to the input values

More information

CHAPTER 3 BASIC EXECUTION ENVIRONMENT

CHAPTER 3 BASIC EXECUTION ENVIRONMENT CHAPTER 3 BASIC EXECUTION ENVIRONMENT This chapter describes the basic execution environment of an Intel 64 or I A-32 processor as seen by assemblylanguage programmers. It describes how the processor executes

More information

16-Bit Intel Processor Architecture

16-Bit Intel Processor Architecture IBM-PC Organization 16-Bit Intel Processor Architecture A-16 bit microprocessor can operate on 16 bits of data at a time. 8086/8088 have the simplest structure 8086/8088 have the same instruction set,

More information

Microcomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات

Microcomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات 1) Input/output In computing, input/output or I/O, is the communication between an information processing system (such as a computer) and the outside world, possibly a human or another information processing

More information

Computer Architecture 1 ح 303

Computer Architecture 1 ح 303 Lecture 4 A. Addressing MODES 1. Introduction to assembly language programming: Program is a sequence of commands used to tell a microcomputer what to do. Each command in a program is an instruction Programs

More information

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy Digital Logic Design Ch1-1 8086 Microprocessor Features: The 8086 microprocessor is a 16 bit microprocessor. The term 16 bit means

More information

Lab 2: Introduction to Assembly Language Programming

Lab 2: Introduction to Assembly Language Programming COE 205 Lab Manual Lab 2: Introduction to Assembly Language Programming - page 16 Lab 2: Introduction to Assembly Language Programming Contents 2.1. Intel IA-32 Processor Architecture 2.2. Basic Program

More information

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College February 9, 2016

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College February 9, 2016 CS 31: Intro to Systems ISAs and Assembly Kevin Webb Swarthmore College February 9, 2016 Reading Quiz Overview How to directly interact with hardware Instruction set architecture (ISA) Interface between

More information

9/25/ Software & Hardware Architecture

9/25/ Software & Hardware Architecture 8086 Software & Hardware Architecture 1 INTRODUCTION It is a multipurpose programmable clock drive register based integrated electronic device, that reads binary instructions from a storage device called

More information

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College September 25, 2018

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College September 25, 2018 CS 31: Intro to Systems ISAs and Assembly Kevin Webb Swarthmore College September 25, 2018 Overview How to directly interact with hardware Instruction set architecture (ISA) Interface between programmer

More information

Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998

Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998 Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998 Assembler Syntax Everything looks like this: label: instruction dest,src instruction label Comments: comment $ This is a comment

More information

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers. Lecture 5: Computer Organization Instruction Execution Computer Organization Addressing Buses Fetch-Execute Cycle Computer Organization CPU Control Unit U Input Output Memory Components Control Unit fetches

More information

Assembly Language. Lecture 2 x86 Processor Architecture

Assembly Language. Lecture 2 x86 Processor Architecture Assembly Language Lecture 2 x86 Processor Architecture Ahmed Sallam Slides based on original lecture slides by Dr. Mahmoud Elgayyar Introduction to the course Outcomes of Lecture 1 Always check the course

More information

Moodle WILLINGDON COLLEGE SANGLI (B. SC.-II) Digital Electronics

Moodle WILLINGDON COLLEGE SANGLI (B. SC.-II) Digital Electronics Moodle 4 WILLINGDON COLLEGE SANGLI (B. SC.-II) Digital Electronics Advanced Microprocessors and Introduction to Microcontroller Moodle developed By Dr. S. R. Kumbhar Department of Electronics Willingdon

More information

Assembly Language Programming Introduction

Assembly Language Programming Introduction Assembly Language Programming Introduction October 10, 2017 Motto: R7 is used by the processor as its program counter (PC). It is recommended that R7 not be used as a stack pointer. Source: PDP-11 04/34/45/55

More information

X86 Addressing Modes Chapter 3" Review: Instructions to Recognize"

X86 Addressing Modes Chapter 3 Review: Instructions to Recognize X86 Addressing Modes Chapter 3" Review: Instructions to Recognize" 1 Arithmetic Instructions (1)! Two Operand Instructions" ADD Dest, Src Dest = Dest + Src SUB Dest, Src Dest = Dest - Src MUL Dest, Src

More information

x86 Assembly Tutorial COS 318: Fall 2017

x86 Assembly Tutorial COS 318: Fall 2017 x86 Assembly Tutorial COS 318: Fall 2017 Project 1 Schedule Design Review: Monday 9/25 Sign up for 10-min slot from 3:00pm to 7:00pm Complete set up and answer posted questions (Official) Precept: Monday

More information

CS241 Computer Organization Spring 2015 IA

CS241 Computer Organization Spring 2015 IA CS241 Computer Organization Spring 2015 IA-32 2-10 2015 Outline! Review HW#3 and Quiz#1! More on Assembly (IA32) move instruction (mov) memory address computation arithmetic & logic instructions (add,

More information

Assembly Language for x86 Processors 7 th Edition. Chapter 2: x86 Processor Architecture

Assembly Language for x86 Processors 7 th Edition. Chapter 2: x86 Processor Architecture Assembly Language for x86 Processors 7 th Edition Kip Irvine Chapter 2: x86 Processor Architecture Slides prepared by the author Revision date: 1/15/2014 (c) Pearson Education, 2015. All rights reserved.

More information

Machine/Assembler Language Putting It All Together

Machine/Assembler Language Putting It All Together COMP 40: Machine Structure and Assembly Language Programming Fall 2015 Machine/Assembler Language Putting It All Together Noah Mendelsohn Tufts University Email: noah@cs.tufts.edu Web: http://www.cs.tufts.edu/~noah

More information

Assembly level Programming. 198:211 Computer Architecture. (recall) Von Neumann Architecture. Simplified hardware view. Lecture 10 Fall 2012

Assembly level Programming. 198:211 Computer Architecture. (recall) Von Neumann Architecture. Simplified hardware view. Lecture 10 Fall 2012 19:211 Computer Architecture Lecture 10 Fall 20 Topics:Chapter 3 Assembly Language 3.2 Register Transfer 3. ALU 3.5 Assembly level Programming We are now familiar with high level programming languages

More information

x86 64 Programming I CSE 351 Autumn 2018 Instructor: Justin Hsia

x86 64 Programming I CSE 351 Autumn 2018 Instructor: Justin Hsia x86 64 Programming I CSE 351 Autumn 2018 Instructor: Justin Hsia Teaching Assistants: Akshat Aggarwal An Wang Andrew Hu Brian Dai Britt Henderson James Shin Kevin Bi Kory Watson Riley Germundson Sophie

More information

System calls and assembler

System calls and assembler System calls and assembler Michal Sojka sojkam1@fel.cvut.cz ČVUT, FEL License: CC-BY-SA 4.0 System calls (repetition from lectures) A way for normal applications to invoke operating system (OS) kernel's

More information

Real instruction set architectures. Part 2: a representative sample

Real instruction set architectures. Part 2: a representative sample Real instruction set architectures Part 2: a representative sample Some historical architectures VAX: Digital s line of midsize computers, dominant in academia in the 70s and 80s Characteristics: Variable-length

More information

Microprocessor (COM 9323)

Microprocessor (COM 9323) Microprocessor (COM 9323) Lecture 3: The Microprocessor and Its Architecture Ahmed Elnakib, PhD Assistant Professor, Mansoura University, Egypt Feb 24 th, 2016 1 Text Book/References* Textbook: The Intel

More information

Systems Architecture I

Systems Architecture I Systems Architecture I Topics Assemblers, Linkers, and Loaders * Alternative Instruction Sets ** *This lecture was derived from material in the text (sec. 3.8-3.9). **This lecture was derived from material

More information

Assembly Language Lab # 9

Assembly Language Lab # 9 Faculty of Engineering Computer Engineering Department Islamic University of Gaza 2011 Assembly Language Lab # 9 Stacks and Subroutines Eng. Doaa Abu Jabal Assembly Language Lab # 9 Stacks and Subroutines

More information

Instruction Set Architectures

Instruction Set Architectures Instruction Set Architectures ISAs Brief history of processors and architectures C, assembly, machine code Assembly basics: registers, operands, move instructions 1 What should the HW/SW interface contain?

More information