Premium Essay

Addressing Modes

In:

Submitted By Login
Words 595
Pages 3
Addressing Modes
The way the operands are chosen during program execution is dependent on the addressing mode of the instructions. The addressing mode specifies a rule for interpreting or modifying the address field of the instruction before the operand is actually referenced. Computers use addressing mode techniques for the purpose of accommodating one or both of the following provisions:

1

Addressing Modes
Computers use addressing mode techniques for the purpose of accommodating one or both of the following provisions:
1.

2.

to give programming versatility to the user by providing such facilities as pointers to memory, counters for loop control, indexing of data and program relocation. To reduce the number of bits in the addressing field of the instruction.
2

Addressing Modes
Immediate Direct Indirect Register Register Indirect Displacement (Indexed) Stack
3

Immediate Addressing
Operand is part of instruction Operand = address field e.g. ADD 5
Add 5 to contents of accumulator 5 is operand

No memory reference to fetch data Fast Limited range
4

Immediate Addressing Diagram
Instruction Opcode Operand

5

Direct Addressing
Address field contains address of operand Effective address (EA) = address field (A) e.g. ADD A
Add contents of cell A to accumulator Look in memory at address A for operand Single memory reference to access data

No additional calculations to work out effective address Limited address space
6

Direct Addressing Diagram
Instruction Opcode Address A Memory

Operand

7

Indirect Addressing (1)
Memory cell pointed to by address field contains the address of (pointer to) the operand EA = (A)
Look in A, find address (A) and look there for operand e.g. ADD (A) Add contents of cell pointed to by contents of A to accumulator

8

Indirect Addressing (2)
Large address space 2n where n = word

Similar Documents

Free Essay

How Would I Achieve My Dream Job

...General Objective: To know and understand the addressing mode and programming. Specific Objectives: At the end of the unit you should be able to: 4.1 classify and describe the addressing modes 4.2 explain the concept of programming 4.3 discuss the implementation structure of programming 0. INTRODUCTION Programming is a process of composing several instructions to perform certain tasks. The product of the programming is called a program which contains several instructions. The skill of programming is to know the best or optimum composition of selective instructions to performs the required tasks. In other words, we may classify these skills into uniform concepts as structure of programming implementation. These structure shall bear the emphasis to: • what instructions (selectable from a complete list of instructions as a tools list) essential and best to perform a certain task; • how these instructions are organized into a sub program which can be reused or recalled as many times as possible to perform the identical task with different set of data; • to preserve the minimum lines of instruction but performs the maximum tasks. The less instruction lines require less operating times, thus expetite the implementation speed. The main proccess of program (instructions) implementation is nothing else just the manipulation of data. We need to know how to identify the source of data, procedure to fetch these...

Words: 9907 - Pages: 40

Free Essay

Class Essay

...Assignment 4.1 Chapter 5 pg 135-138 2. Identify the addressing mode for each of the following? (A) MOV B,#34H IMMEDIATE (B) MOV A 50H DIRECT (C) MOV R2,07 REGISTER MODE (D) R3,#0 IMMEDIATE (E) MOV R7,0 REGISTER MODE (F) MOV R6,#7FH IMMIDIATE (G) MOV R0,A REGISTER MODE (H) MOV B,A (I) MOV A,@R0 INDIRECT MODE (J) MOV R7,A REGISTER MODE (K) MOV A,@R1 INDIRECT MODE 9. Which register are allowed to be used for indicated addressing mode when accessing data in RAM? 20. Write a program to generate a square wave with 75% duty cycle on bit P1.5. 29. What bit addresses are assigned to the TCON register? 88H 30. What bit address are assigned to register A? 0E0H 31. What bit address are assigned to resister B? 0F0H 45. The byte address assigned to the SFR are REGISTERS to ADDRESSES 61. What addressing mode is used to access the upper 128 bytes of RAM in the 8052? DIRECT MODE 66. Which registers can be used to access the upper 128 bytes of RAM in the 8052? Chapter 6 pg. 174-178 1) a) AC=1 and CY= 0 b) AC= 2 and CY= 2 c) AC=0 and CY= 0 d) AC= 2 and CY= 1 e) AC=0 and CY=0 f) CY=1 and AC=1 9. Write a program to add 897F9AH to 34BC48H and save the result in RAM memory locations stating at 40H. CLR C MOV 12. Show how to perform 77 x 34 in the 8051. 77 x 34 in 8051 = MOV A, #77 MOV B, #34 MUL AB 13. Show how to perform 77 / 3 in the 8051. 77/3 in 8051 = MOV A, #77 MOV B, #3 DIV AB 14. True or False. The MUL and DIV instructions work on an...

