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
  • 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'         ...

  • Please use Visual Studio! Let me know if you need anything else <3 #include <stdio.h> #include...

    Please use Visual Studio! Let me know if you need anything else <3 #include <stdio.h> #include <string.h> #pragma warning(disable : 4996) // compiler directive for Visual Studio only // Read before you start: // You are given a partially complete program. Complete the functions in order for this program to work successfully. // All instructions are given above the required functions, please read them and follow them carefully. // You shoud not modify the function return types or parameters. //...

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