Write the lines of HC12 assembly code for a nested loop to p

Write the lines of HC12 assembly code for a nested loop to perform an action 3,000 times. Do not make it into a subroutine.

Solution

ORG $7000 ; Starting address

LDAB $3000 ; B set to be used as a counter

LDAA #$0 ; A is initialized to zero

BACK ADDA #$1 ; 1 is added to A

DECB ; Decrement B by 1

BNZ BACK ; If B not equal to zero restart the loop or exit

Write the lines of HC12 assembly code for a nested loop to perform an action 3,000 times. Do not make it into a subroutine.SolutionORG $7000 ; Starting address

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site