Words: 446 - Pages: 2

Premium Essay

Adressing Modes

...CH11 Instruction Sets: Addressing Modes and Formats Software and Hardware interface Addressing Modes • • • • • • • Immediate Direct Indirect Register Register Indirect Displacement (Indexed) Stack • • • • Addressing Pentium and PowerPC Addressing Modes Instruction Formats Pentium and PowerPC Instruction Formats TECH Computer Science CH10 Immediate Addressing Immediate Addressing Diagram • Operand is part of instruction • Operand = address field • e.g. ADD 5 Add 5 to contents of accumulator 5 is operand Instruction Opcode Operand • No memory reference to fetch data • Fast • Limited range Direct Addressing • Address field contains address of operand • Effective address (EA) = address field (A) • e.g. ADD A Add contents of cell A to accumulator Look in memory at address A for operand • Single memory reference to access data Direct Addressing Diagram Instruction Opcode Address A Memory • No additional calculations to work out effective address • Limited address space Operand Indirect Addressing (1) • Memory cell pointed to by address field contains the address of (pointer to) the operand • EA = (A) Look in A, find address (A) and look there for operand • e.g. ADD (A) Add contents of cell pointed to by contents of A to accumulator Indirect Addressing (2) • Large address space • 2n where n = word length • May be nested, multilevel, cascaded e.g. EA = (((A))) f Draw the diagram yourself • Multiple memory accesses to find...

Words: 592 - Pages: 3

Free Essay

Biometric Attenedance System

...Assembly Language Tutorial (x86) For more detailed information about the architecture and about processor instructions, you will need access to a 486 (or 386+) microprocessor manual. The one I like is entitled The 80386 book, by Ross P. Nelson. (This book is copyright 1988 by Microsoft Press, ISBN 1-55615-138-1.) Intel processor manuals may also be found at http://www.x86.org/intel.doc/586manuals.htm. The GNU Assembler, gas, uses a different syntax from what you will likely find in any x86 reference manual, and the two-operand instructions have the source and destinations in the opposite order. Here are the types of the gas instructions: opcode (e.g., pushal) opcode operand (e.g., pushl %edx) opcode source,dest (e.g., movl %edx,%eax) (e.g., addl %edx,%eax) Where there are two operands, the rightmost one is the destination. The leftmost one is the source. For example, movl %edx, %eax means Move the contents of the edx register into the eax register. For another example, addl %edx,%eax means Add the contents of the edx and eax registers, and place the sum in the eax register. Included in the syntactic differences between gas and Intel assemblers is that all register names used as operands must be preceeded by a percent (%) sign, and instruction names usually end in either "l", "w", or "b", indicating the size of the operands: long (32 bits), word (16 bits), or byte (8 bits), respectively. For our purposes...

Words: 1264 - Pages: 6

Premium Essay

Microcontrollers

...Chapter 3: Jump, Loop, and Call Instructions 3:1: Loop and Jump Instructions 1. In the 8051, looping action with the instruction “DJNZ Rx, rel address” is limited to decrement iterations. 2. If a conditional jump is not taken, what is the next instruction to be executed? Unconditional jump 3. In calculating the target address for a jump, a displacement is added to the contents of register program counter. 4. The mnemonic SJMP stands for short jump and it is a 2-byte instruction. 5. The mnemonic LJMP stands for long jump and it is a 3-byte instruction. 6. What is the advantage of using SJMP and LJMP? The advantage is no stack handling is needed. 7. True or false. The target of a short jump within -128 to +127 bytes of the current PC. True 8. True or false. All 8051 jumps are short jumps. False 9. Which of the following instructions is (are) not a short jump? C. LJMP 3:2: Call Instructions 17. LCALL is a 3 -byte instruction. 18. ACALL is a 2 -byte instruction. 19. The ACALL target address is limited to 2k bytes from the present PC. 20. The LCALL target address is limited to 64k bytes from the present PC. 21. When LCALL is executed, how many bytes of the stack are used? 64k 22. When ACALL is executed, how many bytes of the stack are used? 2k 23. Why do the PUSH and POP instructions in a subroutine need to be equal in number? The number needs to be equal because with the use of every PUSH there has to be a POP to match. 24. Describe the...

Words: 686 - Pages: 3

Free Essay

Tech

