Digit - Machine Organization - Home Work, Slides of Computer Science

Some concept of Machine Organization are Anatomy, Cache Access Time, Instruction Formats, Instruction Formats, Instruction Formats, Multidimensional Meshes, Network Processors, Snooping Protocol. Main points of this lecture are: Digit, Program, Keyboard, Prints, Values, Variables, The, Standard, Subroutine, Automatically

Typology: Slides

2012/2013

Uploaded on 04/30/2013

ekaan
ekaan 🇮🇳

4.5

(4)

54 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
HW 12
(due at the final exam)
1) Write a C program that requests, reads, and echos the values of the variables X
and Y (one digit each) from the keyboard, and then prints the sum of the two
numbers. Use the scanf and printf standard I/O functions. Test the program,
and show pertinent “snapshots” of the stack.
2) Now write your own scanf subroutine (function) to replace the standard I/O
scanf function used in your program (I would keep it simple). It must be
assembled to be placed at the correct location in the simulator (Unfortunately
we don’t have a linker to do this automatically for us. That would be the normal
procedure.). Again test your program, and show your code replacing the scanf
function and pertinent “snapshots” of the stack.
3) Now, the fun part! Modify your program so that the scanf function operates
with an interrupt. You will now need to add an interrupt routine (which you can
assemble with your scanf function if you like), and will also need to load the
interrupt vector and arm the device (You can do this by hand in the simulator if
you like.). Again test your program, and show your code in the simulator and
pertinent “snapshots” of the stack. Good Luck!
Docsity.com

Partial preview of the text

Download Digit - Machine Organization - Home Work and more Slides Computer Science in PDF only on Docsity!

HW 12

(due at the final exam)

  1. Write a C program that requests, reads, and echos the values of the variables X and Y (one digit each) from the keyboard, and then prints the sum of the two numbers. Use the scanf and printf standard I/O functions. Test the program, and show pertinent “snapshots” of the stack.

  2. Now write your own scanf subroutine (function) to replace the standard I/O scanf function used in your program (I would keep it simple). It must be assembled to be placed at the correct location in the simulator (Unfortunately we don’t have a linker to do this automatically for us. That would be the normal procedure.). Again test your program, and show your code replacing the scanf function and pertinent “snapshots” of the stack.

  3. Now, the fun part! Modify your program so that the scanf function operates with an interrupt. You will now need to add an interrupt routine (which you can assemble with your scanf function if you like), and will also need to load the interrupt vector and arm the device (You can do this by hand in the simulator if you like.). Again test your program, and show your code in the simulator and pertinent “snapshots” of the stack. Good Luck!

Docsity.com