Question

2       .global main 3       .func main 4       .data 5       .balign 4 6       mess:   .asciz

2       .global main

3       .func main

4       .data

5       .balign 4

6       mess:   .asciz "?"

7       a:          .word   ?

8       b:           .word   ?

9       result: .word   0

10

11      .text

12      main:

13              push {lr}

14              ldr r0,=mess           @r0 gets address of mess

15              ldr r1,=a                 @r1 gets address of a

16              ldr r2,=b                 @r2 gets the address of b

17              ldr r1,[r1]               @r1 gets the value of a

18              ldr r2,[r2]               @r2 gets the value of b

19              add r0,r1,r2           @add the value of a and b

20              ldr r1, =result         @r1 gets the address of result

21              str r0,[r1]               @result gets a+b

23              bx lr

                     

                     

  1. The address of the variable mess is 0x21024                                                                            
  2. The address of the variable a is: 0x2104a                                                                                    
  3. The address of the variable b is 0x2104e

The address of the variable result is 0x21052

Given the following memory dump, What is the message stored in the variable mess.                      

                   0x21024:        0x54    0x68    0x61    0x74    0x20    0x77    0x68    0x61

                   0x2102c:        0x74    0x20    0x69    0x73    0x20    0x77   0x68    0x69

                   0x21034:        0x63    0x68    0x20    0x61    0x6e    0x64    0x20    0x77

                   0x2103c:        0x68    0x69    0x63    0x68    0x20    0x69    0x73    0x20

                   0x21044:        0x77    0x68    0x61    0x74    0x3f    0x00    0xd3    0xff

                   0x2104c:        0xff      0xff      0x20    0x00    0x00    0x00    0xf3     0xff

                   0x21054:        0xff      0xff

  1. What is the value in decimal of the variable a? (Show your work for full credit)                
  2. What is the value in decimal of the variable b? (Show your work for full credit)   
  3. What is the value in decimal of the variable result? (Show your work for full credit)   
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Variable a:

Address of variable a = 0x2104a
Value at address 0x2104a = 0xd3
Value at address 0x2104a in decimal = d*161 + 3*160 = 13*16 + 3*1 = 208 + 3 = 211
Value in decimal of the variable a = 211

[Since the numbers are in Hexadecimal format, the index is 16. And D corresponds to 13 in decimal numbers]

Variable b:

Address of variable b = 0x2104e
Value at address 0x2104e = 0x20
Value at address 0x2104e in decimal = 2*161 + 0*160 = 2*161 + 0*1 = 32 + 0 = 32
Value in decimal of the variable b = 32

[Since the numbers are in Hexadecimal format, the index is 16]

Variable result:

Address of variable result = 0x21052
Value at address 0x21052 = 0xf3
Value at address 0x21052 in decimal = f*161 + 3*160 = 15*16 + 3*1 = 240 + 3 = 243
Value in decimal of the variable result = 243

[Since the numbers are in Hexadecimal format, the index is 16. And F corresponds to 15 in decimal numbers]

A thumbs-up/up-vote would be greatly appreciated!

Add a comment
Know the answer?
Add Answer to:
2       .global main 3       .func main 4       .data 5       .balign 4 6       mess:   .asciz
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
  • LC3 stack (factorial) I need help in writing factorial in Lc3 language by using stack.. ; Begin ...

    LC3 stack (factorial) I need help in writing factorial in Lc3 language by using stack.. ; Begin reserved section: do not change ANYTHING in reserved section! .ORIG x3000 BR Main ; Parameter and result Param .FILL x0004 Result .BLKW 1 ; Constants Stack .FILL x4000 One .FILL #1 MinusOne .FILL #-1 ; End reserved section: do not change ANYTHING in reserved section! ;------------------------------------------------------------------------------- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; int Factorial(int N) ; Returns N! (must be a recursive function) ; Factorial ;__________________...

  • The Fibonacci sequence F is defined as F(1) = F(2) = 1 and for n>= 2,...

    The Fibonacci sequence F is defined as F(1) = F(2) = 1 and for n>= 2, F(n + 1) = F(n) + F(n − 1) i.e., the (n + 1)th value is given by the sum of the nth value and the (n − 1)th value. 1. Write an assembly program typical of RISC machines for computing the kth value F(k), where k is a natural number greater than 2 loaded from a memory location M, and storing the result...

  • LC-3 Programming Help!! The Stack Protocol The following outline is the protocol for passing arguments to...

    LC-3 Programming Help!! The Stack Protocol The following outline is the protocol for passing arguments to a function and returning values. Everything is stored on the runtime stack so that space is used only when the function is executing. As a result the actual address of arguments and locals may change from call to call. However, the layout of the stack frame (activation record) is constant. Thus, the offests from the frame pointer (FP) to the parameters/locals are constant. All...

  • I want to calculate Y[2]=X[3]+X[4] I'm not sure that I wrote right codes. .text main ....

    I want to calculate Y[2]=X[3]+X[4] I'm not sure that I wrote right codes. .text main . la $50, x #get base address of x la $s1, y #get base address of y lw $to, 12 ($50)#get data from memory of x[3] lw $t1 , 1 6($50) #get data from memory of x[4] add $t2, $t0, $t1 sw $t2, 8($51 ) #store result to y[2] li $v0, 10 #exit program syscall data x: word 5, 1, 17,-4, 6, 3 y: .word...

  • Accumulation Pattern Problem 2 Consider the code below. 1 2 3 4 5 6 7 8...

    Accumulation Pattern Problem 2 Consider the code below. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 labs = ['lab1', 'lab2', 'lab3', 'lab4', 'lab5', 'lab6', 'lab7', 'lab8', 'lab9'] graded = '' for lab in labs:     lab_num = int(lab[3])     if lab_num < 4:         graded = graded + lab + ' is simple\n'     elif lab_num < 7:         graded = graded + lab + ' is ok\n'     else:         graded = graded + lab + ' is complex\n'         ...

  • Number in Family 4 4 5 2 8 3 4 6 1 3 7 4 4...

    Number in Family 4 4 5 2 8 3 4 6 1 3 7 4 4 3 5 2 4 5 4 3 3 3 6 6 2 6 7 3 2 3 8 5 5 4 3 4 5 4 5 4 8 5 4 4 6 5 6 4 5 2 3 3 6 5 7 3 7 4 2 4 7 8 4 6 4 2 6 3 2 7 4 6 5 4 4 4 3...

  • 4 5 2 2 0.5 2.5 1 2 3.5 6 1.5 2 1 6.5 7 3...

    4 5 2 2 0.5 2.5 1 2 3.5 6 1.5 2 1 6.5 7 3 3 3 1 1.54 6.5 3 2 4 1 2 2 2.5 4 7 1 5 1 2 3 5 7 1 4 6 1.5 2 2 2 2 2 0.5 2 5 4 2 1 2.5 6 2.5 1 4 4 Use the data set provided in the main page of the experience for this application. 1. Complete the full hypothesis testing procedure...

  • Using this data of hours worked per day by employees; 2 Hours 11 Days,, 3 hours 9 days, 4 hours 17 days, 5 hours 7 days, 6 hours 6 days Construct a probability distribution Include. A the definition o...

    Using this data of hours worked per day by employees; 2 Hours 11 Days,, 3 hours 9 days, 4 hours 17 days, 5 hours 7 days, 6 hours 6 days Construct a probability distribution Include. A the definition of the random variable B. All Possible outcomes Probability for each value of the random variable Verify it is a legitimate probability distribution. Calculate the mean of the probability distribution (show steps) Calculate the standard deviation of the probability distribution(show steps)

  • someone has answered 1-6 already...but the #1-2 needs 2 answers not just 1 for some reason....

    someone has answered 1-6 already...but the #1-2 needs 2 answers not just 1 for some reason. Hi everyone! I have a physics teacher that isn't willing to help me understand any of this. He hasn't posted what chapters in the textbook and the handout l'm assuming he is referring to is a complete joke! l've printed off everything he posted and I'm lost. There isn't anything there that shows how to do this homework assignment. l've reached out on here...

  • Comprehensive Problem 6-52 (LO 6-1, LO 6-2, LO 6-3) [The following information applies to the questions...

    Comprehensive Problem 6-52 (LO 6-1, LO 6-2, LO 6-3) [The following information applies to the questions displayed below.] Read the following letter and help Shady Slim with his tax situation. Please assume that his gross income is $172,900 (which consists only of salary) for purposes of this problem. December 31, 2019 To the friendly student tax preparer: Hi, it’s Shady Slim again. I just got back from my 55th birthday party, and I’m told that you need some more information...

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