...1. (12 points) Show how the value ASCII “DEVORA” is stored as hexadecimal in memory in Big Endian format starting at location 200 hexadecimal. Assume that each memory location stores two ASCII characters. |Memory Location |Value Stored | | | | | | | | | | 2. (18 points) ) For X = 0011 1111, show the result of the following independent operations (i.e. each instruction occurs with X starting at the value above): a) Shift-right ____ ____ b) Circular Shift-right ____ ____ c) Shift-left ____ ____ d) Circular Shift-left ____ ____ e) Arithmetic Shift-left ____ ____ f) Arithmetic Shift-right ____ ____ 3. (12 points) a) Convert the following formula from postfix (Reverse Polish Notation) to infix: AB*CD/+ b) Convert the following formula from infix to postfix (Reverse Polish Notation): A + B * C + D / E * F Note that the result of part b) can be used in problem 7 In the problems 4 through 7 write code that performs the computation: X = A + B * C + D / E * F using CPUs that have the following instruction formats. You may only use registers A through F, plus X and T. Registers A through F may not be changed, i.e. their...

Words: 457 - Pages: 2

Free Essay

Mca Ignou

...Course Code Course Title Assignment Number Maximum Marks Weightage Last Dates for Submission : : : : : : MCS-012 Computer Organisation and Assembly Language Programming MCA(1)/012/Assign/2011 100 25% 15th April, 2011 (For January Session) 15th October, 2011 (For July Session) There are four questions in this assignment, which carries 80 marks. Rest 20 marks are for viva voce. You may use illustrations and diagrams to enhance the explanations. Please go through the guidelines regarding assignments given in the Programme Guide for the format of presentation. Answer to each part of the question should be confined to about 300 words. Question 1: (a) Perform the following arithmetic operations using binary signed 2’s complement notation for integers. You may assume that the maximum size of integers is of 10 bits including the sign bit. (Please note that the numbers given here are in decimal notation) (3 Marks) i) Ans: Add – 498 and 260 ii) Ans: Subtract 456 from – 56 Page 1 iii) Ans: Add 256 and 255 (b) Convert the hexadecimal number: FA BB C9 into binary, octal and decimal. Ans1: (FA BB C9)16 = (0110011001001011000111)2 Ans2: (FA BB C9)16 = (77735711)8 Ans3: (FA BB C9)16 = (16759753)10 (1 Mark) (c) Convert the following string into equivalent ASCII code – “Copyright © 2001 - 2011”. Include ASCII code of spaces between words in the resultant ASCII. Are these codes same as that used in Unicode? (2 Marks) Ans: 43h6fh70h79h72h69h67h68h74h20h28h43h29h20h32h30h30h30h20h32h ...

Words: 7501 - Pages: 31

Free Essay

Proposal

...SI, DI, BP. combining these registers inside [ ] symbols, we can get different memory locations. these combinations are supported (addressing modes): [BX + SI] [BX + DI] [BP + SI] [BP + DI] | [SI] [DI] d16 (variable offset only) [BX] | [BX + SI + d8] [BX + DI + d8] [BP + SI + d8] [BP + DI + d8] | [SI + d8] [DI + d8] [BP + d8] [BX + d8] | [BX + SI + d16] [BX + DI + d16] [BP + SI + d16] [BP + DI + d16] | [SI + d16] [DI + d16] [BP + d16] [BX + d16] | d8 - stays for 8 bit signed immediate displacement (for example: 22, 55h, -1, etc...) d16 - stays for 16 bit signed immediate displacement (for example: 300, 5517h, -259, etc...). displacement can be a immediate value or offset of a variable, or even both. if there are several values, assembler evaluates all values and calculates a single immediate value.. displacement can be inside or outside of the [ ] symbols, assembler generates the same machine code for both ways. displacement is a signed value, so it can be both positive or negative. generally the compiler takes care about difference between d8 and d16, and generates the required machine code. for example, let's assume that DS = 100, BX = 30, SI = 70. The following addressing mode: [BX + SI] + 25 is calculated by processor to this physical address: 100 * 16 + 30 + 70 + 25 = 1725. by default DS segment register is used for all modes except those with BP register, for these SS segment register is used. there is an easy way to remember all those possible combinations...

Words: 2749 - Pages: 11

Premium Essay

Advanced Networks

...topology that will support ABC’s needs. In addition to meeting the specified needs, be sure to consider security. 1. Explain why you think your design meets the needs of ABC. 2. List the major user communities for your design. 3. List the major data stores and the user communities for each data store. 4. Identify major network traffic flows in your network topology drawing. 5. How does your design provide security for ABC’s network? 6. What questions will you ask ABC about this project as you do your work? ____________________________________________________________ Exercise 4: Duration: 3 weeks Ip Addressing: Solve the following questions. Use of online IP calculators is strictly prohibited. You must include evidence of calculation. Q1- Separate the network portion of these addresses (assumed class based IP addressing)  177.100.18.6  10.15.123.25  223.250.200.222  95.0.21.90  33.0.0.0  171.120.77.77 Q2- Write...

