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

Define external static storage class - computer programming, Define Externa...

Define External Static Storage Class - Computer Programming? An external static is declared outside of all the functions and is obtainable to all functions in that program. The

#title.digital clock, Write a program to print a digital clock which displa...

Write a program to print a digital clock which displays the time for 2 hours .

Write a c program to input three real numbers, Write a C program to input t...

Write a C program to input three real numbers and  print them out as follows : The first variable is ....... and the second one is ...... The last variable is .......... T

Prepare an ipad application clash of clans like game, Prepare an iPad appli...

Prepare an iPad application Clash of Clans like game I would like to prepare a free city building app with the in app purchase possibility. An example game could be Clash of Cla

Working of ordered linked list, Working Ordered linked list: • Eachint...

Working Ordered linked list: • Eachinteger in the queue is stored inside of a QueueItem. The QueueItem contains the integer, and a pointer to the next item in the queue. Fo

Decode the code, Smugglers are becoming very smart day by day. Now they hav...

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

C program to demonstrate pointer to variable, C program to demonstrate Poin...

C program to demonstrate Pointer to variable: void p2a(int *); void main() {                 int x=10, *a,**b;                 int arr[5];                 //poin

Define character input and output with files, Define Character Input and Ou...

Define Character Input and Output with Files? This is done by using equivalents of putchar and getchar which are called putc and getc. Each one takes an extra argument which id

Explain the #undef directive, The #undef Directive This directive undef...

The #undef Directive This directive undefines a previously explained macro. For, example the following will give an error since PI is undefined.                 #define PI 3

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