Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started