Words: 875 - Pages: 4

Premium Essay

Subnet and Router Configuration

...mask I would use is 255.255.252.0 this will give me 64 available subnets for growth along with 1,022 hosts per subnet I know that’s a little more than 580 hosts but in my mind having doubled that wouldn’t hurt. This will make my first host IP address be 154.78.0.1 and my last host address be 154.78.3.254 leaving 154.78.3.255 my broadcast address and 154.78.0.0 my network address. Indicate the steps and command that you would use to access and configure the router/switch. Configuring the Fast Ethernet Interface Steps | Command | Purpose | 1 | Router>enable | EXEC Mode, Privileged/pswd | 2 | Router# configure terminal | global configuration mode | 3 | Router# show ip interface brief | brief status of the interfaces that are configured for IP | 4 | Router(config)# interface fastethernet Router(config)# interface gigabitethernet | Specifies the Ethernet interface and enters interface configuration mode.(for interface numbering it will be in router guide that was shipped with your router) | 5 | Router(config-if)# ip address154.78.00 - 255.255.252.0 | Sets a primary IP address for an interface | 6 | Router(config)# end | Returns me to EXEC | 7 | Router# show ip interface...

Words: 423 - Pages: 2

Premium Essay

Ccna

...Device | Interface | IP Address | Subnet Mask | Default Gateway | Building1 | G0/0 |  172.31.103.1 |  255.255.255.240 | N/A | | G0/1 |  172.31.103.33 |   | N/A | | S0/0/0 |  172.31.103.97 |   | N/A | Building2 | G0/0 |  172.31.103.65 |  255.255.255.240 | N/A | | G0/1 |  172.31.103.81 |  255.255.255.240 | N/A | | S0/0/0 |  172.31.103.98 |  255.255.255.252 | N/A | ASW-1 | VLAN 1 |  172.31.103.2 | 225.255.255.224 |   | ASW-2 | VLAN 1 |  172.31.103.34 |   |   | ASW-3 | VLAN 1 |  172.31.103.66 |  255.255.255.240 |   | ASW-4 | VLAN 1 |  172.31.103.95 |   |   | Host-A | NIC |  172.31.103.30 |   |  172.31.103.1 | Host-B | NIC |  172.31.103.62 |   |  172.31.103.33 | Host-C | NIC |  172.31.103.78 |   |   172.31.103.65 | Host-D | NIC |  172.31.103.94 |   |  172.31.103.94 | 172.31.103.0/24 172.31.103.0 255.255.255.224 172.31.103.32 172.31.103.64 172.31.103.96 172.31.103.128 Subnet Number Subnet Address First Usable Host Address Last Usable Host Address Broadcast Address 0 192.168.100.0 192.168.100.1 192.168.100.30 192.168.100.31 1 192.168.100.32 192.168.100.33 192.168.100.62 192.168.100.63 2 192.168.100.64 192.168.100.65 192.168.100.94 192.168.100.95 3 192.168.100.96 192.168.100.97 192.168.100.126 192.168.100.127 4 192.168.100.128 192.168.100.129 192.168.100.158 192.168.100.159 5 6 7 8 9...

Words: 294 - Pages: 2

Premium Essay

Nt1210 Unit 8

...NT1210 Unit 8 Assignment 1 Practice #1 Give an IP address and number of bits borrowed (from the host for the subnet mask), Find the following information. Host Address 200.17.15.10 Network Class C SN Mask 255255255224 Network Address 200.17.15.0 Bits Bono wed 3 SNs Created 524288 Usable SNs | 8 | | Hosts perSN | 32 | Usable Host^N 30 | Subnet No. | Network ID | First Host IP | Last Host IP | Broadcast Address | 0 | 200.17.15.0 | 200.17.15.1 | 200.17.15.30 | 200.17.15.31 | 1 | 200.17.15.32 | 200.17.15.33 | 200.17.15.62 | 200.17.15.63 | 2 | 200.17.15.64 | 200.17.15.65 | 200.17.15.92 | 200.17.15.93 | 3 | 200.17.15.94 | 200.17.15.95 | 200.17.15.124 | 200.17.15.125 | 4 | 200.17.15.126 | 200.17.15.127 | 200.17.15.156 | 200.17.15.157 | 5 | 200.17.15.158 | 200.17.15.159 | 200.17.15.188 | 200.17.15.189 | 6 | 200.17.15.190 | 200.17.15.191 | 200.17.15.220 | 200.17.15221 | 7 | 200.17.15.222 | 200.17.15.223 | 200.17.15.252 | 200.17.15253 | Practice #2 Given an address and subnet mask, find the Following information. Host Add ness | 152.12.14.18 | Network Class | B | SN Mask | 255.255.255.240 | Net wotk Address | 152.12.14.16 | Bits Borrowed | 4 | SNsCieated | 1048576 | UsableSNs | 16 | | | Hosts perSN | 16 | Usable HosWSN | 14 | Subnet No. | Network ID | Rrst Host IP | Last Host IP | Broadcast Address | 0 | 152.12.14.16 | 152.12.14.17 | 152.12.14.30 | 152.12.14.31 | 1 | 152.12.14.32 | 152.12.14.33 | 152.12.14.46 | 152.12.14.47 | 2...

