The document discusses various types of operands and addressing modes in x86 assembly language. It describes three basic operand types: immediate, register, and memory. It covers different addressing modes for accessing memory operands, including direct, register indirect, indexed, based, and based-indexed addressing. Examples are provided to illustrate how to copy a string and sum elements of an array using these addressing modes. Key registers used for 32-bit and 16-bit memory addressing are also outlined.
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Bilal Amjad
This document discusses one-dimensional and two-dimensional arrays in assembly language. It covers topics such as:
- Declaring and initializing one-dimensional arrays
- Addressing individual elements using offsets from the base address
- Common addressing modes like register indirect, based, indexed, and based indexed to access array elements
- Storing two-dimensional arrays in row-major or column-major order and calculating element addresses
- Code examples to sum elements of a one-dimensional array and clear a row or column of a two-dimensional array
Binary and hex input/output (in 8086 assembuly langyage)Bilal Amjad
This document discusses binary and hexadecimal input/output algorithms. It contains pseudocode to convert character input into binary representations in a register and output binary values as characters. For binary input, each '0' or '1' character is converted and shifted left into a register. For hexadecimal input, characters are converted and shifted left by 4 bits into a register. To output, the register is rotated right and each 4-bit value is converted to a character.
assembly language programming organization of IBM PC chapter 9 part-1(MULTIPL...Bilal Amjad
This document contains presentation slides on bit shifting, multiplication, division, and their implementation in assembly language. It discusses:
- Using left and right bit shifts to perform multiplication and division by powers of 2
- The different instructions for signed vs unsigned multiplication and division (MUL, IMUL, DIV, IDIV)
- How multiplication and division results are stored in registers
- Examples of multiplying and dividing word and byte variables in assembly code
chapter 7 Logic, shift and rotate instructionswarda aziz
this is a solution to exercise of chapter 7 from Assembly language programming and organization of the IBM PC.
If you find any mistakes in my solution , please discuss with me. as i am also a human and can do mistakes.
This document provides an introduction to 8086 assembly language programming. It discusses machine code and assembly language, compilers and assemblers, general purpose registers, simple commands, number formats, jumps, labels, logical and shift instructions, and instructions that affect memory. The key points are that assembly language provides a lower-level programming interface than high-level languages, manages memory and registers directly, and uses mnemonics that are assembled into machine code.
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Bilal Amjad
This document discusses one-dimensional and two-dimensional arrays in assembly language. It covers topics such as:
- Declaring and initializing one-dimensional arrays
- Addressing individual elements using offsets from the base address
- Common addressing modes like register indirect, based, indexed, and based indexed to access array elements
- Storing two-dimensional arrays in row-major or column-major order and calculating element addresses
- Code examples to sum elements of a one-dimensional array and clear a row or column of a two-dimensional array
Binary and hex input/output (in 8086 assembuly langyage)Bilal Amjad
This document discusses binary and hexadecimal input/output algorithms. It contains pseudocode to convert character input into binary representations in a register and output binary values as characters. For binary input, each '0' or '1' character is converted and shifted left into a register. For hexadecimal input, characters are converted and shifted left by 4 bits into a register. To output, the register is rotated right and each 4-bit value is converted to a character.
assembly language programming organization of IBM PC chapter 9 part-1(MULTIPL...Bilal Amjad
This document contains presentation slides on bit shifting, multiplication, division, and their implementation in assembly language. It discusses:
- Using left and right bit shifts to perform multiplication and division by powers of 2
- The different instructions for signed vs unsigned multiplication and division (MUL, IMUL, DIV, IDIV)
- How multiplication and division results are stored in registers
- Examples of multiplying and dividing word and byte variables in assembly code
chapter 7 Logic, shift and rotate instructionswarda aziz
this is a solution to exercise of chapter 7 from Assembly language programming and organization of the IBM PC.
If you find any mistakes in my solution , please discuss with me. as i am also a human and can do mistakes.
This document provides an introduction to 8086 assembly language programming. It discusses machine code and assembly language, compilers and assemblers, general purpose registers, simple commands, number formats, jumps, labels, logical and shift instructions, and instructions that affect memory. The key points are that assembly language provides a lower-level programming interface than high-level languages, manages memory and registers directly, and uses mnemonics that are assembled into machine code.
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...warda aziz
this pdf covers solution to chapter 8 and 9 of assembly language and organization of the IBM PC. if you find any mistakes in my writing , please disccuss with me.
This document provides an outline for a course on 8086 Assembly Language Programming. It begins with an introduction to machine language and assembly language. It then covers topics like the organization of the 8086 processor, assembly language syntax, data representation, variables, instruction types, memory segmentation, program structure, addressing modes, and input/output. The document is intended to guide students through the key concepts needed to program in 8086 assembly language.
The document discusses the 8088 microprocessor hardware configuration. It describes the 8088 chip, which contains the microprocessing unit (MPU), and external memory. The 8088 has three buses - control bus, data bus with 8 lines, and address bus with 20 lines. This allows it to access up to 1,048,576 memory locations, with each location being 8 bits. The document then provides an example assembly language program to initialize memory location 00002 with the value 3F. It explains that memory segmentation is used to access memory locations beyond 0000-FFFF, through the use of segment registers like DS which specify the memory segment.
This document describes 16 assembly language programs for the 8086 microprocessor. It includes programs that increment/decrement 8-bit and 16-bit numbers, take the 1's and 2's complement of numbers, add/subtract/multiply/divide 8-bit and 16-bit numbers, and manipulate strings. It also discusses the use of procedures, stacks, and macros in 8086 assembly language programming. Examples are provided to illustrate how to define and call procedures, use push/pop on the stack, and define macros with parameters.
The document provides information about the instruction sets of the 8086 microprocessor. It defines what an instruction set is and describes the different instruction formats used by the 8086. The main types of 8086 instructions are then outlined, including data transfer instructions, arithmetic instructions, bit manipulation instructions, branch instructions, and others. Specific instructions like MOV, ADD, SUB, and MUL are explained through examples of their syntax and operation.
The document discusses the instruction set of the 8086 microprocessor. It describes the different types of instructions including data transfer, arithmetic, logic, shift/rotate, branch, loop, and string instructions. It provides details on common instructions like MOV, ADD, SUB, MUL, DIV, CMP, INC, DEC, NEG, CBW and CWD. Examples of assembly language programs are given to perform operations like addition, subtraction, multiplication, division, comparison etc. of 8-bit, 16-bit and 32-bit numbers.
INC and DEC Instructions
ADD Instruction
SUB Instruction
NEG Instruction
Implementing Arithmetic Expressions
Flags Affected by Addition and Subtraction
Example Program (AddSub3)
1) The document is an introduction to 8086 assembly language and provides information on 8086 architecture including registers, memory access, variables, arrays, and instructions like MOV.
2) It explains the main components of a computer like the CPU, RAM, and system bus and describes the different types of registers in the 8086 including general purpose, segment, and special purpose registers.
3) The tutorial provides examples of using directives, variables, memory addressing modes, and instructions like MOV to demonstrate basic 8086 programming concepts.
The document discusses the DAA and DAS instructions in microprocessors. DAA is used after addition instructions to adjust the result into valid BCD format. DAS performs similarly for subtraction instructions. Both affect flags and the implied AL register, adjusting digits if needed to account for decimal carries or borrows. Examples are provided demonstrating their use after addition and subtraction of packed BCD values.
This document provides an overview of assembly language programming on the 8086 processor. It includes examples of assembly code using MOV, MUL, and other instructions. It then summarizes various 8086 instruction types like data transfer, arithmetic, logical, and control flow instructions. For each type, it lists some common instructions and provides brief descriptions and examples.
Here are the steps to solve this problem:
1. Display a '?' to prompt the user for the first number
2. Read the first number into AL
3. Display a '+' and another '?' to prompt for the second number
4. Read the second number into BL
5. Add AL and BL and store the result in CL
6. Display the message "THE SUM OF"
7. Display the first number stored in AL
8. Display " AND "
9. Display the second number stored in BL
10. Display " IS "
11. Display the result stored in CL
Main ENDP
END Main
This document contains solutions to 12 questions related to assembly language programming and flow control instructions. The questions cover a range of topics including IF-THEN-ELSE logic, loops, arithmetic operations, character input/output, and string manipulation. Detailed assembly code solutions are provided for each question involving decision structures, loops, arithmetic sequences, reading/displaying characters, and finding the longest consecutive alphabetically increasing substring in a string.
The document discusses the instruction set of the 8086 microprocessor. It describes that the 8086 has over 20,000 instructions that are classified into several categories like data transfer, arithmetic, bit manipulation, program execution transfer, and string instructions. Under each category, it provides details about specific instructions like MOV, ADD, AND, CALL, etc. and explains their functionality and operand usage.
The document discusses different addressing modes used in computer instructions. It explains that the addressing mode specifies how the operands are chosen during program execution. Some key addressing modes are direct, indirect, register, register indirect, and relative addressing. The addressing mode determines the effective address, which is the actual memory location of the operand.
Memory reference instructions used in computer architecture is well demonstrated with examples. It will probably help you understand each referencing instructions.
The document discusses string operations in 8086 assembly language. String operations allow copying, searching, storing, and comparing strings of characters in memory. The direction flag (DF) determines whether string operations proceed from left to right or right to left. Instructions like MOVSB, STOSB, LODSB, CMPSB operate on bytes or words in strings and update index registers accordingly based on the DF value. Examples demonstrate using these instructions to copy, store, load, compare, and search strings.
Introduction to ibm pc assembly languagewarda aziz
The Solution manual of COAL
Chapter NO 4. exercise
if anyone has Questions Regarding this exercise.
contact me on my given Email-ID.
i will guide you. Thank you!
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...warda aziz
this pdf covers solution to chapter 8 and 9 of assembly language and organization of the IBM PC. if you find any mistakes in my writing , please disccuss with me.
This document provides an outline for a course on 8086 Assembly Language Programming. It begins with an introduction to machine language and assembly language. It then covers topics like the organization of the 8086 processor, assembly language syntax, data representation, variables, instruction types, memory segmentation, program structure, addressing modes, and input/output. The document is intended to guide students through the key concepts needed to program in 8086 assembly language.
The document discusses the 8088 microprocessor hardware configuration. It describes the 8088 chip, which contains the microprocessing unit (MPU), and external memory. The 8088 has three buses - control bus, data bus with 8 lines, and address bus with 20 lines. This allows it to access up to 1,048,576 memory locations, with each location being 8 bits. The document then provides an example assembly language program to initialize memory location 00002 with the value 3F. It explains that memory segmentation is used to access memory locations beyond 0000-FFFF, through the use of segment registers like DS which specify the memory segment.
This document describes 16 assembly language programs for the 8086 microprocessor. It includes programs that increment/decrement 8-bit and 16-bit numbers, take the 1's and 2's complement of numbers, add/subtract/multiply/divide 8-bit and 16-bit numbers, and manipulate strings. It also discusses the use of procedures, stacks, and macros in 8086 assembly language programming. Examples are provided to illustrate how to define and call procedures, use push/pop on the stack, and define macros with parameters.
The document provides information about the instruction sets of the 8086 microprocessor. It defines what an instruction set is and describes the different instruction formats used by the 8086. The main types of 8086 instructions are then outlined, including data transfer instructions, arithmetic instructions, bit manipulation instructions, branch instructions, and others. Specific instructions like MOV, ADD, SUB, and MUL are explained through examples of their syntax and operation.
The document discusses the instruction set of the 8086 microprocessor. It describes the different types of instructions including data transfer, arithmetic, logic, shift/rotate, branch, loop, and string instructions. It provides details on common instructions like MOV, ADD, SUB, MUL, DIV, CMP, INC, DEC, NEG, CBW and CWD. Examples of assembly language programs are given to perform operations like addition, subtraction, multiplication, division, comparison etc. of 8-bit, 16-bit and 32-bit numbers.
INC and DEC Instructions
ADD Instruction
SUB Instruction
NEG Instruction
Implementing Arithmetic Expressions
Flags Affected by Addition and Subtraction
Example Program (AddSub3)
1) The document is an introduction to 8086 assembly language and provides information on 8086 architecture including registers, memory access, variables, arrays, and instructions like MOV.
2) It explains the main components of a computer like the CPU, RAM, and system bus and describes the different types of registers in the 8086 including general purpose, segment, and special purpose registers.
3) The tutorial provides examples of using directives, variables, memory addressing modes, and instructions like MOV to demonstrate basic 8086 programming concepts.
The document discusses the DAA and DAS instructions in microprocessors. DAA is used after addition instructions to adjust the result into valid BCD format. DAS performs similarly for subtraction instructions. Both affect flags and the implied AL register, adjusting digits if needed to account for decimal carries or borrows. Examples are provided demonstrating their use after addition and subtraction of packed BCD values.
This document provides an overview of assembly language programming on the 8086 processor. It includes examples of assembly code using MOV, MUL, and other instructions. It then summarizes various 8086 instruction types like data transfer, arithmetic, logical, and control flow instructions. For each type, it lists some common instructions and provides brief descriptions and examples.
Here are the steps to solve this problem:
1. Display a '?' to prompt the user for the first number
2. Read the first number into AL
3. Display a '+' and another '?' to prompt for the second number
4. Read the second number into BL
5. Add AL and BL and store the result in CL
6. Display the message "THE SUM OF"
7. Display the first number stored in AL
8. Display " AND "
9. Display the second number stored in BL
10. Display " IS "
11. Display the result stored in CL
Main ENDP
END Main
This document contains solutions to 12 questions related to assembly language programming and flow control instructions. The questions cover a range of topics including IF-THEN-ELSE logic, loops, arithmetic operations, character input/output, and string manipulation. Detailed assembly code solutions are provided for each question involving decision structures, loops, arithmetic sequences, reading/displaying characters, and finding the longest consecutive alphabetically increasing substring in a string.
The document discusses the instruction set of the 8086 microprocessor. It describes that the 8086 has over 20,000 instructions that are classified into several categories like data transfer, arithmetic, bit manipulation, program execution transfer, and string instructions. Under each category, it provides details about specific instructions like MOV, ADD, AND, CALL, etc. and explains their functionality and operand usage.
The document discusses different addressing modes used in computer instructions. It explains that the addressing mode specifies how the operands are chosen during program execution. Some key addressing modes are direct, indirect, register, register indirect, and relative addressing. The addressing mode determines the effective address, which is the actual memory location of the operand.
Memory reference instructions used in computer architecture is well demonstrated with examples. It will probably help you understand each referencing instructions.
The document discusses string operations in 8086 assembly language. String operations allow copying, searching, storing, and comparing strings of characters in memory. The direction flag (DF) determines whether string operations proceed from left to right or right to left. Instructions like MOVSB, STOSB, LODSB, CMPSB operate on bytes or words in strings and update index registers accordingly based on the DF value. Examples demonstrate using these instructions to copy, store, load, compare, and search strings.
Introduction to ibm pc assembly languagewarda aziz
The Solution manual of COAL
Chapter NO 4. exercise
if anyone has Questions Regarding this exercise.
contact me on my given Email-ID.
i will guide you. Thank you!
This document discusses different addressing modes used in the 8051 microcontroller architecture, including immediate, direct, register, and indirect addressing modes. Immediate addressing encodes the data as part of the instruction itself. Direct addressing retrieves data directly from another memory location. Register addressing uses register names as part of the opcode. Indirect addressing provides flexibility by allowing the contents of a register to specify the memory location of the operand.
The document discusses various linear data structures like arrays, strings, stacks, queues, and linked lists. It provides details on representing single and multi-dimensional arrays, including addressing formulas. Operations on ordered lists like lists are defined. Linear lists using arrays are implemented with methods for adding, removing, and changing elements.
Microprocessor Protected Mode Memory addressing By DHEERAJ KATARIADheeraj Kataria
The document discusses protected mode memory addressing in microprocessors. It describes how protected mode allows access to 4GB of memory using 32-bit offsets and segment descriptors. Segment descriptors stored in global and local descriptor tables define memory segment locations, lengths, and access rights. Operating systems like Windows use protected mode and 32-bit environments while DOS uses 16-bit. The microprocessor caches descriptor information from the tables in program-invisible registers associated with segment registers to efficiently access memory segments.
The document discusses arrays in data structures using C programming language. It defines what an array is and describes different types of arrays like one-dimensional, two-dimensional, and multi-dimensional arrays. It also explains array operations such as insertion, deletion, traversal, reversing, sorting, and searching. Additionally, it covers merging of arrays, arrays of pointers, and using arrays to represent polynomials.
Huffman coding is a coding technique for lossless compression of data base based upon the frequency of occurance of a symbol in that file.
In huffman coding every Data is based upon 0’s and 1’s which reduces the size of file.
Using binary representation, the number of bits required to represent each character depends upon the number of characters that have to be represented. Using one bit we can represent two characters, i.e., 0 represents the first character and 1 represents the second character.
a graph search algorithm that solves the single-source shortest path problem for a graph with non-negative edge path costs, producing a shortest path tree. This algorithm is often used in routing and as a subroutine in other graph algorithms.
This document summarizes several disk scheduling algorithms used in operating systems to efficiently manage disk drive access. It describes the First Come First Served (FCFS), Shortest Seek Time First (SSTF), SCAN, C-SCAN, and C-LOOK algorithms. Each algorithm is illustrated with an example request queue to show how it would schedule and service the requests to minimize the total disk head movement and seek time. The document concludes by noting that SSTF and LOOK are commonly used default algorithms but performance depends on the workload, and different algorithms may perform better for systems with heavy disk loads.
The document discusses disk scheduling algorithms used by operating systems to efficiently access disk drives. It describes common algorithms like First Come First Served (FCFS), Shortest Seek Time First (SSTF), SCAN, C-SCAN, and C-LOOK. It also summarizes RAID levels which improve reliability and performance using multiple disks, and different methods for attaching disks like host attached, network attached storage, and storage area networks.
The document discusses fundamentals of assembly language including data types, operands, data transfer instructions like MOV, arithmetic instructions like ADD and SUB, and addressing modes. It provides examples of assembly language code to perform operations like copying a string, converting between Celsius and Fahrenheit, and using various addressing modes.
The document discusses various tree data structures and their terminology. It begins by defining a tree as a set of nodes connected in a parent-child relationship, with one root node and multiple disjoint subtree structures. Key terminology introduced includes root, child, parent, leaf nodes, siblings, ancestors, and height/depth. Binary trees are defined as having at most two children per node. Common traversal orders of trees - preorder, inorder, and postorder - are explained along with examples. Finally, algorithms for traversing binary trees using stacks are presented for preorder and inorder traversal.
This document discusses extendible hashing, which is a hashing technique for dynamic files that allows efficient insertion and deletion of records. It works by using a directory to map hash values to buckets, and dynamically expanding the directory size and number of buckets as needed to accommodate new records. When a bucket overflows, it is split into two buckets, and the directory is expanded to distinguish them. The directory size can also be contracted when buckets can be combined due to deletions. Alternative approaches like dynamic hashing and linear hashing that address the same problem of dynamic files are also overviewed.
The document discusses process management and the First Come First Serve (FCFS) CPU scheduling algorithm. It covers:
1) FCFS is the simplest scheduling algorithm that allocates the CPU to the process that requests it first. It is implemented using a FIFO queue where new processes are added to the tail.
2) FCFS can result in long waiting times for processes. An example is provided where the average waiting time is 17ms.
3) FCFS is non-preemptive and not suitable for time-sharing systems as it does not allow regular intervals of CPU allocation between users.
Representation of binary tree in memoryRohini Shinde
There are two ways to represent a binary tree in memory: sequential representation which uses a single linear array to store the tree, and linked representation which uses three parallel arrays (INFO, LEFT, and RIGHT) along with a ROOT pointer to link nodes. The sequential representation stores the root at index 0 of the array and children at calculated indices, while the linked representation stores the data, left child index, and right child index of each node in the parallel arrays.
Protected mode memory addressing allows access to memory above 1MB and uses segment descriptors to manage memory segments. The segment register contains a selector that indexes into a descriptor table, which describes a segment's location, length, and access permissions. Descriptors can define segments up to 4GB in size. Paging divides physical memory and disk storage into pages that are mapped to virtual addresses, allowing flexible and protected memory management.
The document defines and describes different types of arrays in C programming. It states that arrays can hold multiple values of the same data type and are used to store data in linear or tabular form. The key types discussed are one-dimensional, two-dimensional, and multi-dimensional arrays. It provides examples and explains how to declare, initialize, search and sort each array type.
a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together. A single graph can have many different spanning trees.
The document discusses CPU architecture types and organization. It covers the following key points in 3 sentences:
The CPU consists of 3 main components - the control unit, the arithmetic logic unit (ALU), and registers. Early CPUs were accumulator-based while modern CPUs use a register-based design with multiple registers to allow for shorter programs with limited instructions. CPU organization also includes register organization, data paths, stack organization using a stack pointer register, instruction formats, and various addressing modes to access operands in memory or registers.
This document discusses file handling in C++. It begins by explaining that files allow data to be stored permanently on secondary storage devices like hard disks, unlike variables in memory. It then covers key topics like:
- The different types of files, such as text files containing readable characters and binary files containing raw data.
- Classes used for file input/output like ifstream, ofstream, and fstream.
- Opening, closing, reading from, and writing to files using functions like open(), close(), get(), put(), seekg(), tellg(), seekp(), and tellp().
- File pointers that track read/write positions and functions to manipulate them.
- Examples of creating
The document discusses various addressing modes supported by Pentium processors including register, immediate, and memory addressing modes. It describes simple addressing modes like register and immediate, as well as different memory addressing modes like direct, indirect, based, indexed, and based-indexed addressing. Examples of using arrays and different addressing modes for operations like insertion sort and finding sums are also provided. Performance tests show benefits of supporting flexible addressing modes over just indirect addressing and benefits of using scale factors.
The document discusses assembly language instructions and directives. It explains that instructions tell the processor what to do and are assembled into machine code, while directives tell the assembler what to do and are not part of the instruction set. Common directives include EQU to define constants, and data definition directives like DB, DW and DD to define memory for data storage. The document also covers instruction operands like registers, immediates, and memory. It provides examples of basic instructions, and arithmetic instructions like ADD, SUB, MUL and DIV.
This document discusses assembly language string primitives instructions including MOVSx, CMPSx, SCANSx, STOSx, LODSx. It explains how these instructions use registers like ESI, EDI to operate on strings and arrays. Examples are provided to copy arrays, compare strings, find characters in strings, fill arrays, and multiply array elements. Two-dimensional arrays are also discussed where rows are stored sequentially in memory. Hands-on exercises demonstrate using these instructions to work with strings and 2D arrays.
The document provides an overview of assembly language concepts including:
1) Assembly language statements are divided into three classes: instructions, directives, and macros. Instructions perform operations, directives provide information to the assembler, and macros act as shorthand for groups of statements.
2) Data is allocated using directives like DB, DW, DD, etc. that reserve storage space and can initialize values. Indirect addressing allows accessing data structures like arrays using registers and loops.
3) Operands for instructions can be in registers, specified directly in the instruction (immediate mode), or located in memory using various addressing modes like direct and indirect.
The document discusses various addressing modes used in microprocessors including the 8086/8088. It describes indirect, register, and register indirect addressing modes in detail. Indirect addressing mode uses the address field to specify the memory location of the effective address. Register addressing mode uses register operands instead of memory. Register indirect mode specifies a register that contains the memory address of the operand. Examples are provided to illustrate how each mode works.
The document discusses assembly language instructions and concepts. It covers:
- Basic instruction formats and operand types like registers, memory, and immediates.
- Data transfer instructions like MOV, and addressing modes like direct offset addressing of arrays.
- Arithmetic instructions like ADD, SUB, INC, DEC, and NEG, and how they affect status flags.
- Status flags like zero, carry, sign, auxiliary carry, parity, and overflow flags which provide information about instruction results.
The document discusses different addressing modes in assembly language including register, immediate, direct memory, indirect, and direct-offset addressing. It also describes the MOV instruction which is used to move data between registers and memory locations. The MOV instruction supports five forms depending on whether the source and destination operands are registers or memory locations.
2D array in C++ language ,define the concept of c++ Two-Dimensional array .with example .and also Accessing Array Components concept.and Processing Two-Dimensional Arrays.
The document discusses various data addressing modes used in microprocessors, including register, immediate, direct, indirect, base-plus-index, register relative, base relative-plus-index, and scaled-index addressing. It also covers program addressing modes like direct, relative, and indirect jumping and calling. Finally, it discusses stack addressing and how the push and pop instructions are used to place data onto and remove data from the stack.
The Array is the most commonly used Data Structure.
An array is a collection of data elements that are of the same type (e.g., a collection of integers, collection of characters, collection of doubles).
OR
Array is a data structure that represents a collection of the same types of data.
The values held in an array are called array elements
An array stores multiple values of the same type – the element type
The element type can be a primitive type or an object reference
Therefore, we can create an array of integers, an array of characters, an array of String objects, an array of Coin objects, etc.
All-addressing-modes of the 80386 /microprocessor.pptxVidyaAshokNemade
The document discusses different addressing modes of the 80386 processor. It defines addressing modes as the techniques used to specify the address of an operand in an instruction. Some key addressing modes described are:
- Register addressing which transfers data between registers.
- Immediate addressing which specifies an immediate constant as the source.
- Direct addressing which directly specifies the memory address of the operand in the instruction.
- Register indirect addressing which uses a register like BX or BP to hold the effective address of the operand.
- Indexed addressing which uses a register like ESI or EDI to hold an index value plus a displacement to calculate the effective address.
This document discusses different memory addressing modes used in microprocessors, including real mode, protected mode, and flat mode addressing. It provides details on how addresses are calculated in real mode using segment registers and offsets. Protected mode addressing allows accessing memory above 1MB by using descriptor tables to map segment selectors to base addresses and limits. Various programming models for addressing program memory and stack memory are also covered.
Arrays are sequences of elements of the same type that can be accessed using an index. Multidimensional arrays have more than one index and are used to represent matrices. Dynamic arrays like lists can resize automatically when elements are added or removed. Common operations on arrays include initialization, accessing elements, iterating with for/foreach loops, and copying arrays.
The document discusses the stack and buffer overflows. It provides an overview of registers, the stack, calling conventions, and buffer overflows. It explains how buffer overflows can corrupt local variables or overwrite the return pointer. The document shows how to craft payloads to exploit buffer overflows by overwriting values on the stack, such as changing a variable or calling a function directly.
This document discusses operands and addressing modes in computer architecture. It describes different types of operands including register operands that specify a register, immediate operands that specify a constant value, and memory operands that specify an address using a base register, index register, scale, and displacement. It also describes different addressing modes like direct addressing that uses a displacement and register indirect addressing that uses the contents of a base register as an offset.
This document provides an introduction to the Python programming language. It outlines key topics like why use Python, running Python code, data types and operators, basic statements like if/while/for loops, functions, and examples of simple Python programs. It also discusses common industry applications of Python like web development, scientific applications, databases, and education. Major companies that use Python extensively are listed, such as Google, NASA, Industrial Light & Magic, Yahoo, and RedHat.
An array is a collection of similar data types stored under a common name. Arrays can be one-dimensional, two-dimensional, or multi-dimensional. Elements in an array are stored in contiguous memory locations. Arrays allow multiple variables of the same type to be manipulated together using a single name. Common operations on arrays include sorting elements, performing matrix operations, and CPU scheduling.
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGFrankie Jones
3.1 UNDERSTANDING INSTRUCTION SET AND ASSEMBLY LANGUAGE
3.1.1 Define instruction set,machine and assembly language
3.1.2 Describe features and architectures of various type of microprocessor
3.1.3 Describe the Addressing Modes
3.2 APPLY ASSEMBLY LANGUAGE
3.2.1 Write simple program in assembly language
3.2.2 Tool in analyzing and debugging assembly language program
The document provides an overview of the history and evolution of management theories, beginning with early examples and the Industrial Revolution. It then discusses several classical approaches to management, including Scientific Management by Frederick Taylor, the work of Frank and Lillian Gilbreth on motion studies, and Henri Fayol's principles of management. Later sections cover quantitative approaches, total quality management, the behavioral school influenced by the Hawthorne Studies, systems theory, and contemporary management.
The document discusses organizational culture, describing it as shared values, principles, traditions, and ways of doing things that influence employee behavior. It identifies dimensions of culture like innovation, detail orientation, and teamwork. Strong cultures have widely shared values that guide behavior, while weak cultures lack shared values. Culture is shaped by founders and management practices, and learned through stories, rituals, symbols and language. Culture affects managerial functions like planning, organizing, and leading. Current issues relate to ethics, innovation, customers and diversity. The external environment and stakeholders also influence organizational culture.
These Slides covers the whole communication process including:
*Communication Process
*Components of Communication Process
*Importance of Communication Process
*Types of Communication Process
*Barriers in communication process
*Principles of Effective communication
*7 C's of Communication
This document provides an introduction to graphical user interfaces (GUIs) in Java. It discusses GUI components such as buttons, checkboxes, lists, sliders, and menus. It explains how to create simple GUIs using Swing components like JFrames, JLabels, and JButtons. Event handling is demonstrated through examples using interfaces like ItemListener. Different types of buttons are presented, including toggle buttons, radio buttons, and checkboxes. Common GUI elements like text fields, lists, sliders and menus are also introduced through examples. The document provides a high-level overview of creating and working with basic GUI components in Java.
The document discusses set operations including union, intersection, difference, complement, and disjoint sets. It provides formal definitions and examples for each operation. Properties of the various operations are listed, such as the commutative, associative, identity, and domination laws. Methods for proving set identities are also described.
The document summarizes the ethnic diversity of the Punjab region. It notes that the Punjabi population is heterogeneous and can be subdivided into numerous ethnic groups called biradri. While the majority of Punjabis share genes with other northern Indian groups, the region has seen significant migrations that have influenced the local population. Punjabi culture is one of the oldest and richest in the world, and the region is religiously diverse and tolerant, with Punjabis following many faiths. The primary language is Punjabi, though English and other languages are also spoken. Cuisine from the Punjab has become very popular worldwide, as has the musical art form of Bhangra.
This document provides an overview of social networking. It begins by defining social network sites and their key features. It then discusses the history of major social networking sites from 1997 to the present. The document outlines strategies for social networking, including attracting new members, community structure, encouraging participation, and guidelines. It also covers trends like privacy, data mining, and potential issues. Finally, it provides data on market share of top sites and concludes by discussing the social impact of social networking.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
Thinking of getting a dog? Be aware that breeds like Pit Bulls, Rottweilers, and German Shepherds can be loyal and dangerous. Proper training and socialization are crucial to preventing aggressive behaviors. Ensure safety by understanding their needs and always supervising interactions. Stay safe, and enjoy your furry friends!
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Physiology and chemistry of skin and pigmentation, hairs, scalp, lips and nail, Cleansing cream, Lotions, Face powders, Face packs, Lipsticks, Bath products, soaps and baby product,
Preparation and standardization of the following : Tonic, Bleaches, Dentifrices and Mouth washes & Tooth Pastes, Cosmetics for Nails.
1. Arrays and Addressing Modes
Muhammad Bilal Amjad
www.facebook.com/bilal.amjad
bilalamjad78633@yahoo.com
2. Presentation Outline
Operand Types
Memory operands
Addressing Modes
Copying a String
Summing an Array of Integers
3. Three Basic Types of Operands
Immediate
Constant integer (8, 16, or 32 bits)
Constant value is stored within the instruction
Register
Name of a register is specified
Register number is encoded within the instruction
Memory
Reference to a location in memory
Memory address is encoded within the instruction, or
Register holds the address of a memory location
4. Instruction Operand Notation
Operand Description
r8 8-bit general-purpose register: AH, AL, BH, BL, CH, CL, DH, DL
r16 16-bit general-purpose register: AX, BX, CX, DX, SI, DI, SP, BP
r32 32-bit general-purpose register: EAX, EBX, ECX, EDX, ESI, EDI, ESP, EBP
reg Any general-purpose register
sreg 16-bit segment register: CS, DS, SS, ES, FS, GS
imm 8-, 16-, or 32-bit immediate value
imm8 8-bit immediate byte value
imm16 16-bit immediate word value
imm32 32-bit immediate doubleword value
r/m8 8-bit operand which can be an 8-bit general-purpose register or memory byte
r/m16 16-bit operand which can be a 16-bit general-purpose register or memory word
r/m32 32-bit operand which can be a 32-bit general register or memory doubleword
mem 8-, 16-, or 32-bit memory operand
5. Next . . .
Operand Types
Memory operands
Addition and Subtraction
Addressing Modes
Jump and Loop Instructions
Copying a String
Summing an Array of Integers
6. Direct Memory Operands
Variable names are references to locations in memory
Direct Memory Operand:
Named reference to a memory location
Assembler computes address (offset) of named variable
.DATA
var1 BYTE 10h
.CODE Direct Memory Operand
mov al, var1 ; AL = var1 = 10h
mov al,[var1] ; AL = var1 = 10h
Alternate Format
7. Direct-Offset Operands
Direct-Offset Operand: Constant offset is added to a named memory
location to produce an effective address
Assembler computes the effective address
Lets you access memory locations that have no name
.DATA
arrayB BYTE 10h,20h,30h,40h
.CODE
mov al, arrayB+1 ; AL = 20h
mov al,[arrayB+1] ; alternative notation
mov al, arrayB[1] ; yet another notation
Q: Why doesn't arrayB+1 produce 11h?
9. Next . . .
Operand Types
Memory operands
Addressing Modes
Copying a String
Summing an Array of Integers
10. Addressing Modes
Two Basic Questions
Where are the operands?
How memory addresses are computed?
Intel IA-32 supports 3 fundamental addressing modes
Register addressing: operand is in a register
Immediate addressing: operand is stored in the instruction itself
Memory addressing: operand is in memory
Memory Addressing
Variety of addressing modes
Direct and indirect addressing
Support high-level language constructs and data structures
11. Register and Immediate
Addressing
Register Addressing
Most efficient way of specifying an operand: no memory access
Shorter Instructions: fewer bits are needed to specify register
Compilers use registers to optimize code
Immediate Addressing
Used to specify a constant
Immediate constant is part of the instruction
Efficient: no separate operand fetch is needed
Examples
mov eax, ebx ; register-to-register move
add eax, 5 ; 5 is an immediate constant
12. Direct Memory Addressing
Used to address simple variables in memory
Variables are defined in the data section of the program
We use the variable name (label) to address memory directly
Assembler computes the offset of a variable
The variable offset is specified directly as part of the instruction
Example
.data
var1 DWORD 100
var2 DWORD 200
sum DWORD ?
.code
mov eax, var1
add eax, var2 var1, var2, and sum are direct
mov sum, eax memory operands
13. Register Indirect Addressing
Problem with Direct Memory Addressing
Causes problems in addressing arrays and data structures
Does not facilitate using a loop to traverse an array
Indirect memory addressing solves this problem
Register Indirect Addressing
The memory address is stored in a register
Brackets [ ] used to surround the register holding the address
For 32-bit addressing, any 32-bit register can be used
Example
mov ebx, OFFSET array ; ebx contains the address
mov eax, [ebx] ; [ebx] used to access memory
EBX contains the address of the operand, not the operand itself
14. Array Sum ideal for traversing an array
Indirect addressing is
Example
.data
array DWORD 10000h,20000h,30000h
.code
mov esi, OFFSET array ; esi = array address
mov eax,[esi] ; eax = [array] = 10000h
add esi,4 ; why 4?
add eax,[esi] ; eax = eax + [array+4]
add esi,4 ; why 4?
add eax,[esi] ; eax = eax + [array+8]
Note that ESI register is used as a pointer to array
ESI must be incremented by 4 to access the next array element
Because each array element is 4 bytes (DWORD) in memory
15. Ambiguous Indirect Operands
Consider the following instructions:
mov [EBX], 100
add [ESI], 20
inc [EDI]
Where EBX, ESI, and EDI contain memory addresses
The size of the memory operand is not clear to the assembler
EBX, ESI, and EDI can be pointers to BYTE, WORD, or DWORD
Solution: use PTR operator to clarify the operand size
mov BYTE PTR [EBX], 100 ; BYTE operand in memory
add WORD PTR [ESI], 20 ; WORD operand in memory
inc DWORD PTR [EDI] ; DWORD operand in memory
16. Indexed Addressing
Combines a variable's name with an index register
Assembler converts variable's name into a constant offset
Constant offset is added to register to form an effective address
Syntax: [name + index] or name [index]
.data
array DWORD 10000h,20000h,30000h
.code
mov esi, 0 ; esi = array index
mov eax,array[esi] ; eax = array[0] = 10000h
add esi,4
add eax,array[esi] ; eax = eax + array[4]
add esi,4
add eax,[array+esi] ; eax = eax + array[8]
17. Index Scaling
Useful to index array elements of size 2, 4, and 8 bytes
Syntax: [name + index * scale] or name [index * scale]
Effective address is computed as follows:
Name's offset + Index register * Scale factor
.DATA
arrayB BYTE 10h,20h,30h,40h
arrayW WORD 100h,200h,300h,400h
arrayD DWORD 10000h,20000h,30000h,40000h
.CODE
mov esi, 2
mov al, arrayB[esi] ; AL = 30h
mov ax, arrayW[esi*2] ; AX = 300h
mov eax, arrayD[esi*4] ; EAX = 30000h
18. Based Addressing
Syntax: [Base + Offset]
Effective Address = Base register + Constant Offset
Useful to access fields of a structure or an object
Base Register → points to the base address of the structure
Constant Offset → relative offset within the structure
.DATA mystruct is a structure
mystruct WORD 12 consisting of 3 fields:
DWORD 1985 a word, a double
BYTE 'M' word, and a byte
.CODE
mov ebx, OFFSET mystruct
mov eax, [ebx+2] ; EAX = 1985
mov al, [ebx+6] ; AL = 'M'
19. Based-Indexed Addressing
Syntax: [Base + (Index * Scale) + Offset]
Scale factor is optional and can be 1, 2, 4, or 8
Useful in accessing two-dimensional arrays
Offset: array address => we can refer to the array by name
Base register: holds row address => relative to start of array
Index register: selects an element of the row => column index
Scaling factor: when array element size is 2, 4, or 8 bytes
Useful in accessing arrays of structures (or objects)
Base register: holds the address of the array
Index register: holds the element address relative to the base
Offset: represents the offset of a field within a structure
21. LEA Instruction
LEA = Load Effective Address
LEA r32, mem (Flat-Memory)
LEA r16, mem (Real-Address Mode)
Calculate and load the effective address of a memory operand
Flat memory uses 32-bit effective addresses
Real-address mode uses 16-bit effective addresses
LEA is similar to MOV … OFFSET, except that:
OFFSET operator is executed by the assembler
Used with named variables: address is known to the assembler
LEA instruction computes effective address at runtime
Used with indirect operands: effective address is known at runtime
23. Summary of Addressing Modes
Assembler converts a variable name into a constant
offset (called also a displacement)
For indirect addressing, a base/index register
contains an address/index
CPU computes the effective address
of a memory operand
24. Registers Used in 32-Bit Addressing
32-bit addressing modes use the following 32-bit registers
Base + ( Index * Scale ) + displacement
EAX EAX 1 no displacement
EBX EBX 2 8-bit displacement
ECX ECX 4 32-bit displacement
EDX EDX 8
ESI ESI Only the index register can have a
scale factor
EDI EDI
EBP EBP ESP can be used as a base register, but
not as an index
ESP
25. 16-bit Memory Addressing
Old 16-bit Used with real-address mode
addressing
mode Only 16-bit registers are used
No Scale Factor
Only BX or BP can be the base register
Only SI or DI can be the index register
Displacement can be 0, 8, or 16 bits
26. Default Segments
When 32-bit register indirect addressing is used …
Address in EAX, EBX, ECX, EDX, ESI, and EDI is relative to DS
Address in EBP and ESP is relative to SS
In flat-memory model, DS and SS are the same segment
Therefore, no need to worry about the default segment
When 16-bit register indirect addressing is used …
Address in BX, SI, or DI is relative to the data segment DS
Address in BP is relative to the stack segment SS
In real-address mode, DS and SS can be different segments
We can override the default segment using segment prefix
mov ax, ss:[bx] ; address in bx is relative to stack segment
mov ax, ds:[bp] ; address in bp is relative to data segment
27. Next . . .
Operand Types
Memory operands
Addressing Modes
Copying a String
Summing an Array of Integers
28. Copying a String
The following code copies a string from source to target
.DATA
source BYTE "This is the source string",0
target BYTE SIZEOF source DUP(0)
.CODE
main PROC Good use of SIZEOF
mov esi,0 ; index register
mov ecx, SIZEOF source ; loop counter
L1:
mov al,source[esi] ; get char from source
mov target[esi],al ; store it in the target
inc esi ; increment index
loop L1 ESI is used to index ; loop for entire string
exit source & target
main ENDP strings
END main
29. Summing an Integer Array
This program calculates the sum of an array of 16-bit integers
.DATA
intarray WORD 100h,200h,300h,400h,500h,600h
.CODE
main PROC
mov esi, OFFSET intarray ; address of intarray
mov ecx, LENGTHOF intarray ; loop counter
mov ax, 0 ; zero the accumulator
L1:
add ax, [esi] ; accumulate sum in ax
add esi, 2 ; point to next integer
loop L1 ; repeat until ecx = 0
exit
esi is used as a pointer
main ENDP
contains the address of an array element
END main
30. Summing an Integer Array – cont'd
This program calculates the sum of an array of 32-bit integers
.DATA
intarray DWORD 10000h,20000h,30000h,40000h,50000h,60000h
.CODE
main PROC
mov esi, 0 ; index of intarray
mov ecx, LENGTHOF intarray ; loop counter
mov eax, 0 ; zero the accumulator
L1:
add eax, intarray[esi*4] ; accumulate sum in eax
inc esi ; increment index
loop L1 ; repeat until ecx = 0
exit
main ENDP esi is used as a scaled index
END main
31. PC-Relative Addressing
The following loop calculates the sum: 1 to 1000
Offset Machine Code Source Code
00000000 B8 00000000 mov eax, 0
00000005 B9 000003E8 mov ecx, 1000
0000000A L1:
0000000A 03 C1 add eax, ecx
0000000C E2 FC loop L1
0000000E . . . . . .
When LOOP is assembled, the label L1 in LOOP is translated as FC which is equal to –4
(decimal). This causes the loop instruction to jump 4 bytes backwards from the offset of the
next instruction. Since the offset of the next instruction = 0000000E, adding –4 (FCh) causes a
jump to location 0000000A. This jump is called PC-relative.
32. PC-Relative Addressing – cont'd
Assembler:
Calculates the difference (in bytes), called PC-relative offset, between the offset of the target
label and the offset of the following instruction
Processor:
Adds the PC-relative offset to EIP when executing LOOP instruction
If the PC-relative offset is encoded in a single signed byte,
(a) what is the largest possible backward jump?
(b) what is the largest possible forward jump?
Answers: (a) –128 bytes and (b) +127 bytes
33. Summary
Data Transfer
MOV, MOVZX, and XCHG instructions
Addressing Modes
Register, immediate, direct, indirect, indexed, based-indexed
Load Effective Address (LEA) instruction
32-bit and 16-bit addressing
JMP and LOOP Instructions
Traversing and summing arrays, copying strings
PC-relative addressing