Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code A MOV r0,#256 LDRB r1,Table Loop LDRB r2,[r1] ;load a byte LSLB r2,r2,#2 ;multiply if by 4 ADDB r2,r2,#1 ;add 1 STRB r2,[r1] ;store

Code A

MOV r0,#256

LDRB r1,Table

Loop LDRB r2,[r1] ;load a byte

LSLB r2,r2,#2 ;multiply if by 4

ADDB r2,r2,#1 ;add 1

STRB r2,[r1] ;store it

ADDB r1,r1,#1 ;increment the pointer

SUBS r0,r0,#1 ;subtract 1 from the loop count

BNE Loop ;repeat

Code B

MOV r0,#64

LDR r1,Table

Loop PLDRB r2,[r1] ;parallel load 4 bytes

PADDAB r2,#1 ;parallel add 1 to each byte

PLSLB r2,#2 ;parallel shift 4 bytes

STRB r2,[r1,#1]! ;store it

COUNT r0,Loop

Explain each line of this code

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 Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions