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

Assignment Help:

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

   }

}


Related Discussions:- Program to calls to echo the typed characters

What is scope resolution operator, Scope Resolution operator: The scope...

Scope Resolution operator: The scope resolution operator: : is used to access global variable in the inner block. When global and local variable are identical name the scope re

C program to swap two numbers using reference arguments, Aim: To implement...

Aim: To implement a program to swap two numbers using reference arguments. Code: void swap(int *a, int *b) {             int temp;             temp=*a;

What is the use of default constructor, What is the use of default construc...

What is the use of default constructor? - It's a constructor that doesn't accept any parameters. - If there is no user-defined constructor for a class, compiler declares a d

Client server using c, (a) client server or multithreaded client-server, wh...

(a) client server or multithreaded client-server, where server will create pool of worker threads (say 5) to provide services to pool of clients (say 5 ).Server should be behaving

#c++, There is a pebble merchant. He sells the pebbles, that are used for s...

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

Define the category of function - computer programming, Define the Category...

Define the Category of Function? A function, depending on whether arguments or parameters are present or not and whether a value returned or not, may belong to one of the foll

Write code in visual studio 2010, I have a mini project where I need to wri...

I have a mini project where I need to write a code .wonder if someone can help me.I already have the forms and webmaster page done just need to code portion

Explain the working of array with strings, Explain the working of Array wit...

Explain the working of Array with Strings? A string is defined in C language as an array of characters. A null character (‘\0') is automatically added to the end of the charact

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd