Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the Dragon12 lightboard This is the program given before, I'm not sure if it is needed or if a new program is just written

Using the Dragon12 lightboard

This is the program given before, I'm not sure if it is needed or if a new program is just written

#include reg9s12.h

REGBLK: equ $0000

LED_PORT: equ $0001

SW_PORT: equ $0261

org $2000 ; program code starts here

start: ldaa #$ff

staa ddrb+REGBLK ; make port B an output port

staa ddrj+REGBLK ; make port J an output port

staa ddrp+REGBLK ; make port P an output port

ldaa #$0f ; turn off 7-segment display and RGB LED

staa ptp+REGBLK ; portp = 00001111

clra

staa ptj+REGBLK ; make PJ1 low to enable LEDs

staa ddrh+REGBLK ; make port H an input port

LDAA #$2F ; initialize LED value

STAA LED_PORT

back: ldaa SW_PORT ; Read DIP-SW

ANDA #%10000000 ; Use binary to clearly show which bits are affected

BEQ SWOFF

LDAA LED_PORT ; Read LED old value

ORAA #%10000000

STAA LED_PORT

BRA CONTINUE

SWOFF: LDAA LED_PORT ; Read LED Old value

ANDA #%01111111

STAA LED_PORT

CONTINUE: JMP back

; forever unless you reset the board)

Integer division: The IDIV instruction divides the 16-bit numerator in ACCD by the 16-bit denominator in index register X (IX). After execution it puts the quotient in IX and puts the remainder in ACCD. It considers all numbers to be integers. Find the result of IDIV of the following numbers using the listed program. Report the quotient and remainder in your report and verify it by converting numbers to decimal. (D=$30FC, X=$1001), (D=$5F00, X=$2010), (D=$30FF, X=$40F0) ORG $2000 LDD #$30FC LDX #$1001 IDIV SWI The SWI will show the value of registers after execution of program.

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_2

Step: 3

blur-text-image_3

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

3-10. Why are tax havens controversial?

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago