Microprocessor and Assembly Language Lecture 1 PDF

Document Details

FasterHeliotrope3120

Uploaded by FasterHeliotrope3120

Rabea Saleem

Tags

microprocessor assembly language computer organization programming

Summary

This lecture introduces microprocessor and assembly language, explaining assembly language as a low-level programming language. It also covers fundamental concepts like registers and flags, highlighting how they support arithmetic and data transfer.

Full Transcript

COURSE: Microprocessor and Assembly Language INSTRUCTOR NAME: Rabea Saleem Lecture1: Computer Organization and Assembly Lang Agenda Introduction What is Assembly Language? Why Assembly? Basic Concepts Registers General-Purpose...

COURSE: Microprocessor and Assembly Language INSTRUCTOR NAME: Rabea Saleem Lecture1: Computer Organization and Assembly Lang Agenda Introduction What is Assembly Language? Why Assembly? Basic Concepts Registers General-Purpose Registers Segment Registers EFLAGS Register Status Flag What is Assembly An assembly language is a low-level programming language for a compute or other programmable device. language is converted into executable machine code by a utility Assembly program referred to as an assembler. Popular assemblers are: TASM(Turbo Assembler from Borland) NASM (Netwide Assembler for both Windows and Linux), and GNU assembler distributer by the free software foundation Compiler and Assembler Why Assembly? ( Example) Why Assembly? An understanding of assembly language provides knowledge of: Interface of programs with OS, processor and BIOS. Representation of data in memory and other external devices. How processor accesses and executes instruction. instructions accesses and process data How It requires less memory and execution time PC Hardware internal hardware of a PC consists of the processor, memory and The main the registers. The registers are processor components that hold data and address. a program the system copies it from the external device into th To execute internal memory. The processor executes the program instructions Data Size The processor supports the following data sizes: Word: a 2-byte data item word: a 4-byte (32 bit) data item Double word: an 8-byte (64 bit) data item Quad Paragraph: a 16-byte (128 bit) area Instruction executions Fetching the instruction from memory Decoding or identifying the instruction Executing the instruction Instruction Fields Registers Registers are high-speed storage locations directly inside the CPU, designe to be accessed at much higher speed than conventional memory. are eight general-purpose registers There segment registers Six Processor status flags register (EFLAGS) Instruction pointer (EIP). Registers General-purpose registers The general-purpose registers are primarily used for arithmetic and data movement. General-purpose registers General-purpose registers Some general-purpose registers have specialized uses: EAX is automatically used by multiplication and division instructions. It is often called the extended accumulator register. The CPU automatically uses ECX as a loop counter. ESP addresses data on the stack. It is rarely used for ordinary arithmetic or data transfer. It is often called the extended stack pointer register. ESI and EDI are used by high-speed memory transfer instructions. They are sometim called the extended source index and extended destination index registers. Instruction Pointer or instruction pointer, register contains the address of the next The EIP, instruction to be executed. EFLAGS Register The EFLAGS (or just Flags) register consists of individual binary bits that control the operation of the CPU or reflect the outcome of some CPU Operation Status Flags flags reflect the outcomes of arithmetic and logical operations The Status performed by the CPU. They are the Overflow, Sign, Zero, Auxiliary Carry, Parity, and Carry flags. Status Flags The Carry flag (CF) is set when the result of an unsigned arithmetic operation is too large fit into the destination. The Overflow flag (OF) is set when the result of a signed arithmetic operation is too large too small to fit into the destination. The Sign flag (SF) is set when the result of an arithmetic or logical operation generates a negative result. The Zero flag (ZF) is set when the result of an arithmetic or logical operation generates a result of zero. The Auxiliary Carry flag (AC) is set when an arithmetic operation causes a carry from bit 3 bit 4 in an 8-bit operand. The Parity flag In general, it is used for error checking when there is a possibility that data might be altered or corrupted. What is the application of Assembly Languag THANK YOU.

Use Quizgecko on...
Browser
Browser