Addressing mode is the way of addressing a memory location in instruction. Microcontroller needs data or operands on which the operation is to be performed. 8051 Microcontroller: Addressing Modes. 8051 Addressing Modes Introduction: An 'addressing mode' refers to how you are addressing a given memory location. Addressing Modes. Get the full title to continue reading from where you left off, or restart the preview. Chapter – 3 Addressing Modes. Program memory-addressing modes, used with the iMP and CALL instructions, consist of three distinct forms: direct, relative. Register addressing Mode. 1) 80x86 Register Addressing Modes. By specifying the name of the register as an operand to the instruction, you may access. Addressing mode 1 Addressing mode Addressing modes are an aspect of the instruction set architecture in most central processing unit (CPU) designs. Lecture 4: Addressing modes g An instruction in the MC68000 contains two types of information n The type of operation to be performed n The location of the operand(s). Addressing Modes in Assembly Language. Assembly Languageaddress space and addressing modessummary This web page examines addressing modes in assembly language. Specific examples of addressing modes from various processors are used to illustrate the general nature of assembly language. Some processors use a multi- level addressing scheme, with main memory divided into segments or pages and some or all instructions mapping into the current segment(s) or page(s). MIX: 4. 00. 0 words of storage. From memory. RAM is called “random access” because the processor or computer can access any location in memory (as contrasted with sequential access devices, which must be accessed in order). RAM has been made from reed relays, transistors, integrated circuits, magnetic core, or anything that can hold and store binary values (one/zero, plus/minus, open/close, positive/negative, high/low, etc.). Most modern RAM is made from integrated circuits. At one time the most common kind of memory in mainframes was magnetic core, so many older programmers will refer to main memory as core memory even when the RAM is made from more modern technology. Static RAM is called static because it will continue to hold and store information even when power is removed. Magnetic core and reed relays are examples of static memory. Dynamic RAM is called dynamic because it loses all data when power is removed. Transistors and integrated circuits are examples of dynamic memory. It is possible to have battery back up for devices that are normally dynamic to turn them into static memory. ROM is typically used to store thigns that will never change for the life of the computer, such as low level portions of an operating system. Some processors (or variations within processor families) might have RAM and/or ROM built into the same chip as the processor (normally used for processors used in standalone devices, such as arcade video games, ATMs, microwave ovens, car ignition systems, etc.). EPROM is Erasable Programmable Read Only Memory, a special kind of ROM that can be erased and reprogrammed with specialized equipment (but not by the processor it is connected to). EPROMs allow makers of industrial devices (and other similar equipment) to have the benefits of ROM, yet also allow for updating or upgrading the software without having to buy new ROM and throw out the old (the EPROMs are collected, erased and rewritten centrally, then placed back into the machines). The basic addressing modes are: register direct, moving date to or from a specific register; register indirect, using a register as a pointer to memory; program counter- based, using the program counter as a reference point in memory; absolute, in which the memory addressis contained in the instruction; and immediate, in which the data is contained in the instruction. Some instructions will have an inherent or implicit address (usually a specific register or the memory contents pointed to by a specific register) that is implied by the instruction without explicit declaration. Some engineers and programmers believe that the real power of a processor lies in its addressing modes. Most addressing modes can be created by combining two or more basic addressing modes, although building the combination in software will usually take more time than if the combination addressing mode existed in hardware (although there is a trade- off that slows down all operations to allow for more complexity). In practice, this isn’t the case. Some processors have full and short versions of absolute addressing (with short versions only pointing to a limited area in memory, normally starting at memory location zero). Unless overridden by hardware for virtual memory mapping, programs that use this address mode can not be moved in memory. From memory. An address is a numeric label for a specific location in memory. The numbering system is usually in bytes and always starts counting with zero. The first byte of physical memory is at address 0, the second byte of physical memory is at address 1, the third byte of physical memory is at address 2, etc. Some processors use word addressing rather than byte addressing. The theoretical maximum address is determined by the address size of a processor (a 1. GB of memory locations). The actual maximum is limited to the amount of RAM (and ROM) physically installed in the computer. These absolute addresses might be assigned arbitrarily or might have to match specific locations expected by an operating system. In practice, the assembler or complier determines the absolute addresses through an orderly predictable assignment scheme (with the ability for the programmer to override the compiler’s scheme to assign specific operating system mandated addresses). For almost every processor, absolute addresses are the fastest form of memory addressing. The use of absolute addresses makes programs run faster and greatly simplifies the task of compiling or assembling a program. For example, when a processor is first turned on, where does it start? Most processors have a specific address that is used as the address of the first instruction run when the processer is first powered on. Some processors provide a method for the start address to be changed for future start- ups. Sometimes this is done by storing the start address internally (with some method for software or external hardware to change this value). For example, on power up the Motorola 6. Sometimes this is done by reading the start address from a data line (or other external input) at power- up (and in this case, there is usually fixed external hardware that always generates the same pre- assigned start address). A processor often has specific memory addresses set aside for specific kinds of traps, exceptions, and interrupts. Using a specific example, a divide by zero exception on the Motorola 6. An example would be the MS- DOS expectation that the start of a program would always be located at absolute memory address x. A typical compiler or assembler directive for this would be the ORG directive (for “origin”). The sizes allowed for immediate data vary by processor and often by instruction (with some instructions having specific implied sizes). Motorola 6. 80x. 0, 6. Many instructions will have one or more inherent or implicit addresses. These are addresses that are implied by the instruction rather than explicitly stated. The two most common forms of inherent address are either a specific register or a memory location designated by the contents of a specific register. In register direct address mode, the source and/or destination is a register. Data that is smaller than the register may be sign extended or zero filled to fill the entire register, or may be placed only in the portion of the register necessary for the size of the data, leaving the rest of the register unchanged. Motorola 6. 80x. 0, 6. Dn In register to register (RR) operations, data is transferred from one register to another register or an instruction uses a source and destination register. IBM 3. 60/3. 70: two byte instructions with a source and a destination register; 3. Motorola 6. 80x. 0, 6. Dn, Dn In address register direct operations, flags are not normally set or cleared. The address is usually sign extended to the full address size of the processor. Motorola 6. 80x. 0, 6. Anregister indirect In register indirect address mode, the contents of the designated register are used as a pointer to memory. Variations of register indirect include the use of post- or pre- increment, post- or pre- decrement, and displacements. This is useful for a loop where the same or similar operations are performed on consecutive locations in memory. This address mode can be combined with a complimentary predecrement mode for stack and queue operations. Motorola 6. 80x. 0, 6. An)+ In address register indirect with predecrement operations, the designated register is decremented by the size of the operations, and then the designated register is used as a pointer to memory. This is useful for a loop where the same or similar operations are performed on consecutive locations in memory. This address mode can be combined with a complimentary postincrement mode for stack and queue operations. Motorola 6. 80x. 0, 6. An) In address register indirect with preincrement operations, the designated register is incremented by the size of the operations, and then the designated register is used as a pointer to memory. This is useful for a loop where the same or similar operations are performed on consecutive locations in memory. This address mode can be combined with a complimentary postdecrement mode for stack and queue operations. This is useful for a loop where the same or similar operations are performed on consecutive locations in memory. This address mode can be combined with a complimentary preincrement mode for stack and queue operations. The displacement integer is stored in the instruction, and if shorter than the length of a the processor’s address space (the normal case), sign- extended before addition (or subtraction). Motorola 6. 80x. 0, 6. An)base registers. From memory. Programs can then use an absolute address within a page and either explicitly add the absolute address to the contents of a base pointer or rely on the hardware to add the two together to form the actual effective address of the memory access. Which method was used would depend on the processor capabilities and the operatign system design. Hiding the base pointer from the application program both made the program easier to compile and allowed for the operating system to implement program isolation, data/code isolation, protected memory, and other sophisticated services. When a program is loaded into memory, an operating system running on the Intel 8. If a program is swapped out, when it gets swapped back in, the operating system sets the segment pointers to the new memory locations for each segment. The program continues to run, without being aware that it has been moved in memory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2016
Categories |