Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone tell me what did I do wrong offer here? I'm working on ARM MSP432 assembly this is my code .thumb .data NUMNEG .word

image text in transcribed Can someone tell me what did I do wrong offer here? I'm working on ARM MSP432 assembly

this is my code

.thumb

.data

NUMNEG .word 0

TOTAL .word 0

SBLK .word 1,126,-8,-63,-44,-115,28 ; Source block (initialized)

SBLKEND .word -1 ; Source block end

DBLK .usect ".bss",2,2 ; Destination block (uninitialized)

.text

SBLKPTR .word SBLK ; Pointer to beginning of Source Block

DBLKPTR .word DBLK ; Pointer to beginning of Destination Block

SBLKENDPTR .word SBLKEND ; Pointer to ending of Source Block

NUMNEGPTR .word NUMNEG ; Pointer to NUMNEG

TOTALPTR .word TOTAL ; Pointer to TOTAL

.global asm_main

.thumbfunc asm_main

asm_main: .asmfunc ; ASM main

ldr r1, SBLKPTR

ldr r2, DBLKPTR

ldr r3, NUMNEGPTR

ldr r4, TOTALPTR

ldr r5, SBLKENDPTR

mov r6, #0

loop:

ldr r0, [r1, r6]

str r0, [r2, r6]

add r6, #4

bmi NN

return:

add r7, #1 ; TOTAL++

str r7, [r4]

cmn r0, r5

bne loop

nop

NN:

add r8, #1 ;NUMNEGPTR ++

str r8, [r3]

b return

.endasmfunc

.end

reate a program that will copy a block of data from one location to another one byte at a timOli.e., USING A LOOP). The program must follow these requirements . You must use all the pointers . Stop the transfer when SBLKENDPTR is reached . The program should count the number of negative values that are transferred to the destination. The final count should be stored in a variable NUMNEG. . The program should also count the total number of values transferred and put this final count value in a variable TOTAL. . The program must contain at least one loop using conditional branch command(s) How memory should look after execution:1 Copy from Source Block to Destination Block Source Block (SBLK) Destination Block (DBLK) SBLKPTR DBLKPTR 0x2000.0040 0x2000.0008 0x2000.000C 0x2000.0010 0x2000.0014 0x2000.0018 0x2000.001C 0x2000.0020 SBLKENDPTR_ 0x2000.0024 0 0 126 0x2000.0044 0x2000.0048 0x2000.004C 0x2000.0050 0x2000.0054 0x2000.0058 126 -63 -44 115 28 63 115 28 NUMNEGPTR 0x2000.0000 4 TOTALPTR | 0x2000.0004 7

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

1. Write down two or three of your greatest strengths.

Answered: 1 week ago

Question

What roles have these individuals played in your life?

Answered: 1 week ago

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago