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
limitation of function

Write two different arrays. Store the names in it and then compare if both the names entered by the user are the same.

Prepare a script for providing Instagram Followers/Likes I need to prepare a panel where my customer able to get Instagram followers or likes automatically. - A panel where I

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

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of t

what is virtual datatype

Implement a Algorithm to verify if the link list is in Ascending order? A: template bool linklist::isAscending() const{ nodeptr ptr = head; while (ptr->_next)

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

how to explain working of bus connection

Prepare Windows Shell Extension Project Description: Skills required are C++ Programming, Windows Desktop, Windows API