Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Check the following two assembly codes; try to understand each command line; put comments after each command line. Re-program the given code to illuminate the

Check the following two assembly codes; try to understand each command line; put comments after each command line. Re-program the given code to illuminate the LEDs such that every two LEDs illuminate together every time, have a time delay, then shift to next two LEDs in turn. In other words, it is a rotation of two illuminating LEDs.

; This is a code to illuminate LEDS on Dragon12+ Board

; This program uses Port B as the output port to drive LEDs while using the digit 1 of Port J to be the

; common terminals of all LEDs

PORTB equ $0001

DDRB equ $0003

PTJ equ $0268

DDRJ equ $026A

ptp equ $258

ddrp equ $25a

org $1000

lpcnt ds.b 1

org $1500

start movb #$FF, DDRB

movb #$ff, ddrp;

movb #$02, DDRJ;

ldaa #$FD;

staa PTJ;

movb #$FF, ptp;

forever movb #16, lpcnt

ldx #led_tab

led_lp movb 1, x+, portb

jsr delay

dec lpcnt

bne led_lp

bra forever

led_tab dc.b $80, $40, $20, $10, $08, $04, $02, $01

dc.b $01, $02, $04, $08, $10, $20, $40, $80

delay ldab #20

out_loop ldy #20000

inner_loop psha

pula

dbne y, inner_loop

dbne b, out_loop

rts

end

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

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions

Question

1 . Television News channels importantance of our Life pattern ?

Answered: 1 week ago

Question

1. How is the newspaper help to our daily life?

Answered: 1 week ago

Question

1. Prepare a short profile of Mikhail Zoshchenko ?

Answered: 1 week ago

Question

What is psychology disorder?

Answered: 1 week ago

Question

LO5 Describe job analysis and the stages in the process.

Answered: 1 week ago