Question

Assignment 4: Answer the following questions with reference to the assembly program below. Before the code is executed, the i

0 0
Add a comment Improve this question Transcribed image text
Answer #1

immediate pre-indexed mode is used in LDRH where this instruction is load in regster half word of 16 bits. This means that ! will reflect back the address in base register.

LDRH R1, [R0,#2]!

R1 = [R0 + 2] = 0x0304

R0 is updated with +2 = 0x2000.0002

LDRH R2, [R0,#2]!

R2 = [R0+2] = 0x0506

R0 is updated with +2 = 0x2000.0004

ADD R3,R1,R2

R3 = 0x0304 + 0x0506

hex addition

R3 = 0x080A

STR R3, [R0]

is a 32 bit instruction so it will store value from R3 to 4 bytes address of R0

0x2000.0004 will point to 0x0A

0x2000.0005 will point to 0x08

0x2000.0006 will point to 0x00

0x2000.0007 will point to 0x00

1)After execution the values are

Register Value
R0 0x2000.0004
R1 0x0304
R2 0x0506
R3 0x080A

2)Content of memory

Address Value
0x2000.0000 0x01
0x2000.0001 0x02
0x2000.0002 0x03
0x2000.0003 0x04

0x2000.0004

0x0A
0x2000.0005 0x08
0x2000.0006 0x00
0x2000.0007 0x00
Add a comment
Know the answer?
Add Answer to:
Assignment 4: Answer the following questions with reference to the assembly program below. Before the code...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • indicate what each line of code means 2. Explain how the following ARM program can be...

    indicate what each line of code means 2. Explain how the following ARM program can be used to determine whether a computer is big- endian or little-endian: MOV R0, #100 LDR R1, -0xABCD876 STR R1, [RO] LDRB R2, [R0, #1] R1-0xABCD876

  • Problem: On an ARM processor using big endian format, given the following memory map and [R1]...

    Problem: On an ARM processor using big endian format, given the following memory map and [R1] = 0xA10E0C2D, [R2] = 0x00000060, [R3] = 0x00000002, [R4] = 0x0000000C, predict [R1] and [R2] and draw the updated memory map after an ARM data transfer instruction is executed in EACH case. (hint: (1) in this map, each memory location is a word long and occupies 4 bytes; also you only need to draw the section of the memory including the changed word and...

  • Problem: On an ARM processor using big endian format, given the following memory map and [R1]...

    Problem: On an ARM processor using big endian format, given the following memory map and [R1] = 0xA10E0C2D, [R2] = 0x00000060, [R3] = 0x00000002, [R4] = 0x0000000C, predict [R1] and [R2] and draw the updated memory map after an ARM data transfer instruction is executed in EACH case. (hint: (1) in this map, each memory location is a word long and occupies 4 bytes; also you only need to draw the section of the memory including the changed word and...

  • A C program has been compiled into the Atmel AVR assembly language. The following instruction, which...

    A C program has been compiled into the Atmel AVR assembly language. The following instruction, which is located at address 0x002A, is executed: i.) What is the binary value contained in the instruction register (IR) when the instruction is executed? ii.) What is the hexadecimal value of the program counter (PC) when the instruction is executed? iii.) If register r1 = 0x40 and register r2 = 0x02 prior to executing the instruction, what are the contents of r1 and r2...

  • computer systems!! pls answer soon 2) Determine the content of memory location named RESULT after execution of eac...

    computer systems!! pls answer soon 2) Determine the content of memory location named RESULT after execution of each of the following codes: Program B TEXT TEXT LDR R1,-NUM LDR RO, A LDR R2.-N LDR RI.R LDR R2.[R2) MUL RO. RI, RO MOV RO, RO LDR R1. C LOOP: LDR R3, [RII. "4 LDR R2, D MULA RO. R1, R2, RO ADDPL Ra, R0, #1 RO, RESULT STR SUBS R2, R2, #1 S: B S BNE LOOP DATA STR R0,-RESULT A:...

  • Problem: On an ARM processor using big endian format, given the following memory map and [R1]...

    Problem: On an ARM processor using big endian format, given the following memory map and [R1] = 0xA10E0C2D, [R2] = 0x00000060, [R3] = 0x00000002, [R4] = 0x0000000C, predict [R1] and [R2] and draw the updated memory map after an ARM data transfer instruction is executed in EACH case. (hint: (1) in this map, each memory location is a word long and occupies 4 bytes; also you only need to draw the section of the memory including the changed word and...

  • . For the following operations in the ARC tool program bellow 11. (10 pts) For the...

    . For the following operations in the ARC tool program bellow 11. (10 pts) For the following operations in the ARCTool program below: the instruction he is defined in table 4, 10 as branch equal ( the instruction bu is defined as branch always: ) Write the instruction the program jumps to when be here+4 branches on the 1st pass through the code? Answer a. b. Write the instruction the program jumps to when ba here-4 completes its branch? Answer...

  • The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem....

    The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: The architecture fully supports forwarding, Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism, Register R4 is initially 100. L1:  lw    R1, 0(R4)   add   R3, R1, R2 sw   ...

  • Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at...

    Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper 1. (5 marks) Consider the following assembly instruction STMFD r13!, (r5-6} Before executing this instruction, registers hold the following values: Register Value Register r9 Value r4 0x00400040 0x00000000 r5 r10 0x11223344 0x00800080 r6 0x55667788 r11 0x10001000 r7 0x99aabbcc r12 0x20002000 r8 exddeeff00 r13 ex40004000 What memory locations are affected after executing the above instruction? In a table, with a...

  • CS 304- Quiz 3 (Chapter 4) Time: 45 Minutes (Closed book & notes) Answer all questions clearly Na...

    CS 304- Quiz 3 (Chapter 4) Time: 45 Minutes (Closed book & notes) Answer all questions clearly Name: The following transfer statements related to a memory. Explain the memory operation in each case. Also, Table 1, provided a snap shot of the memory and R1 0000, R2-0072, R3-0016, R5-4972, and AR-0015, what will be the values of R1, R2, R3, R5, and AR after the execution of each instruction. 1. a. R2 EM[AR] Table 1 - Memory Snapshot Memory Address...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT