CS 2650 - Computer Architecture

Extra Credit Assembler Programming Assignment

Due no later than April 30, 2009

This extra credit program must be your own work.  You may not discuss or collaborate with any other individual either verbally or electronically.  Any violation of this will be considered cheating and appropriate penalties will apply including failure of the course and possible explusion from the department and/or university.


Create a program to decode a MP3 frame header.  The program will allow the user to enter an 8 digit hex frame header, and then display the Bitrate, Sampling Rate and Channel Mode of the frame. 
For example:

C:\Work>CS2650PX

Enter an MP3 Frame Header or (Q) to Quit> FFFB9264

For frame header FFFB9264
- Bitrate is 128Kbps
- Sampling rate is 44100hz
- Channel Mode is Joint Stereo

Enter a MP3 Frame Header or (Q) to Quit> Q

C:\Work> 
 

 

1.  Use Notepad or a text editor of your choice to create a file CS2650PX.ASM
2.  Create your program using interrupts such as used prior assignments as well as the keyboard interrupt below.
2.
3.  When ready, compile your program using the command. 
nasmw CS2650PX.ASM -oCS2650PX.COM.

4.  Save the program before compiling.
5.  After thoroughly testing your program, upload the two files: CS2650PX.ASM and CS2650PX.COM by the due date.
Partial credit will be given on this assignment, but no credit will be given for programs that do not assemble without errors.

Hints: 
1. Use Interrupt 21H service 0AH for keyboard input. You may want to use debug to watch how this interrupt function works.
2. Remember that the keyboard input will be ASCII and will need to be converted to binary for the decoding process to work correctly.
3. MP3 Frame header decoding information can be obtained from the Week 7 class handout, or from the website:
http://www.mp3-tech.org/programmer/frame_header.html
3. Bits can be examined and manipulated using instructions such as SHR, SHL, AND, XOR.
4. Display output can be done using the same techniques used in prior programming assignments.

Interrupt 21H  Function 0AH
Inputs
AH = 0A
DS:DX = pointer to input buffer area
- Input buffer needs to be formatted as follows:
-1st byte contains maximum characters allowed for input
- 2nd byte contains count of characters entered
- 3rd byte+ input string of characters

Outputs
returns nothing into the registers, but places information into the buffer area

Notes
- A specified number of bytes of data are read from the keyboard into buffer+2
- max buffer size is 255, minimum buffer size is 1 byte
- chars up to and including the CR are placed into the buffer beginning at byte 3; Byte 2 returns the number of characters entered.