Basic input -output library of subroutines, C/C++ Programming

GetChar - get a character from the keyboard, echo to the display and return it in reg al.

- Note: if a linefeed (LF) is received (Enter key), a carriage return (CR) will also be echoed.

PutChar - display a character passed in reg al.

The higher level routines which you will write call the above routines. They are:

GetStr - read a string from the keyboard and place it at the address passed in register AX.

- Note: you must delimit this string by placing a ‘at the end

GetNum - read an unsigned 16-bit decimal number (<65535) from the keyboard and return it in register AX.

- Note: for now, you do not need to do any error checking

- this means that you have to be careful when testing!

PutStr - display a string - address is passed in the AX reg

- Note: string passed must be delimited with a ‘

PutLine - display a string (address in AX) and also print CR/LF

- Note: this routine is written for you - it calls PutStr first

PutNum - display a 16 bit signed number passed in the AX reg

- Note: you did this in Lab 2 - you get to re-use code!

Note that since you will be using the AL or AX register to pass and return parameters, you do not save this register inside each subroutine. You must push (and pop) all other registers you use in each subroutine, however.

Be careful with labels since all of the subroutines will be in a single file. You cannot have a duplicate label. Use the convention shown in the subroutines given. Notice that each subroutine has 2 capital letters in the title and these letters are unique. For example, for the GetChar routine, these characters are GC. Precede every label inside this routine with GC (notice GCWait). In this way, you will not have any duplicate labels. You should also remember that the assembler is NOT case sensitive - we only use uppercase letters to improve the documentation. It is good practice to use a capital letter to begin every label.

Once again we will test these subroutines by writing a Main routine during the main lab. This routine will be more complicated; however, as we will display some interesting messages.

Posted Date: 3/26/2013 2:03:17 AM | Location : United States







Related Discussions:- Basic input -output library of subroutines, Assignment Help, Ask Question on Basic input -output library of subroutines, Get Answer, Expert's Help, Basic input -output library of subroutines Discussions

Write discussion on Basic input -output library of subroutines
Your posts are moderated
Related Questions
#include #include #include #include #include class Employee { private: char *Name; //Set them as pointers... int IdNumber; char *Department; char *Position; public: voi

A:BinaryHeap.h ------------ #ifndef BINARY_HEAP_H_ #define BINARY_HEAP_H_ #include "dsexceptions.h" #include "vector.h" // BinaryHeap class // CONSTRUCTION: wi

WAP TO SWAP THE THREE DIGIT NUMBER void main () { int b,r,n,r1,r2; clrscr (); printf ("Enter the Value: "); scanf ("%d",&n); r=n%10; n=n/10; r1=n%10;

Define the Relational Operator in c language? The Relational operators refer to the relationships that values can have with one another and they are used to compare two operand

Imagine that the server program is a setuid program owned by the root, then after you penetrate the program with a shell running, you become the ROOT and you can remove the whole f

#include stdio.h   struct  complex   {   float real;   float imag;   };   struct complex complexadd(struct complex,struct  complex);   void main()     {          Date: 26

Operation on array: void Array::add( Object& toAdd ) {     lastElementIndex++;     while( ptrAt( lastElementIndex ) != ZERO &&            lastElementIndex

sample of program that use in bubble sort using assignment operator in c++

A: The answer to this lies actually, how they used. Along ++i(PreIncrement) the variable is incremented and new value is returned. Thus it needs one instruction to increment the va

Define the Data File in C Programming? Many applications needs that information can written to or read from an auxiliary memory device. Such information is stock up on the memo