Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Combine these two ARM (assembly) code to make the led lights go back and forth. First code: LED go from right to left. .include address_map_arm.s

Combine these two ARM (assembly) code to make the led lights go back and forth.

First code: LED go from right to left.

.include "address_map_arm.s"

.text /* executable code follows */ .global _start _start: LDR R2, =LED_BASE // base address of LED lights LDR R3, =0b00000001 // LED right bound LDR R4, =0b10000000 // LED left bound LDR R5, =0X02FFFFFF // for delay MOV R6, R3 // R6 --> LED initialization MOV R7, #0 // R7 counter

DISPLAY: STR R6, [R2] // load SW switches

DELAY: ADD R7, R7, #1 // R7 = R7 + 1 CMP R7, R5 BEQ CHECK B DELAY

CHECK: MOV R7, #0 CMP R6, R4 BEQ RESET LSL R6, R6, #1 B DISPLAY

RESET: MOV R6, R3 B DISPLAY

2nd code: LED go from left to right.

.include "address_map_arm.s"

.text /* executable code follows */ .global _start _start: LDR R2, =LED_BASE // base address of LED lights LDR R3, =0b10000000 // LED right bound LDR R4, =0b00000001 // LED left bound LDR R5, =0X02FFFFFF // for delay MOV R6, R4 // R6 --> LED initialization MOV R7, #0 // R7 counter

DISPLAY: STR R6, [R2] // load SW switches

DELAY: ADD R7, R7, #1 // R7 = R7 + 1 CMP R7, R5 BEQ CHECK B DELAY

CHECK: MOV R7, #0 CMP R6, R4 BEQ RESET LSR R6, R6, #1 B DISPLAY

RESET: MOV R6, R3 B DISPLAY

Please combine these two code to make the led go back and forth. Or write a new one.

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions