Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assembly ( Microcontrollers and Microprocessors class): Problem 1) Extend the ne

ID: 3783543 • Letter: A

Question

Assembly ( Microcontrollers and Microprocessors class):

Problem 1) Extend the nested loop above to a dual nested loop with three counters CINN, CMID, and COUT.

Probelm 2) Given your loop in Problem 1, what is the expression for the number of instruction cycles it takes to execute the timing loop.

COUT CIN OUTER: INNER: NXT: equ d' 1 equ 0x20 equ 0x21 org 0x0100 movlw d' 10' movwf COUT d' 255 movlw movwf CIN decfsz CIN,F goto NXT decfsz COUT.F goto INNER destination- file reg. outer counter storage inner counter storage 5 program location start 1 1 1 1 1 (2) 1 (2) 2

Explanation / Answer

problem 1)

F equ d'1'

COUT equ 0x20

CIN equ 0x21

CMID equ 0x22

org 0x10

OUTER movlw d'10'

movwf COUT

INNER movlw d'255'

movwf CIN

NEW movlw d'255'

movwf CMID
NEXT decfsz CMID,F

goto NEXT

decfsz CIN,F

goto NEW

decfsz COUT,F

goto INNER

problem 2)

expression that defines the number of instruction cycles that takes for executing the timing loop of the above problem is

SInce it is a nested loop :

Expression= COUT * CIN * CMOD

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote