Microsoft Word - 21W CST8216 Lab Assignment 3B - Lab Week Eleven.docx CST8216 Processor Architecture Lab Exercises Last Revision Winter 2021 Page 1 of 8 © 2021 D. Haley 21W CST8216 Lab Assignment 3B -...

1 answer below »
Assembly language 68HCS12


Microsoft Word - 21W CST8216 Lab Assignment 3B - Lab Week Eleven.docx CST8216 Processor Architecture Lab Exercises Last Revision Winter 2021 Page 1 of 8 © 2021 D. Haley 21W CST8216 Lab Assignment 3B - Lab Week Eleven.Docx       Assignment 3B (50 marks) – Lab Week 11 – BCD Counter and More on Arrays Approximate time to complete: 3 – 4 hours.   Due Date:  By 11:30 PM of Saturday of Week 12 – Assignment 3B – Submission Link for Assignment 3B –  Lab Week 11 BCD_Counter.asm and Reverse.asm – Code Submissions (use 2 separate files –  DO NOT place them into a compressed file)  This lab exercise may be optionally performed by up to THREE students in the same lab section working as a group  (students pick their own partners). Also, ensure all student names/numbers are on all program listings and  documentation in order for all students to receive credit for the work (No name, no credit). There is only ONE submission  required per group of students – ENSURE THAT EVERYONE IN THE GROUP KNOWS WHO IS SUBMITTING THE  SOLUTIONS.    Note: If your name is not on the submitted code listings, no credit will be given for the submission.    Purpose of the LAB: The purpose of this lab is to further your understanding of BCD arithmetic operations, iteration and Assembly  Language programming by writing a program that implements a BCD Counter (BCD_Counter.asm) and a  program that reverses an Array while decrypting a Secret Message (Reverse.asm). The use of the Simulator’s  HEX Displays, Stack Operations, 8‐bit Multiplication and 16‐bith Division will be used in this assignment. These  activities are based Week 10’s and 11’s Lectures and various Hybrid Lectures, including The Stack Hybrid  Lecture.    Task One – The BCD Counter (25 marks)  For this lab assignment, you are required to code a BCD counter using Assembly Language that continually counts from $00 BCD$15 BCD$00 BCD$15 BCD, etc. and correctly displays the count on the HEX Displays as illustrated below. Note that you must use only one of the Accumulators to hold your count; the ideal one to use based upon lecture discussions regarding the instruction daa. Then, on an as-required basis, you will need to push and pull its value to and from the stack to save the count at the appropriate time(s) in your program. That process We will use the 7-Segment HEX Displays on the Simulator to display our count from $00 BCD $15 BCD$00 BCD $15 BCD etc.,   While we will not be able to run our solution on the Dragon 12 Plus board this semester, this what the display would look like.    To assist in your software development, the A3B_BCD_Counter Package.zip contains the following material:    a. Visio‐ Counter_$00_‐_$15_BCD.pdf is the  flowchart containing BCD_Counter.asm  implementation details  b. CST8216 68HCS12 API Booklet.pdf explains  the Assembly Language Subroutines and  Library Routines in API.s19 that are to be used  by BCD_Counter.asm   c. BCD_Counter.asm is the Starter Code to build  upon for the final version of your solution.   d. BCD_Counter.asm.txt is a backup of the  Starter Code, provided in case the Start Code  becomes misaligned when opening it  e. API.s19 is the  Motorola s19 file  that contains the  assembled API,  which must be  loaded into the  Simulator  There is also a video (BCD_Counter.mp4) that illustrates  how to use the Simulator in this Assignment to load your  files and turn on the HEX Displays. The video also  illustrates the expected behaviour of BCD_Counter.asm CST8216 Processor Architecture Lab Exercises Last Revision Winter 2021 Page 2 of 8 © 2021 D. Haley 21W CST8216 Lab Assignment 3B - Lab Week Eleven.Docx       Development Requirements and Constraints To be considered for full credit for this portion of the assignment, you are to write a “main” Assembly Language program called BCD_Counter.asm that solves the problem specification detailed in this document and illustrated in the provided flowchart and video. Here are the constraints for BCD_Counter.asm  Use the supplied “starter” code as a starting point for your solution, noting the comments within.  Make use of the supplied Library Routines in lines 16 – 21 of the code. The instructions for their use are in the CST8216 68HCS12 API Booklet and an example of their use is provided in line 44 of the code for Config_HEX_Displays  Make use of the CONSTANTS DIGIT3_PP0 and DIGIT2_PP1 as well as DVALUE in your solution.  You MUST use ONLY one Accumulator for the BCD count and correctly use the instruction daa as taught in lecture and fully documented in the course texts; otherwise; little credit will be given for your solution even if it appears to be 100% functional.  You MUST use the Stack to temporarily store and retrieve the value of the BCD count as applicable. YOU MAY NOT USE any other methods to temporarily store and retrieve values; otherwise, little credit will be given for your solution.  You MUST use Iteration in your solution.  Do NOT code the BCD values into an array and use it to output the count.  Use AsmIDE to develop the program code and the Simulator to debug your solution.  Fully documented Program Header to include Student Name(s), Student Number(s) and the Code Completion Data. This information must be included; otherwise, there will be NO CREDIT for the submission)  Fully document BCD_Counter.asm, describing WHAT each line of code does, NOT the instruction set. Note that your code should be able to fit between lines 46 and 68 of the supplied starter code listing. If you find yourself greatly exceeding that limit, then you are likely on the wrong track with this assignment. It may seem odd that the flowchart indicates that you must Extract the MSB and LSB from the count to display the count’s value on the HEX displays. This requirement exists because only one value can be displayed on the HEX displays at any one time unless you use something called “Interrupt Driven Software”, which is beyond the scope of those. As such, we must use a process called “Time Division Multiplexing” and display only one digit at a time. But, if we do it quickly enough, it will appear as if both digits are being displayed at the same time. Note that this is only true on the hardware board and not in the Simulator. Here is a pictorial representation of the functionality of these two Subroutines, which are included for you in the API.s19 file. Extract_MSB – Subroutine to extract MSB (the upper nibble of the Accumulator) from an 8-bit Accumulator as per the following example:  Extract_LSB – Subroutine to extract LSB (the lower nibble of the Accumulator) from an 8-bit Accumulator as per the following illustration: CST8216 Processor Architecture Lab Exercises Last Revision Winter 2021 Page 3 of 8 © 2021 D. Haley 21W CST8216 Lab Assignment 3B - Lab Week Eleven.Docx       Task Two – Reversing an Array and Decrypting a Secret Message (25 marks)  Sometime ago, a student who had successfully completed CST8216 left an encrypted Secret Message for future students taking the course. Knowing that the understanding of Pointers, Arrays and Stack Operations are a major topic in the course, he left behind a file containing an encrypted Secret Message and asked that it be named A3B_Array.txt. Your task will be to create a program that reveals the encrypted Secret Message depicted below. To assist in your software development, the A3B_Reverse Package.zip contains the following material:    a. Visio‐ A3B_Reverse_Array.pdf is the flowchart containing Reverse.asm  implementation details  b. Reverse.asm is the Starter Code to built upon for the final version of your  solution.   c. Reverse.asm.txt is a backup of the Starter Code, provided in case the  Start Code becomes misaligned when opening it  d. A3B_Array.txt is the array file containing the encrypted Secret Message  Development Requirements and Constraints To be considered for full credit for this portion of the assignment, you are to write a “main” Assembly Language program called Reverse.asm that solves the problem specification detailed in this document and illustrated in the provided flowchart. Here are the constraints for Reverse.asm  Use the supplied “starter” code as a starting point for your solution, noting the comments within.  Your solution must copy and reverse the supplied array, while performing the following additional operations to decrypt the Secret Message. o After reading in a value, we decrypt the value by o a. dividing the value by 3 o b. then adding 32 to the value o c. storing the modified value  Make use of the CONSTANTS DIVISOR and ADDED VALUE in your solution.  You MUST use the Stack to temporarily store and retrieve values, as required. You MAY NOT USE any other methods to temporarily store and retrieve values; otherwise, little credit will be given for your solution.  You MUST use Iteration in your solution.  Correctly use the instruction idiv in your solution. It is well documented in the course text and Programmer’s Manual.  Use AsmIDE to develop the program code and the Simulator to debug your solution.  Fully documented Program Header to include Student Name(s), Student Number(s) and the Code Completion Data. This information must be included; otherwise, there will be NO CREDIT for the submission)  Fully document Reverse.asm, describing WHAT each line of code does, NOT the instruction set. Note that your code should be able to fit between lines 32 and 46 of the supplied starter code listing. If you find yourself greatly exceeding that limit, then you are likely on the wrong track with this assignment. CST8216 Processor Architecture Lab Exercises Last Revision Winter 2021 Page 4 of 8 © 2021 D. Haley 21W CST8216 Lab Assignment 3B - Lab Week Eleven.Docx       Assessment Note: If your Name and Student Number are missing in the Program Header on any Code Submission, you will receive  a mark of zero for the submission, as you are not indicating that it is your original, independently created work.    You will be assessed in accordance with the following marking rubrics, which are also available on the Assignment  link.    BCD_Counter.asm    CST8216 Processor Architecture Lab Exercises Last Revision Winter 2021 Page 5 of 8 © 2021 D. Haley 21W CST8216 Lab Assignment 3B - Lab Week Eleven.Docx       CST8216 Processor Architecture Lab Exercises Last Revision Winter 2021 Page 6 of 8 © 2021 D. Haley 21W CST8216 Lab Assignment 3B - Lab Week Eleven.Docx       Reverse.asm CST8216 Processor Architecture Lab Exercises Last Revision Winter 2021 Page 7 of 8 © 2021 D. Haley 21W CST8216 Lab Assignment 3B - Lab Week Eleven.Docx               CST8216 Processor Architecture Lab Exercises Last Revision Winter 2021 Page 8 of 8 © 2021 D. Haley 21W CST8216 Lab Assignment 3B - Lab Week Eleven.Docx
Answered 7 days AfterMar 27, 2021

Answer To: Microsoft Word - 21W CST8216 Lab Assignment 3B - Lab Week Eleven.docx CST8216 Processor Architecture...

Sandeep Kumar answered on Mar 31 2021
161 Votes
; BCD_Counter.asm
; Author: D. Haley, Faculty
; Modified by:(s) here>
; Student Number(s):
; Course: CST8216 Winter 2021
; Date:
;
; Purpose BCD Counter $00 - $15 (BCD) using Hex Displays
; and a single register, Accumulator A, for the count
; The range of counting can be altered by changing the
; FIRST_BCD and END_BCD constants
;
; ***** DO NOT CHANGE ANY CODE BETWEEN THESE MARKERS *****
; Library Routines - to be used in your solution
;
Config_Hex_Displays equ $2117
Delay_Ms equ $211F
Hex_Display equ $2139
Extract_Msb equ $2144
Extract_Lsb equ $2149
; Program Constants - to be used in your solution
STACK equ $2000
; Port P (PPT) Display...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here