Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!