Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Read Through The Assembly Program Below And Answer The Following Questions. A. What Is The Purpose Of Lines 32-35? (1 Point) B. Lines 43 -

 Read Through The Assembly Program Below And Answer The Following Questions. A. What Is The Purpose Of Lines 32-35? (1 Point) B. Lines 43 - 65 Initialize I/O Pin PB.2. What Do Lines 51 - 53 And Lines 59-61 Accomplish? (2 Points) C. Lines 67 - 84 Initialize I/O Pin PA.0. What Do Lines 70 - 72 And Lines 82 - 84 Accomplish? (2 Points) D. Lines 10 - 26 Toggles

Only answer number (d)

image text in transcribed

 

Read through the assembly program below and answer the following questions. 1 2 3 4 5 a. What is the purpose of lines 32-35? (1 point) b. Lines 43-65 initialize I/O pin PB.2. What do lines 51 - 53 and lines 59-61 accomplish? (2 points) c. Lines 67-84 initialize I/O pin PA.0. What do lines 70-72 and lines 82 - 84 accomplish? (2 points) d. Lines 10-26 toggles the state of pin PB.2 whenever pin PA.0 goes high. Write an assembly language could segment to replace these lines of code, such that, when PA.0 is high, PB.2 goes high, but when PA.0 is low, then PB.2 goes low. (5 points) AREA main_code, CODE, READONLY EXPORT __main ALIGN INCLUDE stm3211xx_constants.s ENTRY 6 7 main PROC 8 9 62345622222222222223333 10 loop 12 13 14 15 16 BL pin init LDR re, =GPIOA_BASE LDR r1, [re, #GPIO_IDR] ANDS r2, r1, #1 CMP r2, #0x01 BNE loop 17 18 LDR r0, =0x00800000 ;~300 ms delay if pushbutton is pressed 19 20 21 inner loop SUBS 0, #1 BNE inner loop LDR ro, =GPIOB_BASE LDR r1, [re, #GPIO_ODR] EOR r1, r1, #(1 < < 2) STR r1, [re, #GPIO_ODR] B loop 27 28 ENDP 29 30 pin_init PROC 35 36 LDR ro, = RCC_BASE LDR r1, [re, #RCC_AHB2ENR] ORR r1, r1, #0x00000002 STR r1, [r0, #RCC_AHB2ENR] ; RCC_AHBENR_GPIOBEN

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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Accounting questions