Programming projects and Assembly Examples

 

Two from the many in the text

 

16-bit.asm from text chapter 3

Add and Subtract

 

 

A few assembly examples that don’t use Irvine includes and libraries

 

Example1 Hello World
Example2 A comparison
Example3 Echo string
Example4 You can print messages a character at a time, using loops  Two versions
Example5 Factorials
Example6Using an array
Example7 Using the system stack

Links for sample exams:
Test 1
Test 2 note that topics not covered in class will not be on the exam. 

Projects and due dates

  1. Program 1 (part 1)  Due Monday September 10th , 2012

                                                    i.          HexIO program.  Use a 16 bit realmode program template (like addsub2.asm from chapter 3) and write code to read in and print out a hex int.  Note:  We'll write the code to do this for decimal values in class.  In most ways, handling binary, octal and hex in assembly is significantly easier than handling decimal. Add some functionality to this program so that it is clear a numeric value is being stored, for example, output the original integer and then the integer plus (or minus) some amount.

  1. Program 1 (part 2) Due Fri, September 21th , 2012   Modify your I/O routines from program 1 (part 1) using class notes so that you can enter and output decimal values.  Add further functionality to your first project so it can read in two positive integers and find the GCD according to Euclid.  Build a 16-bit real-mode program.

                                                    i.          Extra credit: handle 32 bit integers.

                                                  ii.          Extra credit: Error checking of input data

                                                iii.          Extra credit: A similar problem would be to check if a positive (input) decimal integer is prime.

  1.  Sorting ints: Assignment date: Friday, October 12, 2012

                                                    i.          Use 32bit asm for this exercise! As you may have learned from project 2, activities that are fairly easy to do in high level language become problematic in assembly.  Read in 10  integers, print them out.  Sort using an index sort (move elements in a subscript array, not the values array), print them out again. Use text (readDec or readInt and witeDec or writeInt) procedures for reading in and writing out integers.  Write your own proc to sorting them. Do not sort a byte array. Sort a word or dword array.  For this project you may use procedures readInt, writeInt and writeString from the Irvine link library.  Use 32 or 16 bit program format.  Hint: write it in C++ first.

  1. Sorting words: Assignment date: Friday Oct 26th, 2012

                                                    i.          Use 32bit asm for this exercise! Read in 10 words of up to 19 characters each, print them out.  Sort using an index sort (move elements in a subscript array, not the values array), print them out again.  Use procedures for reading in words, printing out words, sorting words.  If you did a careful job on your last project, this won’t be too bad.

  1. Using mouse, color/text graphics, and random generator. Friday Nov 9th, 2012. You will have to use 16 bit for this.

                                                    i.          Show a prompt at a random position on the screen: "Click on this message".

                                                  ii.          clear the keyboard buffer

                                                iii.          Time the user's reflexes from when the prompt appears till mouse clicks on the message.

                                                iv.          Wait a random amount of time.

                                                  v.          Do it all again, (ten times total).

                                                vi.     Show the array of elapsed times and determine the max, min and mean values.

  1. 8087 co-processor: Due Wednesday Nov 28th , 2012…  Use 32bit asm for this exercise!

Your choice:

Choice 1:   Build Euclid's GCD calculator using the coprocessor, processing BCD formatted int values.  (Ie., Input and output will be 18 digit integers.) 

Choice 2: Alternatively, implement fp I/O for real values with format:  (optional sign) required digit(s). required digit(s)…. Or as a regular expression, something like

(‘ ‘|(+|-))\d+\.\d+

This means +1112.4, 2.4 and -2.499999 would all be acceptable fp values.  -.5 would be illegal and so would -5.  Your program should allow the user to input two or more values and then select some arithmetic operation to do with them, and then output the result.

7.    Final project.  Due Wednesday, Dec 12th at 8:30am --- our final exam period.  During the final exam period we will demonstrate our final projects.  A simple video game or learning game using graphics would be acceptable. Remember, if you plan to use mouse and/or video you will need 16 bit. You must talk to me about what you plan to do. For example, you might build on proj 6 choice 2 and implement an HP style calculator (which uses postfix).(this would be 32 bit)  Or build a tetrus, space invaders or pong game. finals schedule is posted at http://www.oneonta.edu/admin/registrar/pages/fall/fe.asp You must show me & the class your project.

Extra credit project: MS-DOS file processing:  Use examples from Chapter 13 (copy file to another file, display file contents on screen, etc) to build a file processing application.  Provide a menu with options: directory, filecopy, file display, etc.  Use DOS searchfirst and searchnext interrupts for getting names of files in the current directory and displaying these in rows and columns of equal tabbed width.

C++/assembly interface.  (see me for specifications. Due date will be final exam time)