Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

there is no need to put the code in the app 2. Type the first program shown at the end of the lab into AsmIDE.

there is no need to put the code in the appimage text in transcribedimage text in transcribed

2. Type the first program shown at the end of the lab into AsmIDE. The program uses the delay loop we developed in class. Look at the values of the variables Pattern 1 and Pattern2 and make a prediction of what you should see on the display. Given the E clock on our HCS12 boards is running at 24 MHz, what is the period of the E clock in ns? The opt C directive in the program delay subroutine causes the assembler to display the number of clock cycles required for each instruction in the listing file. How much time does it take for the delay loop to execute once? The Delay subroutine is using register X for the delay constant. What is the maximum value that can be placed in X? Calculate the execution time for the whole Delay subroutine. 3. Assemble your program, download it to the HCS12 board and run the program. The program, adapted from a microcontroller using a 1 MHz clock, was designed to give a clearly visible output. Are you able to see the pattern alternating? Yes/No Why Yes or why No? ; File name: Lab5-a.asm This program outputs two alternating patterns to the LEDs connected to Port H. ; STACK: REGBLK: equ equ $3000 $0000 pth: ddrh: equ equ $260 $262 port H data register ;port H direction register: ; O means input, 1 means output Patternl: Pattern: equ equ $55 SAA start: ; initialize stack ; initialize X to point to registers ; make port H pins output org lds 1dx ldaa staa ldaa staa bsr ldaa staa bsr bra swi $2000 #STACK #REGBLK # $FF ddrh,x #Patterni pth, x Delay #Pattern pth, x Delay start ; Delay - a simple delay subroutine opt Delay: #SFFFF loop: PSHX LDX NOP NOP NOP DEX BNE PULX RTS loop end 2. Type the first program shown at the end of the lab into AsmIDE. The program uses the delay loop we developed in class. Look at the values of the variables Pattern 1 and Pattern2 and make a prediction of what you should see on the display. Given the E clock on our HCS12 boards is running at 24 MHz, what is the period of the E clock in ns? The opt C directive in the program delay subroutine causes the assembler to display the number of clock cycles required for each instruction in the listing file. How much time does it take for the delay loop to execute once? The Delay subroutine is using register X for the delay constant. What is the maximum value that can be placed in X? Calculate the execution time for the whole Delay subroutine. 3. Assemble your program, download it to the HCS12 board and run the program. The program, adapted from a microcontroller using a 1 MHz clock, was designed to give a clearly visible output. Are you able to see the pattern alternating? Yes/No Why Yes or why No? ; File name: Lab5-a.asm This program outputs two alternating patterns to the LEDs connected to Port H. ; STACK: REGBLK: equ equ $3000 $0000 pth: ddrh: equ equ $260 $262 port H data register ;port H direction register: ; O means input, 1 means output Patternl: Pattern: equ equ $55 SAA start: ; initialize stack ; initialize X to point to registers ; make port H pins output org lds 1dx ldaa staa ldaa staa bsr ldaa staa bsr bra swi $2000 #STACK #REGBLK # $FF ddrh,x #Patterni pth, x Delay #Pattern pth, x Delay start ; Delay - a simple delay subroutine opt Delay: #SFFFF loop: PSHX LDX NOP NOP NOP DEX BNE PULX RTS loop 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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions