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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started