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
#questionAt a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets

What is the specialty in sizeof() operator

#include #include #include #include #include class Employee { private: char *Name; //Set them as pointers... int IdNumber; char *Department; char *Position; public: voi

I want MODI method''s coding in c++ using all concepts of c++..please help me its my project work...

Define the Recursion Function in C? In C, it is potential for the function to call themselves a function is describing 'recursive' if a statement within the body of a function

I want a PROGRAM - Facebook auto like system to increase fans to different fanpage It has in a program that take Facebook mails and passwords from a excel file (.xlsx) for examp

Define the Stream Oriented Data Files? There are two dissimilar types of data files called stream-oriented (or standard) data files and system-oriented (or low-level) data file


Flash my terminal vx670 Project Description: Have VeriFone software need it to communicate with the vx670 through com port 1 it is not talking I'm not sure why have all the r

Mixed Mode Expressions and Implicit type Conversions A mixed mode expression is one in which the operands are not of the similar type. In this case, the operands are converted