Explain the register-displacement addressing mode

Assignment Help Assembly Language
Reference no: EM131870507

Assignment

Part 1

1. A 32-bit word 112233FA(16)  is stored in a byte-addressed little endian main memory at address 100(16). The byte 33 is stored at address ......101(16).......

2. Explain the register-displacement addressing mode. What stands for PC-relative addressing mode?

3. Assume an ARM-like CPU but with only 8-bit registers and ALU.  In register r0 a byte is stored 1000 0000, in r1=0000 0010. The CPU performs the following instruction

ADD r2, r0, r1.

Perform the binary addition and provide the decimal value of the result assuming that:

a. The numbers in r0 and r1 are unsigned:

b. The numbers in r0 and r1 are signed:

Part 2. ARM assembly programming

Remark: Assume that the variables are loaded in some registers.

4. Write in ARM assembly language the following operations without using multiplication instruction (5p. each)

4.1. A * 17
4.2. A * 23

5. In ARM assembly program of only two instructions (addition and/or subtraction) implement the following calculation: a*105 (hint: 105=15*7).

6.  Write an ARM assembly program that performs the following pseudo code. Assume that the variables are already loaded in some registers.

If (a==b) AND (c==d) then d = a +b + c + 1

7.  In ARM assembly program calculate the absolute value of some variable a.

Hint: The pseudo code is: 

if a<o then a=0-a.

8. Suppose that register r0 contains 0x20001400. Show the value (binary or hexadecimal) in the destination registers after every instruction. What is the final value of r2 after the execution of this peace of code?

                             MOVS r2, #0
                             ADD r2, r2, r0
Equal                     ADDLT r2, r2, #2
                             MOVNE r2, #&ABCD
                             MOV  r2, #&FF
OK                         ;r2= . . . .  .

9. Binary value 0xFFFFFFFF is loaded in r0 and 0x3FF80000 in r1. Show the value (binary or hexadecimal) in the destination register after every instruction. What is the final binary value in r2 after the following code? Considering the value in r2 as a signed number, what is the decimal value in r2?

start         MOV  r6,#0
                ADDS   r6, r6, #0
                MOV    r2, #&5
MOVS r2,  #FF, ROR 8
Equal        MOVPL r2, #2
Done        MVNEQ r2, #3
               MOVCS r2, #&FF
OK           ;r2= . . . .  .

10.  Binary value 0xAB1FFFF2 is loaded in r0 and 0x3FF80000 in r1. Show the value (binary or hexadecimal) in every destination register after every instruction. What is the final binary value in r2 after the following code? Considering the value in r2 as a signed number, what is the decimal value in r2?

start         MOV  r6,#0
                ADDS   r6, r6, #0
MOV r2, #0
                ADD r3, r0, r1
                MVNGE r2, #2
                MVNMI r2, #3
OK            ;r2= . . . .  .

11. Trace the following program and declare what will be the value in r0. Show the hexadecimal values in registers r0, r5, r6 and r7 after every instruction that is executed and changes some of those registers. Show the values of the flags after every instruction that changes the flags.

start          MOV  r6,#0
                 ADDS   r6, r6, #0
        MOV  r0, #&FF
MOV   r5, #0x7F
                 MOV     r5, r5, ROR #8
                 MOV     r6, r5
                 ADDS    r7, r5, r6
                 MOVGE                r0, #0xE5
                 ...

12. Write ARM assembly program that performs the following pseudo code. It converts an unsigned integer 0≤i≤15 to a hexadecimal character c. Assume that the variables are already loaded in some registers.

       IF (i<10) c= i +'0'           ;if the digit is 0 to 9
       ELSE c =i + "A" -10        ;If the number is 10 to 15.

Reference no: EM131870507

Questions Cloud

Describe tcp and udp : Please explain in detail for me. Describe TCP and UDP, and how they differ. Why do both protocols exist?
What is your investment recommendation show calculations : ROSS estimates a 25% probability for a successful exit, with an expected exit time in 3 years. What is your investment recommendation? Show calculations
Why not have mandatory ergonomics standards : Environmental and Industrial Safety. Consider facts such as, many ergonomic issues are related to manual labor and repetitive assembly operations.
Creating python applications : Edit your Python program using your choice of editor such as Notepad, Notepad++, or Idle.
Explain the register-displacement addressing mode : Explain the register-displacement addressing mode. What stands for PC-relative addressing mode? Perform the binary addition and provide the decimal value.
Issue about the american healthcare system : Identify a current issue being debated about the American healthcare system and Explain two competing solutions to this problem
Compute the percentage total return : Suppose a stock had an initial price of $83 per share, paid a dividend of $1.40 per share during the year, Compute the percentage total return
Discuss ethnocentric or polycentric staffing approach : Employment regulations vary across countries. Assume that you've started to expand your company's operations into India and China.
Describe aspects of ipv6 that allow for more addresses : Describe aspects of IPv6 that allow for more addresses than IPv4. Do you think the world will run out of IP addresses with IPv6?

Reviews

Write a Review

Assembly Language Questions & Answers

  Wrote a new value into the Timer or Counter register

ECE 375: Computer Organization and Assembly Language Programming Lab - Timer/Counters. In this lab, you used the Fast PWM mode of both 8-bit Timer/Counters

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  A screenshot of the modified assembly code

Modify the program to step the lights through a realistic sequence. Include conditional statements that ensure that assembly program only executes for 10 times.

  Write a program sequence that places the value in address

write a program sequence that places the value in address 1000 into accumulator a and places the value in address 1001

  Calculates the odds of winning any of the lottery jackpot

Calculates the odds of winning any of the lottery jackpot grand prizes. The calculated value is to be displayed on the QtSpim console screen with an appropriate commentary text. Such as "The odds are 1 in nnnn."

  Prepare a assembly program to initialize the led outputs

Write a main.asm file in PSoC designer. Make sure to have the subsequent in place - Initialize the LED outputs to 0's and Set the corresponding bit in INT_MSK0 to 1.

  Analog measurements prepare an assembly program for the

analog measurements prepare an assembly program for the correctly measures the wind direction to a precision of 45deg n

  Convert an integer decimal number to a binary number

You can convert an integer decimal number to a binary number by a recurrsive algorithm. Binary(X) Simple cases: If X is 0, the binary of X is 0. If X is 1, the binary of X is 1.

  Problems does an assembler have to overcome

What problems does an assembler have to overcome in order to produce complete binary code with only one pass over the source code? How would code written for a one-pass assembler be different from code written for a two-pass assembler?

  Write a mips program that uses a recursive implementation

Write a MIPS program that uses a recursive implementation of quick sort to sort an array of numbers. The values of the array will be given to you via standard input.

  Cache statistics for two versions of matrix multiplication

Explore the cache statistics for two versions of matrix multiplication - Cache can be configured using the preference in ARMSim. For getting cache statistics, first put a breakpoint on SWI 0x11 instruction, and then note the statistics from cache

  Create a program that uses ia-32 assembly language

create a program that usesIA-32 assembly language. It converts integers in the array X to its hex string ad save its to array Y in the respictive locations.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd