Program to calls to echo the typed characters, C/C++ Programming

Write a main program that uses these system calls to echo the typed characters. The pseudo code will look something like:

void traphandler ()  {

   if (R0 == 0) { // read system call

      R1 = getchar(); // poll the status register of the IO terminal until a char is available then load it into R1

   } else if (R0 == 1) { // write system call

      putchar(R1); // just store R1 to memory location 0xfff0

   }

   enableInterrupts();

}

void main() {

   char c;

   while (1) {

      c = read();  // set R0 to 0 can issue the 'trap' instruction, result will be in R1

      write(c);  // set R0 to 1 and set R1 to 'c' and issue the 'trap' instruction

   }

}

Posted Date: 3/8/2013 6:26:43 AM | Location : United States







Related Discussions:- Program to calls to echo the typed characters, Assignment Help, Ask Question on Program to calls to echo the typed characters, Get Answer, Expert's Help, Program to calls to echo the typed characters Discussions

Write discussion on Program to calls to echo the typed characters
Your posts are moderated
Related Questions
write a queue program in c langauge?

how to write c++ code for financial system using class and object

How to specify different memory sections for a variable using #Pragma?

SquareMaze The SquareMaze class should be declared and defined in maze.h and maze.cpp, respectively. Each SquareMaze object will represent a randomly-generated square maze and its

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.   #include float start_point, /* G

if one won't explicitly call the destructor of a local; then how does he handle the above situation?

Write out pseudocode for a function called "and" that takes two arguments, both booleans, and returns the logical and of the inputs. DO NOT use the logical and operator: instead, w

a program that declares and prompts the user to enter two integer and performs the five arithmetic operations

When declaring a variable of data type pointer, use the * in front of the variable name. These variables hold a memory location (like B45CDF), not an actual value like 30 or A:

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send