Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code displayed in Figure 1 implements a program that sets the content of a memory array with a sequence of values. This program is

The code displayed in Figure 1 implements a program that sets the content of a memory array with a sequence of values. This program is useful for initializing the memory with specific values. Figure 2 shows the assembled program in the ARMSim simulator. Try to simulate the program in your mind instruction by instruction and answer the questions below. You can also download the program at

iLearn -> References -> ARMSim -> A2.s and simulate it in ARMSim to verify your answer.

11 12 13 14 15 22288285855 21 16 17 18 19 20 loop: 23 24 8------Assembler Directives-- Data Variables 26 .DATA Values: .WORD 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 8 the values to be stored in the memory array .EQU M, 0x00002000 M is the beginning address of the memory array 8 Code .TEXT ------End of Assembler Directives-- Start: LDR R1, -M LDR RO, Values MOV R3, #6 8R3 is a parameter which holds the value of the number of entries in the memory array BL men set @branch to subroutine mem_set to set the content of the memory array SWI 0x11 @stop program execution 8 set the content of the memory array @clear R4 MOV RA, #0 LDR R2, [RO], #4 STR R2, [R1], # ADDS R4, R1, #1 CMP R4, R3 BMI loop BX LR A2. 00001034: 00001014: Assembler Directives Data Variables .DATA Values: WORD 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 EQU M, 0x00002000 00001000:E3A01A02 Start: LDR R1, M 00001004:E59F0024 LDR 00001008:E3A03006 MOV 0000100C:EB000000 00001010:EF000011 00001024:E1540003 00001028:4AFFFFFA 0000102C:E12FFF1E Code .TEXT End of Assembler Directives-- BL SWI mem_set: 00001014:E3A04000 MOV 00001018:E4902004 loop: LDR 0000101C:E4812004 00001020:2944001 STR ADDS CMP BMI BX RO, -Values R3, #6 mem_set 0x11 R4, #0 R2, [RO], #4 R2, [R1], #4 R4, R4, #1 R4, R3 loop LR the values to be stored in the memory array M is the beginning address of the memory array @R3 is a parameter which holds the value of the number of entries in the memory array branch to subroutine mem_set to set the content of the memory array stop program execution @set the content of the memory array @clear R4

Step by Step Solution

3.32 Rating (122 Votes )

There are 3 Steps involved in it

Step: 1

1 The beginning address of the word list Values is 0000... blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Document Format ( 2 attachments)

PDF file Icon
609474f86157c_24865.pdf

180 KBs PDF File

Word file Icon
609474f86157c_24865.docx

120 KBs Word File

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Corporate Finance

Authors: Stephen Ross, Randolph Westerfield, Jeffrey Jaffe

10th edition

978-0077511388, 78034779, 9780077511340, 77511387, 9780078034770, 77511344, 978-0077861759

More Books

Students also viewed these Programming questions

Question

6.66 Find zo such that P(-zo

Answered: 1 week ago

Question

Why do firms issue convertible bonds and bonds with warrants?

Answered: 1 week ago