[Solved] CS341 mp3-Accessing I/O Ports using assembly language

$25

File Name: CS341_mp3_Accessing_I_O_Ports_using_assembly_language.zip
File Size: 499.26 KB

SKU: [Solved] CS341 mp3-Accessing I/O Ports using assembly language Category: Tag:
5/5 - (1 vote)

The purpose of this assignment is to gain some familiarity with writing C callable functions that do things that cant be done in C such as accessing I/O ports. Copy all files from /courses/cs341/s20/cheungr/mp3_linux to your mp3_linux subdirectory of cs341.Use the provided makefile for all builds except where instructed otherwise. As in mp1 and mp2, use ulab to build all your executables and use the VMs to run and debug your code.

  1. Program a UART directly in assembler

Please note that we consider this the old-fashioned way to do this programming! The current way is to use assembler only where it is required. Write an assembler function to read and echo characters. The C driver does the same initial logic determining whether or not the console is a COM port and if so which one, and if not, just return. In the new version, it then goes on to ask the user for the escape character that stops the echo loop. This can be CONTROL-A, but it doesnt have to be. The user types the actual character, not its ASCII code or whatever, to specify the escape character. Then the C driver calls the assembler echo function:

void echo(int comport, unsigned char esc_char)

The assembler code does the loop with in and out instructions to do the actual I/O, testing for the special esc_char and returning when it is seen coming from the user. Call your files echo.s and echoc.c. In file echo.script, show:

  • a run with abc followed by the esc_char,
  • a second run with abcde<CR>xy followed by the esc_char, and 3) a third run with abcde<CR><LF>xy, then esc_char.

1

University of Massachusetts Boston Dr. Ronald Cheung

Computer Architecture and Organization CS 341 Spring 2020

Machine Project Assignment

If your keyboard doesnt have a key marked line feed, use <control-J>. Since we havent asked for any special treatment for <CR>, the xy of the second test should overwrite the ab, but the <LF> should prevent this in the third test.

FINAL NOTE:

In the event that you are unable to correctly complete this assignment by the due date, do not remove the work you were able to accomplish partial credit is always better than none.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS341 mp3-Accessing I/O Ports using assembly language[Solved] CS341 mp3-Accessing I/O Ports using assembly language
$25