{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Exercise6 - 0306-250 Assembly Language Programming Fall...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Page 1 of 4 0306-250 Assembly Language Programming Fall 2009 Laboratory Exercise Six: Decimal Adding Machine Using BCD Numbers and Operations This exercise investigates input, storage, addition, and output of packed BCD numbers. The objective of this exercise is familiarization with BCD format and operations. An assembly language program is written to provide the functionality of a decimal adding machine via polled SCI serial I/O and BCD operations. Prelab Work Following the specifications below and the notes you have taken in lecture, write subroutines for adding and printing BCD numbers. You must write the subroutines so that the no registers other than CCR have changed values after return ( RTS ). AddBCD : Adds one packed BCD number to another: X = X + Y . Each number and the sum will have the same number of bytes, which is specified in B . Register X has the address of the first byte of X , and register Y has the address of the first byte of Y . If the sum requires more bytes than specified in B , AddBCD should return with the CCR ’s C bit set; otherwise, C should be clear when AddBCD returns. PutBCD : Transmits through SCI0 the ASCII representation of the packed BCD number whose address is in X . The number of bytes in the number is specified in B . Work on the decimal adding machine program specified below to be demonstrated in the lab procedure. Warning : this exercise may appear easier than it really is. Despite the rather simple functionality, significant effort is required to implement the user interface and input of BCD numbers in assembly language. Program Specification You need to write a program that uses the subroutines from your prelab work to provide a user interface and functionality for a decimal adding machine. Below is the sequence of operations the program must perform.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern