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

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

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