Words: 473 - Pages: 2

Premium Essay

Statistical Report for Aj Davis Department Chain Store

...TABLE OF CONTENTS 1.0 Introduction 2.0 Individual Variable: Income 3.0 Individual Variable: Size 4.0 Individual Variable: Credit Balance($) 5.0 Pairing of Variables: Income($1000) vs. Years 6.0 Pairing of Variables: Credit Balance($) vs. Income($1000) 7.0 Pairing of Variables: Credit Balance($) vs. Location 8.0 Conclusion 9.0 References List 1.0 Introduction This report is done base on a sample of 50 credit customers with AJ DAVIS is selected with data collected base on five variables as following: • Location (Rural, Urban, Suburban) • Income (in $1,000's) • Size (Household Size, meaning number of people living in the household) • Years (the number of years that the customer has lived in the current location) • Credit Balance (the customers current credit card balance on the store's credit card, in $). To have more understand of what the data truly mean, three of individual variable and three of pairing variable are analyzed by using numerical techniques of summarization as and graphical such as stem-leaf diagram, histogram, boxplot, and bar chart on this report. Since a bar graph is useful...

Words: 1795 - Pages: 8

Free Essay

Social Worker

...our results from the TKI to learn new conflict resolution skills. Frequently, our emotions and desires can make communication difficult. Use the Thomas-Kilmann questionnaire to learn what others are doing in those situations and learn to understand your own behavior during tense moments. You can master these challenges with knowledge and practice.   The Five Conflict-Handling Modes The Thomas-Kilmann Conflict Mode Instrument (TKI) assesses an individual’s behavior in conflict situations—that is, situations in which the concerns of two people appear to be incompatible. In conflict situations, we can describe a person’s behavior along two basic dimensions*: (1) assertiveness, the extent to which the individual attempts to satisfy his or her own concerns, and (2) cooperativeness, the extent to which the individual attempts to satisfy the other person’s concerns. These two dimensions of behavior can be used to define five methods of dealing with conflict. These five conflict-handling modes are shown below: C O M P E T I N G Competing is assertive and uncooperative, a power-oriented mode. When competing, an individual pursues his or her own concerns at the other person’s expense, using whatever power seems appropriate to win his or her position. Competing might mean standing up for your rights, defending a position you believe is correct, or simply trying to win. C O L L A B O R A T I N G Collaborating is both assertive and cooperative. When collaborating...

Words: 916 - Pages: 4

Premium Essay

Finance

...Data From Water Park | Type of Guest | % of visitors during peak season | Singles under 25 | 25 | Singles over 25 | 12 | Couples under 25 | 6 | Couples over 25 | 18 | Family groups | 39 | Statistics Assignment Part 1 a) We have obtained the data from both hotel and water park on the basis of number of visitors categorised according to their age groups during peak season. The data has been graphically presented below to compare and see if water park is a suitable excursion place for holiday makers to stay at the hotel. Data From Hotel | Type of Guest | % of visitors during peak season | Singles under 25 | 17 | Singles over 25 | 9 | Couples under 25 | 3 | Couples over 25 | 20 | Family groups | 51 | Graphical representation of both the data obtained from hotel and the water park are given below; From the graphs above, it is clear that the number of visitors according to their categories are similar in both hotel and the water park. Both for hotel and water park data we see that good number of visitors in hotel as well as water park are couples and family group. The graphical representation for the number of visitors for both hotel and water park shows increasing order from couples under 25 to couples over 25 and then to family groups. Whereas, the graphical representation of visitors number who are single is declining for hotel and water park too. This shows that the water park is attraction point for couples and mainly family group...

Words: 1881 - Pages: 8